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

Unified Diff: Source/core/inspector/InspectorResourceAgent.cpp

Issue 15265004: Fix ResourceLoadTiming resolution lose issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Step1 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/WebKit/chromium/src/WebURLLoadTiming.cpp ('k') | Source/core/page/PerformanceResourceTiming.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorResourceAgent.cpp
diff --git a/Source/core/inspector/InspectorResourceAgent.cpp b/Source/core/inspector/InspectorResourceAgent.cpp
index 250e03b9f284730f60377df0ad0a1108d70f89e8..30ad2bb433ab71290dd17274c1ff041c5953e986 100644
--- a/Source/core/inspector/InspectorResourceAgent.cpp
+++ b/Source/core/inspector/InspectorResourceAgent.cpp
@@ -108,6 +108,23 @@ static PassRefPtr<InspectorObject> buildObjectForHeaders(const HTTPHeaderMap& he
static PassRefPtr<TypeBuilder::Network::ResourceTiming> buildObjectForTiming(const ResourceLoadTiming& timing, DocumentLoader* loader)
{
+#ifdef ENABLE_DOUBLE_RESOURCE_LOAD_TIMING
+ double requestTime = timing.requestTime;
+ return TypeBuilder::Network::ResourceTiming::create()
+ .setRequestTime(loader->timing()->monotonicTimeToPseudoWallTime(requestTime))
+ .setProxyStart((timing.proxyStart - requestTime) * 1000)
+ .setProxyEnd((timing.proxyEnd - requestTime) * 1000)
+ .setDnsStart((timing.dnsStart - requestTime) * 1000)
+ .setDnsEnd((timing.dnsEnd - requestTime) * 1000)
+ .setConnectStart((timing.connectStart - requestTime) * 1000)
+ .setConnectEnd((timing.connectEnd - requestTime) * 1000)
+ .setSslStart((timing.sslStart - requestTime) * 1000)
+ .setSslEnd((timing.sslEnd - requestTime) * 1000)
+ .setSendStart((timing.sendStart - requestTime) * 1000)
+ .setSendEnd((timing.sendEnd - requestTime) * 1000)
+ .setReceiveHeadersEnd((timing.receiveHeadersEnd - requestTime) * 1000)
abarth-chromium 2013/05/22 18:19:05 Should we create an inline helper function to do t
James Simonsen 2013/05/22 21:36:59 Alternatively, why not just store the absolute val
+ .release();
+#else
return TypeBuilder::Network::ResourceTiming::create()
.setRequestTime(loader->timing()->monotonicTimeToPseudoWallTime(timing.convertResourceLoadTimeToMonotonicTime(0)))
.setProxyStart(timing.proxyStart)
@@ -122,6 +139,7 @@ static PassRefPtr<TypeBuilder::Network::ResourceTiming> buildObjectForTiming(con
.setSendEnd(timing.sendEnd)
.setReceiveHeadersEnd(timing.receiveHeadersEnd)
.release();
+#endif
}
static PassRefPtr<TypeBuilder::Network::Request> buildObjectForResourceRequest(const ResourceRequest& request)
« no previous file with comments | « Source/WebKit/chromium/src/WebURLLoadTiming.cpp ('k') | Source/core/page/PerformanceResourceTiming.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698