Announcing WebKit SDL port

宣布发布 WebKitSDL 端口,这是一个使用 Skia 图形后端的简单 WebKit 版本。此版本旨在方便实验新功能,并为 SDL 用户提供将 WebKit 集成到应用程序中的可能性。可以在 Linux 和 MacOSX 上构建,并且依赖于 Skia 进行图形处理。

转自:http://www.dorothybrowser.com/announcing-webkit-sdl-port/

下载地址 https://gitorious.org/spiegel/webkitsdl/source/master:

Hi. I am Kwang Yul Seo, chief computer scientist at Company 100, Inc.. Today I am happy to announce the WebKit SDL port.

You might wonder why we need another WebKit port because we already have many ports including Mac, Chromium, Qt and Gtk. The reason is simple. We need a simple port which uses skia as its graphics backend. Chromium port uses skia, but the code base of Chromium is quite complex and not easy to experiment new features.

Our team is working on multiple WebKit ports including Android NDK and Linux (STB/TV). We use skia for all the ports we have. Because it takes a long time to build and test on mobile and embedded devices, we needed a bare minimum desktop WebKit port which uses skia.

We’ve decided to open the source code so that the SDL users can embed WebKit in their applications. You can retrieve the source code from the following git repository:

git://www.dorothybrowser.com/WebKitSDL.git

You can build WebKit SDL both on Linux and Mac OS X. Because WebKit SDL depends on skia for graphics, you must build skia before you build WebKit.

To build skia, change the current working directory to Source/ThirdParty/skia.

cd Source/ThirdParty/skia

And make.

make

On Mac OS X, you must give “SKIA_BUILD_FOR=mac” as in the following:

make SKIA_BUILD_FOR=mac

The skia library (libskia.a) is generated under Source/ThirdParty/skia/out/.

Because WebKit SDL build script is written in cmake, you need cmake program to build WebKit SDL. Use -DPORT=SDL to specify the port.

mkdir WebKitBuild
cd WebKitBuild
cmake -DPORT=SDL ../Source

Now we have makefile generated in WebKitBuild directory. Build WebKit with make.

make

To build WebKit SDL in debug mode, pass “-DCMAKE_BUILD_TYPE=debug” as cmake command line arguments.

cmake -DPORT=SDL -DCMAKE_BUILD_TYPE=debug ../Source/

Once build is done, you can launch SDLLauncher. It is a simple test browser located under Tools/SDLLauncher.

./Programs/SDLWebLauncher
详细解析: static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const AvahiAddress *src_address, uint16_t port, const AvahiAddress *dst_address, AvahiIfIndex iface, int ttl) { AvahiInterface *i; int from_local_iface = 0; assert(s); assert(p); assert(src_address); assert(dst_address); assert(iface > 0); assert(src_address->proto == dst_address->proto); if (!(i = avahi_interface_monitor_get_interface(s->monitor, iface, src_address->proto)) || !i->announcing) { avahi_log_debug("Received packet from invalid interface."); return; } if (port <= 0) { /* This fixes RHBZ #475394 */ avahi_log_debug("Received packet from invalid source port %u.", (unsigned) port); return; } if (avahi_address_is_ipv4_in_ipv6(src_address)) /* This is an IPv4 address encapsulated in IPv6, so let's ignore it. */ return; if (originates_from_local_legacy_unicast_socket(s, src_address, port)) /* This originates from our local reflector, so let's ignore it */ return; /* We don't want to reflect local traffic, so we check if this packet is generated locally. */ if (s->config.enable_reflector) from_local_iface = originates_from_local_iface(s, iface, src_address, port); if (avahi_dns_packet_check_valid_multicast(p) < 0) { avahi_log_debug("Received invalid packet."); return; } if (avahi_dns_packet_is_query(p)) { int legacy_unicast = 0; char t[AVAHI_ADDRESS_STR_MAX]; /* For queries EDNS0 might allow ARCOUNT != 0. We ignore the * AR section completely here, so far. Until the day we add * EDNS0 support. */ if (port != AVAHI_MDNS_PORT) { /* Legacy Unicast */ if ((avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_ANCOUNT) != 0 || avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_NSCOUNT) != 0)) { avahi_log_debug("Invalid legacy unicast query packet."); return; } legacy_unicast = 1; } if (!is_mdns_mcast_address(dst_address) && !avahi_interface_address_on_link(i, src_address)) { avahi_log_debug("Received non-local unicast query from host %s on interface '%s.%i'.", avahi_address_snprint(t, sizeof(t), src_address), i->hardware->name, i->protocol); return; } if (legacy_unicast) reflect_legacy_unicast_query_packet(s, p, i, src_address, port); handle_query_packet(s, p, i, src_address, port, legacy_unicast, from_local_iface); } else { char t[AVAHI_ADDRESS_STR_MAX]; if (port != AVAHI_MDNS_PORT) { avahi_log_debug("Received response from host %s with invalid source port %u on interface '%s.%i'", avahi_address_snprint(t, sizeof(t), src_address), port, i->hardware->name, i->protocol); return; } if (ttl != 255 && s->config.check_response_ttl) { avahi_log_debug("Received response from host %s with invalid TTL %u on interface '%s.%i'.", avahi_address_snprint(t, sizeof(t), src_address), ttl, i->hardware->name, i->protocol); return; } if (!is_mdns_mcast_address(dst_address) && !avahi_interface_address_on_link(i, src_address)) { avahi_log_debug("Received non-local response from host %s on interface '%s.%i'.", avahi_address_snprint(t, sizeof(t), src_address), i->hardware->name, i->protocol); return; } if (avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_QDCOUNT) != 0 || avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_ANCOUNT) == 0 || avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_NSCOUNT) != 0) { avahi_log_debug("Invalid response packet from host %s.", avahi_address_snprint(t, sizeof(t), src_address)); return; } handle_response_packet(s, p, i, src_address, from_local_iface); } }
09-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值