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 #ifndef V8ProfilerAgentImpl_h | 5 #ifndef V8ProfilerAgentImpl_h |
6 #define V8ProfilerAgentImpl_h | 6 #define V8ProfilerAgentImpl_h |
7 | 7 |
8 #include "platform/inspector_protocol/InspectorProtocol.h" | 8 #include "platform/inspector_protocol/InspectorProtocol.h" |
9 #include "platform/v8_inspector/protocol/Profiler.h" | 9 #include "platform/v8_inspector/protocol/Profiler.h" |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 V8ProfilerAgentImpl(V8InspectorSessionImpl*, protocol::FrontendChannel*, pro
tocol::DictionaryValue* state); | 27 V8ProfilerAgentImpl(V8InspectorSessionImpl*, protocol::FrontendChannel*, pro
tocol::DictionaryValue* state); |
28 ~V8ProfilerAgentImpl() override; | 28 ~V8ProfilerAgentImpl() override; |
29 | 29 |
30 bool enabled() const { return m_enabled; } | 30 bool enabled() const { return m_enabled; } |
31 void restore(); | 31 void restore(); |
32 | 32 |
33 void enable(ErrorString*) override; | 33 void enable(ErrorString*) override; |
34 void disable(ErrorString*) override; | 34 void disable(ErrorString*) override; |
35 void setSamplingInterval(ErrorString*, int) override; | 35 void setSamplingInterval(ErrorString*, int) override; |
36 void start(ErrorString*) override; | 36 void start(ErrorString*) override; |
37 void stop(ErrorString*, std::unique_ptr<protocol::Profiler::CPUProfile>*) ov
erride; | 37 void stop(ErrorString*, std::unique_ptr<protocol::Profiler::Profile>*) overr
ide; |
38 | 38 |
39 void consoleProfile(const String16& title); | 39 void consoleProfile(const String16& title); |
40 void consoleProfileEnd(const String16& title); | 40 void consoleProfileEnd(const String16& title); |
41 | 41 |
42 private: | 42 private: |
43 String16 nextProfileId(); | 43 String16 nextProfileId(); |
44 v8::CpuProfiler* profiler(); | 44 v8::CpuProfiler* profiler(); |
45 | 45 |
46 void startProfiling(const String16& title); | 46 void startProfiling(const String16& title); |
47 std::unique_ptr<protocol::Profiler::CPUProfile> stopProfiling(const String16
& title, bool serialize); | 47 std::unique_ptr<protocol::Profiler::Profile> stopProfiling(const String16& t
itle, bool serialize); |
48 | 48 |
49 bool isRecording() const; | 49 bool isRecording() const; |
50 | 50 |
51 V8InspectorSessionImpl* m_session; | 51 V8InspectorSessionImpl* m_session; |
52 v8::Isolate* m_isolate; | 52 v8::Isolate* m_isolate; |
53 v8::CpuProfiler* m_profiler; | 53 v8::CpuProfiler* m_profiler; |
54 protocol::DictionaryValue* m_state; | 54 protocol::DictionaryValue* m_state; |
55 protocol::Profiler::Frontend m_frontend; | 55 protocol::Profiler::Frontend m_frontend; |
56 bool m_enabled; | 56 bool m_enabled; |
57 bool m_recordingCPUProfile; | 57 bool m_recordingCPUProfile; |
58 class ProfileDescriptor; | 58 class ProfileDescriptor; |
59 std::vector<ProfileDescriptor> m_startedProfiles; | 59 std::vector<ProfileDescriptor> m_startedProfiles; |
60 String16 m_frontendInitiatedProfileId; | 60 String16 m_frontendInitiatedProfileId; |
61 }; | 61 }; |
62 | 62 |
63 } // namespace v8_inspector | 63 } // namespace v8_inspector |
64 | 64 |
65 #endif // !defined(V8ProfilerAgentImpl_h) | 65 #endif // !defined(V8ProfilerAgentImpl_h) |
OLD | NEW |