| 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" |
| 11 #include "src/inspector/protocol/Forward.h" | 11 #include "src/inspector/protocol/Forward.h" |
| 12 #include "src/inspector/protocol/Profiler.h" | 12 #include "src/inspector/protocol/Profiler.h" |
| 13 | 13 |
| 14 namespace v8 { | 14 namespace v8 { |
| 15 class CpuProfiler; | 15 class CpuProfiler; |
| 16 class Isolate; | 16 class Isolate; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace v8_inspector { | 19 namespace v8_inspector { |
| 20 | 20 |
| 21 class V8InspectorSessionImpl; | 21 class V8InspectorSessionImpl; |
| 22 | 22 |
| 23 using protocol::Maybe; |
| 23 using protocol::Response; | 24 using protocol::Response; |
| 24 | 25 |
| 25 class V8ProfilerAgentImpl : public protocol::Profiler::Backend { | 26 class V8ProfilerAgentImpl : public protocol::Profiler::Backend { |
| 26 public: | 27 public: |
| 27 V8ProfilerAgentImpl(V8InspectorSessionImpl*, protocol::FrontendChannel*, | 28 V8ProfilerAgentImpl(V8InspectorSessionImpl*, protocol::FrontendChannel*, |
| 28 protocol::DictionaryValue* state); | 29 protocol::DictionaryValue* state); |
| 29 ~V8ProfilerAgentImpl() override; | 30 ~V8ProfilerAgentImpl() override; |
| 30 | 31 |
| 31 bool enabled() const { return m_enabled; } | 32 bool enabled() const { return m_enabled; } |
| 32 void restore(); | 33 void restore(); |
| 33 | 34 |
| 34 Response enable() override; | 35 Response enable() override; |
| 35 Response disable() override; | 36 Response disable() override; |
| 36 Response setSamplingInterval(int) override; | 37 Response setSamplingInterval(int) override; |
| 37 Response start() override; | 38 Response start() override; |
| 38 Response stop(std::unique_ptr<protocol::Profiler::Profile>*) override; | 39 Response stop(std::unique_ptr<protocol::Profiler::Profile>*) override; |
| 39 | 40 |
| 40 Response startPreciseCoverage() override; | 41 Response startPreciseCoverage(Maybe<bool> binary) override; |
| 41 Response stopPreciseCoverage() override; | 42 Response stopPreciseCoverage() override; |
| 42 Response takePreciseCoverage( | 43 Response takePreciseCoverage( |
| 43 std::unique_ptr<protocol::Array<protocol::Profiler::ScriptCoverage>>* | 44 std::unique_ptr<protocol::Array<protocol::Profiler::ScriptCoverage>>* |
| 44 out_result) override; | 45 out_result) override; |
| 45 Response getBestEffortCoverage( | 46 Response getBestEffortCoverage( |
| 46 std::unique_ptr<protocol::Array<protocol::Profiler::ScriptCoverage>>* | 47 std::unique_ptr<protocol::Array<protocol::Profiler::ScriptCoverage>>* |
| 47 out_result) override; | 48 out_result) override; |
| 48 | 49 |
| 49 void consoleProfile(const String16& title); | 50 void consoleProfile(const String16& title); |
| 50 void consoleProfileEnd(const String16& title); | 51 void consoleProfileEnd(const String16& title); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 71 String16 m_frontendInitiatedProfileId; | 72 String16 m_frontendInitiatedProfileId; |
| 72 bool m_idle = false; | 73 bool m_idle = false; |
| 73 int m_startedProfilesCount = 0; | 74 int m_startedProfilesCount = 0; |
| 74 | 75 |
| 75 DISALLOW_COPY_AND_ASSIGN(V8ProfilerAgentImpl); | 76 DISALLOW_COPY_AND_ASSIGN(V8ProfilerAgentImpl); |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 } // namespace v8_inspector | 79 } // namespace v8_inspector |
| 79 | 80 |
| 80 #endif // V8_INSPECTOR_V8PROFILERAGENTIMPL_H_ | 81 #endif // V8_INSPECTOR_V8PROFILERAGENTIMPL_H_ |
| OLD | NEW |