[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

tonyg at chromium.org tonyg at chromium.org
Wed Dec 22 11:32:12 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 0d412ebbacd9b96eba15e3d44649985e271296df
Author: tonyg at chromium.org <tonyg at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 28 17:54:19 2010 +0000

    2010-07-28  Tony Gentilcore  <tonyg at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Exclude DNS and SSL time from connect time
            https://bugs.webkit.org/show_bug.cgi?id=43083
    
            The ResourceLoadTiming API's definition of the connect phase includes
            DNS and SSL time. However, the Web Timing spec wants just the TCP time.
            So this patch subtracts those phases out.
    
            No new tests because ResourceLoadTiming fields are not populated by
            TestShell yet.
    
            * page/Timing.cpp:
            (WebCore::Timing::connectStart):
            (WebCore::Timing::connectEnd):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64213 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 791af59..32e55c0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-07-28  Tony Gentilcore  <tonyg at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Exclude DNS and SSL time from connect time
+        https://bugs.webkit.org/show_bug.cgi?id=43083
+
+        The ResourceLoadTiming API's definition of the connect phase includes
+        DNS and SSL time. However, the Web Timing spec wants just the TCP time.
+        So this patch subtracts those phases out.
+
+        No new tests because ResourceLoadTiming fields are not populated by
+        TestShell yet.
+
+        * page/Timing.cpp:
+        (WebCore::Timing::connectStart):
+        (WebCore::Timing::connectEnd):
+
 2010-07-26  Steve Block  <steveblock at google.com>
 
         Reviewed by Jeremy Orlow.
diff --git a/WebCore/page/Timing.cpp b/WebCore/page/Timing.cpp
index df4ed9e..f65322b 100644
--- a/WebCore/page/Timing.cpp
+++ b/WebCore/page/Timing.cpp
@@ -160,31 +160,49 @@ unsigned long long Timing::domainLookupEnd() const
 
 unsigned long long Timing::connectStart() const
 {
-    ResourceLoadTiming* timing = resourceLoadTiming();
+    DocumentLoader* loader = documentLoader();
+    if (!loader)
+        return 0;
+
+    ResourceLoadTiming* timing = loader->response().resourceLoadTiming();
     if (!timing)
         return 0;
 
-    // This will be -1 when a new connection is not established.
+    // connectStart will be -1 when a network request is not made.
     // Rather than exposing a special value that indicates no new connection, we "backfill" with domainLookupEnd.
     int connectStart = timing->connectStart;
-    if (connectStart < 0)
+    if (connectStart < 0 || loader->response().connectionReused())
         return domainLookupEnd();
 
+    // ResourceLoadTiming's connect phase includes DNS and SSL, however Web Timing's
+    // connect phase should not. So if there is DNS time, trim it from the start.
+    if (timing->dnsEnd >= 0 && timing->dnsEnd > connectStart)
+        connectStart = timing->dnsEnd;
+
     return resourceLoadTimeRelativeToAbsolute(connectStart);
 }
 
 unsigned long long Timing::connectEnd() const
 {
-    ResourceLoadTiming* timing = resourceLoadTiming();
+    DocumentLoader* loader = documentLoader();
+    if (!loader)
+        return 0;
+
+    ResourceLoadTiming* timing = loader->response().resourceLoadTiming();
     if (!timing)
         return 0;
 
-    // This will be -1 when a new connection is not established.
+    // connectEnd will be -1 when a network request is not made.
     // Rather than exposing a special value that indicates no new connection, we "backfill" with connectStart.
     int connectEnd = timing->connectEnd;
-    if (connectEnd < 0)
+    if (connectEnd < 0 || loader->response().connectionReused())
         return connectStart();
 
+    // ResourceLoadTiming's connect phase includes DNS and SSL, however Web Timing's
+    // connect phase should not. So if there is SSL time, trim it from the end.
+    if (timing->sslStart >= 0 && timing->sslStart < connectEnd)
+        connectEnd = timing->sslStart;
+
     return resourceLoadTimeRelativeToAbsolute(connectEnd);
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list