| 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 #ifndef V8HeapProfilerAgentImpl_h | 5 #ifndef V8HeapProfilerAgentImpl_h |
| 6 #define V8HeapProfilerAgentImpl_h | 6 #define V8HeapProfilerAgentImpl_h |
| 7 | 7 |
| 8 #include "platform/inspector_protocol/Allocator.h" | 8 #include "platform/inspector_protocol/Allocator.h" |
| 9 #include "platform/inspector_protocol/Backend.h" | 9 #include "platform/inspector_protocol/Backend.h" |
| 10 #include "platform/inspector_protocol/Frontend.h" | 10 #include "platform/inspector_protocol/Frontend.h" |
| 11 #include "platform/inspector_protocol/String16.h" | 11 #include "platform/inspector_protocol/String16.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class V8InspectorSessionImpl; | 15 class V8InspectorSessionImpl; |
| 16 | 16 |
| 17 using protocol::Maybe; | 17 using protocol::Maybe; |
| 18 | 18 |
| 19 class V8HeapProfilerAgentImpl : public protocol::Backend::HeapProfiler { | 19 class V8HeapProfilerAgentImpl : public protocol::HeapProfiler::Backend { |
| 20 PROTOCOL_DISALLOW_COPY(V8HeapProfilerAgentImpl); | 20 PROTOCOL_DISALLOW_COPY(V8HeapProfilerAgentImpl); |
| 21 public: | 21 public: |
| 22 V8HeapProfilerAgentImpl(V8InspectorSessionImpl*, protocol::Frontend::HeapPro
filer*, protocol::DictionaryValue* state); | 22 V8HeapProfilerAgentImpl(V8InspectorSessionImpl*, protocol::HeapProfiler::Fro
ntend*, protocol::DictionaryValue* state); |
| 23 ~V8HeapProfilerAgentImpl() override; | 23 ~V8HeapProfilerAgentImpl() override; |
| 24 void restore(); | 24 void restore(); |
| 25 | 25 |
| 26 void collectGarbage(ErrorString*) override; | 26 void collectGarbage(ErrorString*) override; |
| 27 | 27 |
| 28 void enable(ErrorString*) override; | 28 void enable(ErrorString*) override; |
| 29 void startTrackingHeapObjects(ErrorString*, const Maybe<bool>& trackAllocati
ons) override; | 29 void startTrackingHeapObjects(ErrorString*, const Maybe<bool>& trackAllocati
ons) override; |
| 30 void stopTrackingHeapObjects(ErrorString*, const Maybe<bool>& reportProgress
) override; | 30 void stopTrackingHeapObjects(ErrorString*, const Maybe<bool>& reportProgress
) override; |
| 31 | 31 |
| 32 void disable(ErrorString*) override; | 32 void disable(ErrorString*) override; |
| 33 | 33 |
| 34 void takeHeapSnapshot(ErrorString*, const Maybe<bool>& reportProgress) overr
ide; | 34 void takeHeapSnapshot(ErrorString*, const Maybe<bool>& reportProgress) overr
ide; |
| 35 | 35 |
| 36 void getObjectByHeapObjectId(ErrorString*, const String16& heapSnapshotObjec
tId, const Maybe<String16>& objectGroup, std::unique_ptr<protocol::Runtime::Remo
teObject>* result) override; | 36 void getObjectByHeapObjectId(ErrorString*, const String16& heapSnapshotObjec
tId, const Maybe<String16>& objectGroup, std::unique_ptr<protocol::Runtime::Remo
teObject>* result) override; |
| 37 void addInspectedHeapObject(ErrorString*, const String16& inspectedHeapObjec
tId) override; | 37 void addInspectedHeapObject(ErrorString*, const String16& inspectedHeapObjec
tId) override; |
| 38 void getHeapObjectId(ErrorString*, const String16& objectId, String16* heapS
napshotObjectId) override; | 38 void getHeapObjectId(ErrorString*, const String16& objectId, String16* heapS
napshotObjectId) override; |
| 39 | 39 |
| 40 void startSampling(ErrorString*, const Maybe<double>& samplingInterval) over
ride; | 40 void startSampling(ErrorString*, const Maybe<double>& samplingInterval) over
ride; |
| 41 void stopSampling(ErrorString*, std::unique_ptr<protocol::HeapProfiler::Samp
lingHeapProfile>*) override; | 41 void stopSampling(ErrorString*, std::unique_ptr<protocol::HeapProfiler::Samp
lingHeapProfile>*) override; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 void startTrackingHeapObjectsInternal(bool trackAllocations); | 44 void startTrackingHeapObjectsInternal(bool trackAllocations); |
| 45 void stopTrackingHeapObjectsInternal(); | 45 void stopTrackingHeapObjectsInternal(); |
| 46 void requestHeapStatsUpdate(); | 46 void requestHeapStatsUpdate(); |
| 47 static void onTimer(void*); | 47 static void onTimer(void*); |
| 48 | 48 |
| 49 V8InspectorSessionImpl* m_session; | 49 V8InspectorSessionImpl* m_session; |
| 50 v8::Isolate* m_isolate; | 50 v8::Isolate* m_isolate; |
| 51 protocol::Frontend::HeapProfiler* m_frontend; | 51 protocol::HeapProfiler::Frontend* m_frontend; |
| 52 protocol::DictionaryValue* m_state; | 52 protocol::DictionaryValue* m_state; |
| 53 bool m_hasTimer; | 53 bool m_hasTimer; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // namespace blink | 56 } // namespace blink |
| 57 | 57 |
| 58 #endif // !defined(V8HeapProfilerAgentImpl_h) | 58 #endif // !defined(V8HeapProfilerAgentImpl_h) |
| OLD | NEW |