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 "src/inspector/Allocator.h" | 8 #include "src/inspector/Allocator.h" |
9 #include "src/inspector/protocol/Forward.h" | 9 #include "src/inspector/protocol/Forward.h" |
10 #include "src/inspector/protocol/Profiler.h" | 10 #include "src/inspector/protocol/Profiler.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 void enable(ErrorString*) override; | 36 void enable(ErrorString*) override; |
37 void disable(ErrorString*) override; | 37 void disable(ErrorString*) override; |
38 void setSamplingInterval(ErrorString*, int) override; | 38 void setSamplingInterval(ErrorString*, int) override; |
39 void start(ErrorString*) override; | 39 void start(ErrorString*) override; |
40 void stop(ErrorString*, | 40 void stop(ErrorString*, |
41 std::unique_ptr<protocol::Profiler::Profile>*) override; | 41 std::unique_ptr<protocol::Profiler::Profile>*) override; |
42 | 42 |
43 void consoleProfile(const String16& title); | 43 void consoleProfile(const String16& title); |
44 void consoleProfileEnd(const String16& title); | 44 void consoleProfileEnd(const String16& title); |
45 | 45 |
| 46 bool idleStarted(); |
| 47 bool idleFinished(); |
| 48 |
| 49 void collectSample(); |
| 50 |
46 private: | 51 private: |
47 String16 nextProfileId(); | 52 String16 nextProfileId(); |
48 | 53 |
49 void startProfiling(const String16& title); | 54 void startProfiling(const String16& title); |
50 std::unique_ptr<protocol::Profiler::Profile> stopProfiling( | 55 std::unique_ptr<protocol::Profiler::Profile> stopProfiling( |
51 const String16& title, bool serialize); | 56 const String16& title, bool serialize); |
52 | 57 |
53 bool isRecording() const; | 58 bool isRecording() const; |
54 | 59 |
55 V8InspectorSessionImpl* m_session; | 60 V8InspectorSessionImpl* m_session; |
56 v8::Isolate* m_isolate; | 61 v8::Isolate* m_isolate; |
57 v8::CpuProfiler* m_profiler; | 62 v8::CpuProfiler* m_profiler; |
58 protocol::DictionaryValue* m_state; | 63 protocol::DictionaryValue* m_state; |
59 protocol::Profiler::Frontend m_frontend; | 64 protocol::Profiler::Frontend m_frontend; |
60 bool m_enabled; | 65 bool m_enabled; |
61 bool m_recordingCPUProfile; | 66 bool m_recordingCPUProfile; |
62 class ProfileDescriptor; | 67 class ProfileDescriptor; |
63 std::vector<ProfileDescriptor> m_startedProfiles; | 68 std::vector<ProfileDescriptor> m_startedProfiles; |
64 String16 m_frontendInitiatedProfileId; | 69 String16 m_frontendInitiatedProfileId; |
65 }; | 70 }; |
66 | 71 |
67 } // namespace v8_inspector | 72 } // namespace v8_inspector |
68 | 73 |
69 #endif // V8_INSPECTOR_V8PROFILERAGENTIMPL_H_ | 74 #endif // V8_INSPECTOR_V8PROFILERAGENTIMPL_H_ |
OLD | NEW |