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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp

Issue 2482153003: DevTools: Depict network request timings on timeline network pane. (Closed)
Patch Set: Tweaks Created 4 years, 1 month 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
Index: third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
index 8372a49337d481db434ade3776be96a53be342bb..bee48c2aac00d2ff4edcd429d507d6c78dbd0dd4 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
@@ -510,6 +510,38 @@ std::unique_ptr<TracedValue> InspectorSendRequestEvent::data(
return value;
}
+namespace {
+void recordTiming(const ResourceLoadTiming& timing, TracedValue* value) {
+ value->setDouble("requestTime", timing.requestTime());
+ value->setDouble("proxyStart",
+ timing.calculateMillisecondDelta(timing.proxyStart()));
+ value->setDouble("proxyEnd",
+ timing.calculateMillisecondDelta(timing.proxyEnd()));
+ value->setDouble("dnsStart",
+ timing.calculateMillisecondDelta(timing.dnsStart()));
+ value->setDouble("dnsEnd", timing.calculateMillisecondDelta(timing.dnsEnd()));
+ value->setDouble("connectStart",
+ timing.calculateMillisecondDelta(timing.connectStart()));
+ value->setDouble("connectEnd",
+ timing.calculateMillisecondDelta(timing.connectEnd()));
+ value->setDouble("sslStart",
+ timing.calculateMillisecondDelta(timing.sslStart()));
+ value->setDouble("sslEnd", timing.calculateMillisecondDelta(timing.sslEnd()));
+ value->setDouble("workerStart",
+ timing.calculateMillisecondDelta(timing.workerStart()));
+ value->setDouble("workerReady",
+ timing.calculateMillisecondDelta(timing.workerReady()));
+ value->setDouble("sendStart",
+ timing.calculateMillisecondDelta(timing.sendStart()));
+ value->setDouble("sendEnd",
+ timing.calculateMillisecondDelta(timing.sendEnd()));
+ value->setDouble("receiveHeadersEnd", timing.calculateMillisecondDelta(
+ timing.receiveHeadersEnd()));
+ value->setDouble("pushStart", timing.pushStart());
+ value->setDouble("pushEnd", timing.pushEnd());
+}
+} // namespace
+
std::unique_ptr<TracedValue> InspectorReceiveResponseEvent::data(
unsigned long identifier,
LocalFrame* frame,
@@ -521,6 +553,11 @@ std::unique_ptr<TracedValue> InspectorReceiveResponseEvent::data(
value->setString("frame", toHexString(frame));
value->setInteger("statusCode", response.httpStatusCode());
value->setString("mimeType", response.mimeType().getString().isolatedCopy());
+ if (response.resourceLoadTiming()) {
+ value->beginDictionary("timing");
+ recordTiming(*response.resourceLoadTiming(), value.get());
+ value->endDictionary();
+ }
return value;
}
@@ -547,7 +584,7 @@ std::unique_ptr<TracedValue> InspectorResourceFinishEvent::data(
value->setString("requestId", requestId);
value->setBoolean("didFail", didFail);
if (finishTime)
- value->setDouble("networkTime", finishTime);
+ value->setDouble("finishTime", finishTime);
return value;
}

Powered by Google App Engine
This is Rietveld 408576698