OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project 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 V8_INSPECTOR_V8PROFILERAGENTIMPL_H_ | 5 #ifndef V8_INSPECTOR_V8PROFILERAGENTIMPL_H_ |
6 #define V8_INSPECTOR_V8PROFILERAGENTIMPL_H_ | 6 #define V8_INSPECTOR_V8PROFILERAGENTIMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "src/base/macros.h" | 10 #include "src/base/macros.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 bool enabled() const { return m_enabled; } | 31 bool enabled() const { return m_enabled; } |
32 void restore(); | 32 void restore(); |
33 | 33 |
34 Response enable() override; | 34 Response enable() override; |
35 Response disable() override; | 35 Response disable() override; |
36 Response setSamplingInterval(int) override; | 36 Response setSamplingInterval(int) override; |
37 Response start() override; | 37 Response start() override; |
38 Response stop(std::unique_ptr<protocol::Profiler::Profile>*) override; | 38 Response stop(std::unique_ptr<protocol::Profiler::Profile>*) override; |
39 | 39 |
| 40 Response startPreciseCoverage() override; |
| 41 Response stopPreciseCoverage() override; |
| 42 Response takePreciseCoverage( |
| 43 std::unique_ptr<protocol::Array<protocol::Profiler::ScriptCoverage>>* |
| 44 out_result) override; |
| 45 Response getBestEffortCoverage( |
| 46 std::unique_ptr<protocol::Array<protocol::Profiler::ScriptCoverage>>* |
| 47 out_result) override; |
| 48 |
40 void consoleProfile(const String16& title); | 49 void consoleProfile(const String16& title); |
41 void consoleProfileEnd(const String16& title); | 50 void consoleProfileEnd(const String16& title); |
42 | 51 |
43 bool idleStarted(); | 52 bool idleStarted(); |
44 bool idleFinished(); | 53 bool idleFinished(); |
45 | 54 |
46 private: | 55 private: |
47 String16 nextProfileId(); | 56 String16 nextProfileId(); |
48 | 57 |
49 void startProfiling(const String16& title); | 58 void startProfiling(const String16& title); |
50 std::unique_ptr<protocol::Profiler::Profile> stopProfiling( | 59 std::unique_ptr<protocol::Profiler::Profile> stopProfiling( |
51 const String16& title, bool serialize); | 60 const String16& title, bool serialize); |
52 | 61 |
53 bool isRecording() const; | |
54 | |
55 V8InspectorSessionImpl* m_session; | 62 V8InspectorSessionImpl* m_session; |
56 v8::Isolate* m_isolate; | 63 v8::Isolate* m_isolate; |
57 v8::CpuProfiler* m_profiler; | 64 v8::CpuProfiler* m_profiler = nullptr; |
58 protocol::DictionaryValue* m_state; | 65 protocol::DictionaryValue* m_state; |
59 protocol::Profiler::Frontend m_frontend; | 66 protocol::Profiler::Frontend m_frontend; |
60 bool m_enabled; | 67 bool m_enabled = false; |
61 bool m_recordingCPUProfile; | 68 bool m_recordingCPUProfile = false; |
62 class ProfileDescriptor; | 69 class ProfileDescriptor; |
63 std::vector<ProfileDescriptor> m_startedProfiles; | 70 std::vector<ProfileDescriptor> m_startedProfiles; |
64 String16 m_frontendInitiatedProfileId; | 71 String16 m_frontendInitiatedProfileId; |
| 72 bool m_idle = false; |
| 73 int m_startedProfilesCount = 0; |
65 | 74 |
66 DISALLOW_COPY_AND_ASSIGN(V8ProfilerAgentImpl); | 75 DISALLOW_COPY_AND_ASSIGN(V8ProfilerAgentImpl); |
67 }; | 76 }; |
68 | 77 |
69 } // namespace v8_inspector | 78 } // namespace v8_inspector |
70 | 79 |
71 #endif // V8_INSPECTOR_V8PROFILERAGENTIMPL_H_ | 80 #endif // V8_INSPECTOR_V8PROFILERAGENTIMPL_H_ |
OLD | NEW |