Chromium Code Reviews| 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 |