Source/WebCore/ChangeLog

 12011-12-28 Sergio Villar Senin <svillar@igalia.com>
 2
 3 [GTK] Enable Web Timing
 4 https://bugs.webkit.org/show_bug.cgi?id=42432
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Added WebTiming support to the GTK+ port. WebTiming allows
 9 developers to collect detailed network timing information per
 10 resource. It requires the new SoupMessage's "network-event"
 11 signal.
 12
 13 * GNUmakefile.am:
 14 * bindings/gobject/GNUmakefile.am:
 15 * platform/network/soup/ResourceHandleSoup.cpp:
 16 (WebCore::cleanupSoupRequestOperation):
 17 (WebCore::sendRequestCallback):
 18 (WebCore::currentTimeMinusRequestTime):
 19 (WebCore::wroteBodyCallback):
 20 (WebCore::requestStartedCallback):
 21 (WebCore::networkEventCallback):
 22 (WebCore::startHTTPRequest):
 23 (WebCore::ResourceHandle::platformSetDefersLoading):
 24
1252011-12-26 Darin Adler <darin@apple.com>
226
327 Fix mutation observer build after didMoveToNewDocument change

Source/WebCore/GNUmakefile.am

@@FEATURE_DEFINES += ENABLE_DEVICE_ORIENTATION=1
613613webcore_cppflags += -DENABLE_DEVICE_ORIENTATION=1
614614endif # END ENABLE_DEVICE_ORIENTATION
615615
 616# ---
 617# Web Timing support
 618# ---
 619if ENABLE_WEB_TIMING
 620FEATURE_DEFINES += ENABLE_WEB_TIMING=1
 621webcore_cppflags += -DENABLE_WEB_TIMING=1
 622endif # END ENABLE_WEB_TIMING
 623
616624DerivedSources/WebCore/CSSPropertyNames.cpp: DerivedSources/WebCore/CSSPropertyNames.h
617625DerivedSources/WebCore/CSSPropertyNames.h: $(WEBCORE_CSS_PROPERTY_NAMES) $(WebCore)/css/makeprop.pl
618626 cat $(WEBCORE_CSS_PROPERTY_NAMES) > CSSPropertyNames.in

Source/WebCore/bindings/gobject/GNUmakefile.am

@@webkitgtk_gdom_built_sources += \
436436 DerivedSources/webkit/WebKitDOMHTMLPropertiesCollectionPrivate.h
437437endif
438438
 439
 440if ENABLE_WEB_TIMING
 441webkitgtk_built_h_api += \
 442 $(top_builddir)/DerivedSources/webkit/WebKitDOMPerformance.h \
 443 $(top_builddir)/DerivedSources/webkit/WebKitDOMPerformanceNavigation.h \
 444 $(top_builddir)/DerivedSources/webkit/WebKitDOMPerformanceTiming.h
 445webkitgtk_gdom_built_sources += \
 446 DerivedSources/webkit/WebKitDOMPerformance.cpp \
 447 DerivedSources/webkit/WebKitDOMPerformancePrivate.h \
 448 DerivedSources/webkit/WebKitDOMPerformanceNavigation.cpp \
 449 DerivedSources/webkit/WebKitDOMPerformanceNavigationPrivate.h \
 450 DerivedSources/webkit/WebKitDOMPerformanceTiming.cpp \
 451 DerivedSources/webkit/WebKitDOMPerformanceTimingPrivate.h
 452endif
 453
439454gdom_class_list := $(subst WebKitDOM,, $(filter-out %Private, $(basename $(notdir $(webkitgtk_gdom_built_sources)))))
440455gdom_class_list += Custom EventTarget Object
441456DerivedSources/webkit/webkitdom.h: $(WebCore)/bindings/scripts/gobject-generate-headers.pl $(WebCore)/bindings/gobject/GNUmakefile.am

Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp

@@static void sendRequestCallback(GObject*, GAsyncResult*, gpointer);
136136static void readCallback(GObject*, GAsyncResult*, gpointer);
137137static void closeCallback(GObject*, GAsyncResult*, gpointer);
138138static bool startNonHTTPRequest(ResourceHandle*, KURL);
 139static int currentTimeMinusRequestTime(double requestTime);
139140
140141ResourceHandleInternal::~ResourceHandleInternal()
141142{

@@static void cleanupSoupRequestOperation(ResourceHandle* handle, bool isDestroyin
253254 d->m_cancellable.clear();
254255
255256 if (d->m_soupMessage) {
256  g_signal_handlers_disconnect_matched(d->m_soupMessage.get(), G_SIGNAL_MATCH_DATA,
257  0, 0, 0, 0, handle);
 257 g_signal_handlers_disconnect_matched(d->m_soupMessage.get(), G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, handle);
 258 g_signal_handlers_disconnect_matched(handle->defaultSession(), G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, handle);
258259 d->m_soupMessage.clear();
259260 }
260261

@@static void sendRequestCallback(GObject* source, GAsyncResult* res, gpointer dat
300301 return;
301302 }
302303
 304#if ENABLE(WEB_TIMING)
 305 if (d->m_response.resourceLoadTiming())
 306 d->m_response.resourceLoadTiming()->receiveHeadersEnd = currentTimeMinusRequestTime(d->m_response.resourceLoadTiming()->requestTime);
 307#endif
 308
303309 GOwnPtr<GError> error;
304310 GInputStream* in = soup_request_send_finish(d->m_soupRequest.get(), res, &error.outPtr());
305311 if (error) {

@@static bool addFormElementsToSoupMessage(SoupMessage* message, const char* conte
438444 return true;
439445}
440446
 447static int currentTimeMinusRequestTime(double requestTime)
 448{
 449 return static_cast<int>((monotonicallyIncreasingTime() - requestTime) * 1000.0);
 450}
 451
 452#if ENABLE(WEB_TIMING)
 453static void wroteBodyCallback(SoupMessage *, gpointer data)
 454{
 455 RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);
 456 if (!handle)
 457 return;
 458
 459 ResourceHandleInternal* d = handle->getInternal();
 460 if (!d->m_response.resourceLoadTiming())
 461 return;
 462
 463 d->m_response.resourceLoadTiming()->sendEnd = currentTimeMinusRequestTime(d->m_response.resourceLoadTiming()->requestTime);
 464}
 465
 466static void requestStartedCallback(SoupSession *, SoupMessage *soupMessage, SoupSocket *, gpointer data)
 467{
 468 RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);
 469 if (!handle)
 470 return;
 471
 472 ResourceHandleInternal* d = handle->getInternal();
 473 if (!d->m_response.resourceLoadTiming())
 474 return;
 475
 476 if (d->m_soupMessage.get() != soupMessage)
 477 return;
 478
 479 d->m_response.resourceLoadTiming()->sendStart = currentTimeMinusRequestTime(d->m_response.resourceLoadTiming()->requestTime);
 480}
 481
 482static void networkEventCallback(SoupMessage *, GSocketClientEvent event, GIOStream *, gpointer data)
 483{
 484 ResourceHandle* handle = static_cast<ResourceHandle*>(data);
 485 if (!handle)
 486 return;
 487 ResourceHandleInternal* d = handle->getInternal();
 488 if (d->m_cancelled)
 489 return;
 490
 491 int deltaTime = currentTimeMinusRequestTime(d->m_response.resourceLoadTiming()->requestTime);
 492 switch (event) {
 493 case G_SOCKET_CLIENT_RESOLVING:
 494 d->m_response.resourceLoadTiming()->dnsStart = deltaTime;
 495 break;
 496 case G_SOCKET_CLIENT_RESOLVED:
 497 d->m_response.resourceLoadTiming()->dnsEnd = deltaTime;
 498 break;
 499 case G_SOCKET_CLIENT_CONNECTING:
 500 d->m_response.resourceLoadTiming()->connectStart = deltaTime;
 501 if (d->m_response.resourceLoadTiming()->dnsStart != -1)
 502 // WebCore/inspector/front-end/ResourceTimingView.js assumes that DNS time is included
 503 // in connection time so must substract here the DNS delta that will be added later.
 504 d->m_response.resourceLoadTiming()->connectStart -=
 505 d->m_response.resourceLoadTiming()->dnsEnd - d->m_response.resourceLoadTiming()->dnsStart;
 506 break;
 507 case G_SOCKET_CLIENT_CONNECTED:
 508 // Web Timing considers that connection time involves dns, proxy & TLS negotiation...
 509 // so we better pick G_SOCKET_CLIENT_COMPLETE for connectEnd
 510 break;
 511 case G_SOCKET_CLIENT_PROXY_NEGOTIATING:
 512 d->m_response.resourceLoadTiming()->proxyStart = deltaTime;
 513 break;
 514 case G_SOCKET_CLIENT_PROXY_NEGOTIATED:
 515 d->m_response.resourceLoadTiming()->proxyEnd = deltaTime;
 516 break;
 517 case G_SOCKET_CLIENT_TLS_HANDSHAKING:
 518 d->m_response.resourceLoadTiming()->sslStart = deltaTime;
 519 break;
 520 case G_SOCKET_CLIENT_TLS_HANDSHAKED:
 521 d->m_response.resourceLoadTiming()->sslEnd = deltaTime;
 522 break;
 523 case G_SOCKET_CLIENT_COMPLETE:
 524 d->m_response.resourceLoadTiming()->connectEnd = deltaTime;
 525 break;
 526 default:
 527 ASSERT_NOT_REACHED();
 528 break;
 529 }
 530}
 531#endif
 532
441533static bool startHTTPRequest(ResourceHandle* handle)
442534{
443535 ASSERT(handle);

@@static bool startHTTPRequest(ResourceHandle* handle)
473565 g_signal_connect(soupMessage, "restarted", G_CALLBACK(restartedCallback), handle);
474566 g_signal_connect(soupMessage, "wrote-body-data", G_CALLBACK(wroteBodyDataCallback), handle);
475567
 568#if ENABLE(WEB_TIMING)
 569 g_signal_connect(soupMessage, "network-event", G_CALLBACK(networkEventCallback), handle);
 570 g_signal_connect(soupMessage, "wrote-body", G_CALLBACK(wroteBodyCallback), handle);
 571 g_signal_connect(session, "request-started", G_CALLBACK(requestStartedCallback), handle);
 572#endif
 573
476574 String firstPartyString = request.firstPartyForCookies().string();
477575 if (!firstPartyString.isEmpty()) {
478576 GOwnPtr<SoupURI> firstParty(soup_uri_new(firstPartyString.utf8().data()));

@@static bool startHTTPRequest(ResourceHandle* handle)
485583 && !addFormElementsToSoupMessage(soupMessage, contentType.data(), httpBody, d->m_bodySize)) {
486584 // We failed to prepare the body data, so just fail this load.
487585 g_signal_handlers_disconnect_matched(soupMessage, G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, handle);
 586 g_signal_handlers_disconnect_matched(session, G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, handle);
488587 d->m_soupMessage.clear();
489588 return false;
490589 }

@@static bool startHTTPRequest(ResourceHandle* handle)
492591 // balanced by a deref() in cleanupSoupRequestOperation, which should always run
493592 handle->ref();
494593
 594#if ENABLE(WEB_TIMING)
 595 d->m_response.setResourceLoadTiming(ResourceLoadTiming::create());
 596#endif
 597
495598 // Make sure we have an Accept header for subresources; some sites
496599 // want this to serve some of their subresources
497600 if (!soup_message_headers_get_one(soupMessage->request_headers, "Accept"))

@@static bool startHTTPRequest(ResourceHandle* handle)
499602
500603 // Send the request only if it's not been explicitly deferred.
501604 if (!d->m_defersLoading) {
 605#if ENABLE(WEB_TIMING)
 606 d->m_response.resourceLoadTiming()->requestTime = monotonicallyIncreasingTime();
 607#endif
502608 d->m_cancellable = adoptGRef(g_cancellable_new());
503609 soup_request_send_async(d->m_soupRequest.get(), d->m_cancellable.get(), sendRequestCallback, handle);
504610 }

@@void ResourceHandle::platformSetDefersLoading(bool defersLoading)
578684 // simply check for d->m_scheduledFailure because it's cleared as
579685 // soon as the failure event is fired.
580686 if (!hasBeenSent(this) && d->m_soupRequest) {
 687#if ENABLE(WEB_TIMING)
 688 if (d->m_response.resourceLoadTiming())
 689 d->m_response.resourceLoadTiming()->requestTime = monotonicallyIncreasingTime();
 690#endif
581691 d->m_cancellable = adoptGRef(g_cancellable_new());
582692 soup_request_send_async(d->m_soupRequest.get(), d->m_cancellable.get(), sendRequestCallback, this);
583693 return;

Tools/ChangeLog

 12011-12-28 Sergio Villar Senin <svillar@igalia.com>
 2
 3 [GTK] Enable Web Timing
 4 https://bugs.webkit.org/show_bug.cgi?id=42432
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Updated the jhbuild libsoup requirement. Also web timing is built
 9 by default whenever build-webkit is used.
 10
 11 * Scripts/build-webkit:
 12 * gtk/jhbuild.modules:
 13
1142011-12-24 Kentaro Hara <haraken@chromium.org>
215
316 Add unittests for the C++ parser of prepare-ChangeLog

Tools/Scripts/build-webkit

@@my @features = (
325325 define => "ENABLE_WEB_SOCKETS", default => 1, value=> \$webSocketsSupport },
326326
327327 { option => "web-timing", desc => "Toggle Web Timing support",
328  define => "ENABLE_WEB_TIMING", default => 0, value=> \$webTimingSupport },
 328 define => "ENABLE_WEB_TIMING", default => (isGtk()), value=> \$webTimingSupport },
329329
330330 { option => "workers", desc => "Toggle Web Workers support",
331331 define => "ENABLE_WORKERS", default => (isAppleWebKit() || isGtk() || isBlackBerry()), value => \$workersSupport },

Tools/gtk/jhbuild.modules

128128 </dependencies>
129129 <branch module="libsoup" version="2.37.2.1+git"
130130 repo="git.gnome.org"
131  tag="5cbfc48caf76ced2e28ee06c9e40523273601dc6"/>
 131 tag="7c2f1956808b31ade19a5cb24d16a465ad575421"/>
132132 </autotools>
133133
134134 <autotools id="fontconfig" autogen-sh="configure">

LayoutTests/ChangeLog

 12011-12-28 Sergio Villar Senin <svillar@igalia.com>
 2
 3 [GTK] Enable Web Timing
 4 https://bugs.webkit.org/show_bug.cgi?id=42432
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Removed some tests that are working fine now after adding Web
 9 Timing support.
 10
 11 * platform/gtk/Skipped:
 12
1132011-12-26 Darin Adler <darin@apple.com>
214
315 Check in expected failures for a couple of tests.

LayoutTests/platform/gtk/Skipped

@@gamepad/
260260# Speech input is not yet enabled.
261261fast/speech
262262
263 # Web Timing is not enabled.
264 # https://bugs.webkit.org/show_bug.cgi?id=42432
 263# Web Timing issues
 264# heap size limit undefined
265265fast/dom/Window/window-properties-performance.html
266 fast/dom/navigation-type-back-forward.html
267 fast/dom/navigation-type-navigate.html
268 fast/dom/navigation-type-reload.html
269 fast/dom/webtiming.html
270 fast/dom/webtiming-navigate-within-document.html
271 fast/dom/webtiming-document-open.html
 266# cross-origin redirects
272267http/tests/misc/webtiming-origins.html
273 http/tests/misc/webtiming-one-redirect.php
274 http/tests/misc/webtiming-slow-load.php
 268# SSL start is getting a value when it should apparently not
275269http/tests/misc/webtiming-ssl.php
276 http/tests/misc/webtiming-two-redirects.php
277270
278271# FileSystem API is not supported.
279272fast/filesystem