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