Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1571)

Unified Diff: Source/core/platform/network/ResourceLoadTiming.h

Issue 15265004: Fix ResourceLoadTiming resolution lose issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add inline help function to satisfy inspector Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/PerformanceTiming.cpp ('k') | Source/core/platform/network/ResourceLoadTiming.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/network/ResourceLoadTiming.h
diff --git a/Source/core/platform/network/ResourceLoadTiming.h b/Source/core/platform/network/ResourceLoadTiming.h
index 2a395ef7c4b0a7f346bc21190655b0549590f5c8..8a36e30f48031cdd6e1581f39c3507678c97195e 100644
--- a/Source/core/platform/network/ResourceLoadTiming.h
+++ b/Source/core/platform/network/ResourceLoadTiming.h
@@ -83,6 +83,24 @@ public:
// We want to present a unified timeline to Javascript. Using walltime is problematic, because the clock may skew while resources
// load. To prevent that skew, we record a single reference walltime when root document navigation begins. All other times are
// recorded using monotonicallyIncreasingTime(). When a time needs to be presented to Javascript, we build a pseudo-walltime
+#ifdef ENABLE_DOUBLE_RESOURCE_LOAD_TIMING
+ // using the following equation (requestTime as example):
+ // pseudo time = document wall reference + (requestTime - document monotonic reference).
+ double requestTime; // All monotonicallyIncreasingTime() in seconds
+ double proxyStart;
+ double proxyEnd;
+ double dnsStart;
+ double dnsEnd;
+ double connectStart;
+ double connectEnd;
+ double sendStart;
+ double sendEnd;
+ double receiveHeadersEnd;
+ double sslStart;
+ double sslEnd;
+
+ double calculateMillisecondDelta(double time) const { return (time - requestTime) * 1000; }
+#else
// using the following equation:
// pseudo time = document wall reference + (resource request time - document monotonic reference) + deltaMilliseconds / 1000.0.
double convertResourceLoadTimeToMonotonicTime(int deltaMilliseconds) const;
@@ -99,21 +117,37 @@ public:
int receiveHeadersEnd;
int sslStart;
int sslEnd;
+#endif
private:
ResourceLoadTiming()
+#ifdef ENABLE_DOUBLE_RESOURCE_LOAD_TIMING
: requestTime(0)
- , proxyStart(-1)
- , proxyEnd(-1)
- , dnsStart(-1)
- , dnsEnd(-1)
- , connectStart(-1)
- , connectEnd(-1)
+ , proxyStart(0)
+ , proxyEnd(0)
+ , dnsStart(0)
+ , dnsEnd(0)
+ , connectStart(0)
+ , connectEnd(0)
, sendStart(0)
, sendEnd(0)
, receiveHeadersEnd(0)
- , sslStart(-1)
- , sslEnd(-1)
+ , sslStart(0)
+ , sslEnd(0)
+#else
+ : requestTime(0)
+ , proxyStart(-1)
+ , proxyEnd(-1)
+ , dnsStart(-1)
+ , dnsEnd(-1)
+ , connectStart(-1)
+ , connectEnd(-1)
+ , sendStart(0)
+ , sendEnd(0)
+ , receiveHeadersEnd(0)
+ , sslStart(-1)
+ , sslEnd(-1)
+#endif
{
}
};
« no previous file with comments | « Source/core/page/PerformanceTiming.cpp ('k') | Source/core/platform/network/ResourceLoadTiming.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698