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

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

Issue 2706643002: DevTools: Move network request instrumentation points for timeline down the stack. (Closed)
Patch Set: addressing comment Created 3 years, 10 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
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 b2db6fe39c8431571c9c5412f21d3494fe957d10..d06fd893ac1e4f4c6d996773437edfa463d3997d 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
@@ -523,91 +523,6 @@ 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,
- const ResourceResponse& response) {
- String requestId = IdentifiersFactory::requestId(identifier);
-
- std::unique_ptr<TracedValue> value = TracedValue::create();
- value->setString("requestId", requestId);
- value->setString("frame", toHexString(frame));
- value->setInteger("statusCode", response.httpStatusCode());
- value->setString("mimeType", response.mimeType().getString().isolatedCopy());
- value->setDouble("encodedDataLength", response.encodedDataLength());
- value->setBoolean("fromCache", response.wasCached());
- value->setBoolean("fromServiceWorker", response.wasFetchedViaServiceWorker());
- if (response.resourceLoadTiming()) {
- value->beginDictionary("timing");
- recordTiming(*response.resourceLoadTiming(), value.get());
- value->endDictionary();
- }
- if (response.wasFetchedViaServiceWorker())
- value->setBoolean("fromServiceWorker", true);
- return value;
-}
-
-std::unique_ptr<TracedValue> InspectorReceiveDataEvent::data(
- unsigned long identifier,
- LocalFrame* frame,
- int encodedDataLength) {
- String requestId = IdentifiersFactory::requestId(identifier);
-
- std::unique_ptr<TracedValue> value = TracedValue::create();
- value->setString("requestId", requestId);
- value->setString("frame", toHexString(frame));
- value->setInteger("encodedDataLength", encodedDataLength);
- return value;
-}
-
-std::unique_ptr<TracedValue> InspectorResourceFinishEvent::data(
- unsigned long identifier,
- double finishTime,
- bool didFail,
- int64_t encodedDataLength) {
- String requestId = IdentifiersFactory::requestId(identifier);
-
- std::unique_ptr<TracedValue> value = TracedValue::create();
- value->setString("requestId", requestId);
- value->setBoolean("didFail", didFail);
- value->setDouble("encodedDataLength", encodedDataLength);
- if (finishTime)
- value->setDouble("finishTime", finishTime);
- return value;
-}
-
static LocalFrame* frameForExecutionContext(ExecutionContext* context) {
LocalFrame* frame = nullptr;
if (context->isDocument())

Powered by Google App Engine
This is Rietveld 408576698