| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/V8HeapProfilerAgentImpl.h" | 5 #include "platform/v8_inspector/V8HeapProfilerAgentImpl.h" |
| 6 | 6 |
| 7 #include "platform/v8_inspector/InjectedScript.h" | 7 #include "platform/v8_inspector/InjectedScript.h" |
| 8 #include "platform/v8_inspector/V8Debugger.h" | 8 #include "platform/v8_inspector/V8Debugger.h" |
| 9 #include "platform/v8_inspector/V8InspectorImpl.h" | 9 #include "platform/v8_inspector/V8InspectorImpl.h" |
| 10 #include "platform/v8_inspector/V8InspectorSessionImpl.h" | 10 #include "platform/v8_inspector/V8InspectorSessionImpl.h" |
| 11 #include "platform/v8_inspector/V8StringUtil.h" | 11 #include "platform/v8_inspector/V8StringUtil.h" |
| 12 #include "platform/v8_inspector/public/V8InspectorClient.h" | 12 #include "platform/v8_inspector/public/V8InspectorClient.h" |
| 13 #include <v8-profiler.h> | 13 #include <v8-profiler.h> |
| 14 #include <v8-version.h> | 14 #include <v8-version.h> |
| 15 | 15 |
| 16 namespace blink { | 16 namespace v8_inspector { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 namespace HeapProfilerAgentState { | 20 namespace HeapProfilerAgentState { |
| 21 static const char heapProfilerEnabled[] = "heapProfilerEnabled"; | 21 static const char heapProfilerEnabled[] = "heapProfilerEnabled"; |
| 22 static const char heapObjectsTrackingEnabled[] = "heapObjectsTrackingEnabled"; | 22 static const char heapObjectsTrackingEnabled[] = "heapObjectsTrackingEnabled"; |
| 23 static const char allocationTrackingEnabled[] = "allocationTrackingEnabled"; | 23 static const char allocationTrackingEnabled[] = "allocationTrackingEnabled"; |
| 24 #if V8_MAJOR_VERSION >= 5 | 24 #if V8_MAJOR_VERSION >= 5 |
| 25 static const char samplingHeapProfilerEnabled[] = "samplingHeapProfilerEnabled"; | 25 static const char samplingHeapProfilerEnabled[] = "samplingHeapProfilerEnabled"; |
| 26 static const char samplingHeapProfilerInterval[] = "samplingHeapProfilerInterval
"; | 26 static const char samplingHeapProfilerInterval[] = "samplingHeapProfilerInterval
"; |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 if (!v8Profile) { | 391 if (!v8Profile) { |
| 392 *errorString = "Cannot access v8 sampled heap profile."; | 392 *errorString = "Cannot access v8 sampled heap profile."; |
| 393 return; | 393 return; |
| 394 } | 394 } |
| 395 v8::AllocationProfile::Node* root = v8Profile->GetRootNode(); | 395 v8::AllocationProfile::Node* root = v8Profile->GetRootNode(); |
| 396 *profile = protocol::HeapProfiler::SamplingHeapProfile::create() | 396 *profile = protocol::HeapProfiler::SamplingHeapProfile::create() |
| 397 .setHead(buildSampingHeapProfileNode(root)).build(); | 397 .setHead(buildSampingHeapProfileNode(root)).build(); |
| 398 #endif | 398 #endif |
| 399 } | 399 } |
| 400 | 400 |
| 401 } // namespace blink | 401 } // namespace v8_inspector |
| OLD | NEW |