[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:13:44 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit d0b42ee7af86bbf74cb3e047c0a33ea7f7ab239d
Author: tonyg at chromium.org <tonyg at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jul 15 15:15:31 2010 +0000

    2010-07-14  Tony Gentilcore  <tonyg at chromium.org>
    
            Reviewed by Darin Fisher.
    
            Backfill DNS and connect times rather than exposing hard zeros
            https://bugs.webkit.org/show_bug.cgi?id=42303
    
            There are several cases where domain lookup is not performed and/or a new connection is not established. Previously in these cases, we exposed a "0" to the API. Now, we instead "backfill" with the most recent mark's time.
    
            Also, previously, I was using the ResourceLoadTiming API incorrectly. Each mark is an integer representing offset in milliseconds from requestTime. So all values need to be added to requestTime.
    
            No new test because existing test expectations are set to FAIL because disable disabled by default. The expected results of existings tests change as expected when enabled.
    
            * page/Timing.cpp:
            (WebCore::toIntegerMilliseconds): Move to file static instead of class static because it might generate more optimal code. Also, instead of converting negative doubles to zero, ASSERT that they are >= 0. This is because we no longer expose hard zeros for DNS and connect, so we want to be sure that the -1s returned by the API are properly handled.
            (WebCore::Timing::domainLookupStart):
            (WebCore::Timing::domainLookupEnd):
            (WebCore::Timing::connectStart):
            (WebCore::Timing::connectEnd):
            (WebCore::Timing::requestStart):
            (WebCore::Timing::requestEnd):
            (WebCore::Timing::responseStart):
            * page/Timing.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63426 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8373478..d9d3751 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2010-07-14  Tony Gentilcore  <tonyg at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Backfill DNS and connect times rather than exposing hard zeros
+        https://bugs.webkit.org/show_bug.cgi?id=42303
+
+        There are several cases where domain lookup is not performed and/or a new connection is not established. Previously in these cases, we exposed a "0" to the API. Now, we instead "backfill" with the most recent mark's time.
+
+        Also, previously, I was using the ResourceLoadTiming API incorrectly. Each mark is an integer representing offset in milliseconds from requestTime. So all values need to be added to requestTime.
+
+        No new test because existing test expectations are set to FAIL because disable disabled by default. The expected results of existings tests change as expected when enabled.
+
+        * page/Timing.cpp:
+        (WebCore::toIntegerMilliseconds): Move to file static instead of class static because it might generate more optimal code. Also, instead of converting negative doubles to zero, ASSERT that they are >= 0. This is because we no longer expose hard zeros for DNS and connect, so we want to be sure that the -1s returned by the API are properly handled.
+        (WebCore::Timing::domainLookupStart):
+        (WebCore::Timing::domainLookupEnd):
+        (WebCore::Timing::connectStart):
+        (WebCore::Timing::connectEnd):
+        (WebCore::Timing::requestStart):
+        (WebCore::Timing::requestEnd):
+        (WebCore::Timing::responseStart):
+        * page/Timing.h:
+
 2010-07-15  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/WebCore/page/Timing.cpp b/WebCore/page/Timing.cpp
index 54a4cc9..3423e76 100644
--- a/WebCore/page/Timing.cpp
+++ b/WebCore/page/Timing.cpp
@@ -40,6 +40,12 @@
 
 namespace WebCore {
 
+static unsigned long long toIntegerMilliseconds(double milliseconds)
+{
+    ASSERT(milliseconds >= 0);
+    return static_cast<unsigned long long>(milliseconds * 1000.0);
+}
+
 Timing::Timing(Frame* frame)
     : m_frame(frame)
 {
@@ -101,7 +107,13 @@ unsigned long long Timing::domainLookupStart() const
     if (!timing)
         return 0;
 
-    return toIntegerMilliseconds(timing->dnsStart);
+    // This will be -1 when a DNS request is not performed.
+    // Rather than exposing a special value that indicates no DNS, we "backfill" with fetchStart.
+    int dnsStart = timing->dnsStart;
+    if (dnsStart < 0)
+        return fetchStart();
+
+    return toIntegerMilliseconds(timing->requestTime + dnsStart);
 }
 
 unsigned long long Timing::domainLookupEnd() const
@@ -110,7 +122,13 @@ unsigned long long Timing::domainLookupEnd() const
     if (!timing)
         return 0;
 
-    return toIntegerMilliseconds(timing->dnsEnd);
+    // This will be -1 when a DNS request is not performed.
+    // Rather than exposing a special value that indicates no DNS, we "backfill" with domainLookupStart.
+    int dnsEnd = timing->dnsEnd;
+    if (dnsEnd < 0)
+        return domainLookupStart();
+
+    return toIntegerMilliseconds(timing->requestTime + dnsEnd);
 }
 
 unsigned long long Timing::connectStart() const
@@ -119,7 +137,13 @@ unsigned long long Timing::connectStart() const
     if (!timing)
         return 0;
 
-    return toIntegerMilliseconds(timing->connectStart);
+    // This will be -1 when a new connection is not established.
+    // Rather than exposing a special value that indicates no new connection, we "backfill" with domainLookupEnd.
+    int connectStart = timing->connectStart;
+    if (connectStart < 0)
+        return domainLookupEnd();
+
+    return toIntegerMilliseconds(timing->requestTime + connectStart);
 }
 
 unsigned long long Timing::connectEnd() const
@@ -128,7 +152,13 @@ unsigned long long Timing::connectEnd() const
     if (!timing)
         return 0;
 
-    return toIntegerMilliseconds(timing->connectEnd);
+    // This will be -1 when a new connection is not established.
+    // Rather than exposing a special value that indicates no new connection, we "backfill" with connectStart.
+    int connectEnd = timing->connectEnd;
+    if (connectEnd < 0)
+        return connectStart();
+
+    return toIntegerMilliseconds(timing->requestTime + connectEnd);
 }
 
 unsigned long long Timing::requestStart() const
@@ -137,7 +167,8 @@ unsigned long long Timing::requestStart() const
     if (!timing)
         return 0;
 
-    return toIntegerMilliseconds(timing->sendStart);
+    ASSERT(timing->sendStart >= 0);
+    return toIntegerMilliseconds(timing->requestTime + timing->sendStart);
 }
 
 unsigned long long Timing::requestEnd() const
@@ -146,7 +177,8 @@ unsigned long long Timing::requestEnd() const
     if (!timing)
         return 0;
 
-    return toIntegerMilliseconds(timing->sendEnd);
+    ASSERT(timing->sendEnd >= 0);
+    return toIntegerMilliseconds(timing->requestTime + timing->sendEnd);
 }
 
 unsigned long long Timing::responseStart() const
@@ -161,7 +193,8 @@ unsigned long long Timing::responseStart() const
     // sized cookies, the HTTP headers fit into a single packet so this time
     // is basically equivalent. But for some responses, particularly those with
     // headers larger than a single packet, this time will be too late.
-    return toIntegerMilliseconds(timing->receiveHeadersEnd);
+    ASSERT(timing->receiveHeadersEnd >= 0);
+    return toIntegerMilliseconds(timing->requestTime + timing->receiveHeadersEnd);
 }
 
 unsigned long long Timing::responseEnd() const
@@ -197,13 +230,6 @@ ResourceLoadTiming* Timing::resourceLoadTiming() const
     return documentLoader->response().resourceLoadTiming();
 }
 
-unsigned long long Timing::toIntegerMilliseconds(double milliseconds)
-{
-    if (milliseconds <= 0)
-        return 0;
-    return static_cast<unsigned long long>(milliseconds * 1000.0);
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(WEB_TIMING)
diff --git a/WebCore/page/Timing.h b/WebCore/page/Timing.h
index 93a3804..eaea633 100644
--- a/WebCore/page/Timing.h
+++ b/WebCore/page/Timing.h
@@ -69,8 +69,6 @@ private:
 
     ResourceLoadTiming* resourceLoadTiming() const;
 
-    static unsigned long long toIntegerMilliseconds(double milliseconds);
-
     Frame* m_frame;
 };
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list