OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "core/inspector/InspectorTraceEvents.h" | 5 #include "core/inspector/InspectorTraceEvents.h" |
6 | 6 |
7 #include <inttypes.h> | 7 #include <inttypes.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack")); | 82 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack")); |
83 if (!*traceCategoryEnabled) | 83 if (!*traceCategoryEnabled) |
84 return; | 84 return; |
85 // The CPU profiler stack trace does not include call site line numbers. | 85 // The CPU profiler stack trace does not include call site line numbers. |
86 // So we collect the top frame with SourceLocation::capture() to get the | 86 // So we collect the top frame with SourceLocation::capture() to get the |
87 // binding call site info. | 87 // binding call site info. |
88 SourceLocation::capture()->toTracedValue(value, "stackTrace"); | 88 SourceLocation::capture()->toTracedValue(value, "stackTrace"); |
89 v8::Isolate::GetCurrent()->GetCpuProfiler()->CollectSample(); | 89 v8::Isolate::GetCurrent()->GetCpuProfiler()->CollectSample(); |
90 } | 90 } |
91 | 91 |
92 void InspectorTraceEvents::init(InstrumentingAgents* instrumentingAgents, | 92 void InspectorTraceEvents::init( |
93 protocol::UberDispatcher*, | 93 InspectorInstrumentationAgents* instrumentingAgents, |
94 protocol::DictionaryValue*) { | 94 protocol::UberDispatcher*, |
| 95 protocol::DictionaryValue*) { |
95 m_instrumentingAgents = instrumentingAgents; | 96 m_instrumentingAgents = instrumentingAgents; |
96 m_instrumentingAgents->addInspectorTraceEvents(this); | 97 m_instrumentingAgents->addInspectorTraceEvents(this); |
97 } | 98 } |
98 | 99 |
99 void InspectorTraceEvents::dispose() { | 100 void InspectorTraceEvents::dispose() { |
100 m_instrumentingAgents->removeInspectorTraceEvents(this); | 101 m_instrumentingAgents->removeInspectorTraceEvents(this); |
101 m_instrumentingAgents = nullptr; | 102 m_instrumentingAgents = nullptr; |
102 } | 103 } |
103 | 104 |
104 DEFINE_TRACE(InspectorTraceEvents) { | 105 DEFINE_TRACE(InspectorTraceEvents) { |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 return value; | 1206 return value; |
1206 } | 1207 } |
1207 | 1208 |
1208 std::unique_ptr<TracedValue> InspectorAsyncTask::data(const String& name) { | 1209 std::unique_ptr<TracedValue> InspectorAsyncTask::data(const String& name) { |
1209 std::unique_ptr<TracedValue> value = TracedValue::create(); | 1210 std::unique_ptr<TracedValue> value = TracedValue::create(); |
1210 value->setString("name", name); | 1211 value->setString("name", name); |
1211 return value; | 1212 return value; |
1212 } | 1213 } |
1213 | 1214 |
1214 } // namespace blink | 1215 } // namespace blink |
OLD | NEW |