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

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

Issue 2755483007: DevTools: wire network requests to async infrastructure to test coverage. (Closed)
Patch Set: win compile Created 3 years, 9 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 | « third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 01d14708cc4ceb6aa510b290ba5efd5a86785e05..978f3ba70da7ddc74c62000c5f3b9a65243d2af6 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
@@ -45,6 +45,14 @@
namespace blink {
+namespace {
+
+void* asyncId(unsigned long identifier) {
+ return reinterpret_cast<void*>((identifier << 1) | 1);
+}
+
+} // namespace
+
String toHexString(const void* p) {
return String::format("0x%" PRIx64,
static_cast<uint64_t>(reinterpret_cast<uintptr_t>(p)));
@@ -92,6 +100,8 @@ void InspectorTraceEvents::willSendRequest(
TRACE_EVENT_INSTANT1(
"devtools.timeline", "ResourceSendRequest", TRACE_EVENT_SCOPE_THREAD,
"data", InspectorSendRequestEvent::data(identifier, frame, request));
+ probe::asyncTaskScheduled(frame->document(), "SendRequest",
+ asyncId(identifier));
}
void InspectorTraceEvents::didReceiveResourceResponse(
@@ -103,6 +113,8 @@ void InspectorTraceEvents::didReceiveResourceResponse(
TRACE_EVENT_INSTANT1(
"devtools.timeline", "ResourceReceiveResponse", TRACE_EVENT_SCOPE_THREAD,
"data", InspectorReceiveResponseEvent::data(identifier, frame, response));
+ probe::AsyncTask asyncTask(frame->document(), asyncId(identifier),
+ "response");
}
void InspectorTraceEvents::didReceiveData(LocalFrame* frame,
@@ -113,6 +125,7 @@ void InspectorTraceEvents::didReceiveData(LocalFrame* frame,
"devtools.timeline", "ResourceReceivedData", TRACE_EVENT_SCOPE_THREAD,
"data",
InspectorReceiveDataEvent::data(identifier, frame, encodedDataLength));
+ probe::AsyncTask asyncTask(frame->document(), asyncId(identifier), "data");
}
void InspectorTraceEvents::didFinishLoading(LocalFrame* frame,
@@ -124,6 +137,7 @@ void InspectorTraceEvents::didFinishLoading(LocalFrame* frame,
"devtools.timeline", "ResourceFinish", TRACE_EVENT_SCOPE_THREAD, "data",
InspectorResourceFinishEvent::data(identifier, finishTime, false,
encodedDataLength, decodedBodyLength));
+ probe::AsyncTask asyncTask(frame->document(), asyncId(identifier));
}
void InspectorTraceEvents::didFailLoading(unsigned long identifier,
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698