| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/instrumentation/PlatformTraceEventsAgent.h" | 5 #include "platform/probe/PlatformTraceEventsAgent.h" |
| 6 | 6 |
| 7 #include "platform/instrumentation/PlatformInstrumentation.h" | |
| 8 #include "platform/instrumentation/tracing/TraceEvent.h" | 7 #include "platform/instrumentation/tracing/TraceEvent.h" |
| 9 #include "platform/instrumentation/tracing/TracedValue.h" | 8 #include "platform/instrumentation/tracing/TracedValue.h" |
| 9 #include "platform/probe/PlatformProbes.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 std::unique_ptr<TracedValue> buildData( | 15 std::unique_ptr<TracedValue> buildData( |
| 16 const probe::PlatformSendRequest& probe) { | 16 const probe::PlatformSendRequest& probe) { |
| 17 std::unique_ptr<TracedValue> value = TracedValue::create(); | 17 std::unique_ptr<TracedValue> value = TracedValue::create(); |
| 18 value->setString("id", String::number(probe.identifier)); | 18 value->setString("id", String::number(probe.identifier)); |
| 19 return value; | 19 return value; |
| 20 } | 20 } |
| 21 | 21 |
| 22 } // namespace | 22 } // namespace |
| 23 | 23 |
| 24 void PlatformTraceEventsAgent::will(const probe::PlatformSendRequest& probe) { | 24 void PlatformTraceEventsAgent::will(const probe::PlatformSendRequest& probe) { |
| 25 TRACE_EVENT_BEGIN1("devtools.timeline", "PlatformResourceSendRequest", "data", | 25 TRACE_EVENT_BEGIN1("devtools.timeline", "PlatformResourceSendRequest", "data", |
| 26 buildData(probe)); | 26 buildData(probe)); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void PlatformTraceEventsAgent::did(const probe::PlatformSendRequest& probe) { | 29 void PlatformTraceEventsAgent::did(const probe::PlatformSendRequest& probe) { |
| 30 TRACE_EVENT_END0("devtools.timeline", "PlatformResourceSendRequest"); | 30 TRACE_EVENT_END0("devtools.timeline", "PlatformResourceSendRequest"); |
| 31 } | 31 } |
| 32 | 32 |
| 33 } // namespace blink | 33 } // namespace blink |
| OLD | NEW |