| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/v8_inspector/V8ProfilerAgentImpl.h" | 5 #include "platform/v8_inspector/V8ProfilerAgentImpl.h" |
| 6 | 6 |
| 7 #include "platform/v8_inspector/Atomics.h" | 7 #include "platform/v8_inspector/Atomics.h" |
| 8 #include "platform/v8_inspector/V8InspectorImpl.h" | 8 #include "platform/v8_inspector/V8InspectorImpl.h" |
| 9 #include "platform/v8_inspector/V8InspectorSessionImpl.h" | 9 #include "platform/v8_inspector/V8InspectorSessionImpl.h" |
| 10 #include "platform/v8_inspector/V8StackTraceImpl.h" | 10 #include "platform/v8_inspector/V8StackTraceImpl.h" |
| 11 #include "platform/v8_inspector/V8StringUtil.h" | 11 #include "platform/v8_inspector/V8StringUtil.h" |
| 12 #include <v8-profiler.h> | 12 #include <v8-profiler.h> |
| 13 | 13 |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #define ENSURE_V8_VERSION(major, minor) \ | 16 #define ENSURE_V8_VERSION(major, minor) \ |
| 17 (V8_MAJOR_VERSION * 1000 + V8_MINOR_VERSION >= (major) * 1000 + (minor)) | 17 (V8_MAJOR_VERSION * 1000 + V8_MINOR_VERSION >= (major) * 1000 + (minor)) |
| 18 | 18 |
| 19 namespace blink { | 19 namespace v8_inspector { |
| 20 | 20 |
| 21 namespace ProfilerAgentState { | 21 namespace ProfilerAgentState { |
| 22 static const char samplingInterval[] = "samplingInterval"; | 22 static const char samplingInterval[] = "samplingInterval"; |
| 23 static const char userInitiatedProfiling[] = "userInitiatedProfiling"; | 23 static const char userInitiatedProfiling[] = "userInitiatedProfiling"; |
| 24 static const char profilerEnabled[] = "profilerEnabled"; | 24 static const char profilerEnabled[] = "profilerEnabled"; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 std::unique_ptr<protocol::Array<protocol::Profiler::PositionTickInfo>> buildInsp
ectorObjectForPositionTicks(const v8::CpuProfileNode* node) | 29 std::unique_ptr<protocol::Array<protocol::Profiler::PositionTickInfo>> buildInsp
ectorObjectForPositionTicks(const v8::CpuProfileNode* node) |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 310 |
| 311 v8::CpuProfiler* V8ProfilerAgentImpl::profiler() | 311 v8::CpuProfiler* V8ProfilerAgentImpl::profiler() |
| 312 { | 312 { |
| 313 #if ENSURE_V8_VERSION(5, 4) | 313 #if ENSURE_V8_VERSION(5, 4) |
| 314 return m_profiler; | 314 return m_profiler; |
| 315 #else | 315 #else |
| 316 return m_isolate->GetCpuProfiler(); | 316 return m_isolate->GetCpuProfiler(); |
| 317 #endif | 317 #endif |
| 318 } | 318 } |
| 319 | 319 |
| 320 } // namespace blink | 320 } // namespace v8_inspector |
| OLD | NEW |