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

Unified Diff: third_party/WebKit/Source/platform/tracing/NetworkInstrumentation.cpp

Issue 2444783002: Add trace event for complete network request (Closed)
Patch Set: Created 4 years, 2 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/platform/tracing/NetworkInstrumentation.cpp
diff --git a/third_party/WebKit/Source/platform/tracing/NetworkInstrumentation.cpp b/third_party/WebKit/Source/platform/tracing/NetworkInstrumentation.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c34423b804da6da4ce1aefbba0ab2397478aa5ef
--- /dev/null
+++ b/third_party/WebKit/Source/platform/tracing/NetworkInstrumentation.cpp
@@ -0,0 +1,24 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "platform/tracing/NetworkInstrumentation.h"
+
+#include "base/trace_event/trace_event.h"
+
+namespace network_instrumentation {
+
+const char kResourceLoadTitle[] = "ResourceLoad";
+using network_instrumentation::kNetInstrumentationCategory;
+
+void beginResourceLoad(unsigned long resourceID, const char* url) {
+ TRACE_EVENT_ASYNC_BEGIN1(kNetInstrumentationCategory, kResourceLoadTitle,
chiniforooshan 2016/10/24 19:25:37 I think it is recommended that new codes use nesta
caseq 2016/10/24 22:47:46 +1
dproy 2016/11/03 15:13:37 Done.
+ resourceID, "url", TRACE_STR_COPY(url));
chiniforooshan 2016/10/24 19:25:37 TRACE_ID_WITH_SCOPE(kBlinkResourceID, TRACE_ID_LOC
dproy 2016/11/03 15:13:37 Done.
+}
+
+void endResourceLoad(unsigned long resourceID) {
+ TRACE_EVENT_ASYNC_END0(kNetInstrumentationCategory, kResourceLoadTitle,
+ resourceID);
+}
+
+} // namespace network_instrumentation

Powered by Google App Engine
This is Rietveld 408576698