OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_TEST_INSPECTOR_PROTOCOL_INSPECTOR_IMPL_H_ | 5 #ifndef V8_TEST_INSPECTOR_PROTOCOL_INSPECTOR_IMPL_H_ |
6 #define V8_TEST_INSPECTOR_PROTOCOL_INSPECTOR_IMPL_H_ | 6 #define V8_TEST_INSPECTOR_PROTOCOL_INSPECTOR_IMPL_H_ |
7 | 7 |
8 #include "include/v8-inspector.h" | 8 #include "include/v8-inspector.h" |
9 #include "include/v8.h" | 9 #include "include/v8.h" |
10 #include "src/base/macros.h" | 10 #include "src/base/macros.h" |
11 #include "src/base/platform/platform.h" | 11 #include "src/base/platform/platform.h" |
12 #include "test/inspector-protocol/task-runner.h" | 12 #include "test/inspector-protocol/task-runner.h" |
13 | 13 |
14 class InspectorClientImpl : public v8_inspector::V8InspectorClient { | 14 class InspectorClientImpl : public v8_inspector::V8InspectorClient { |
15 public: | 15 public: |
16 class FrontendChannel { | 16 class FrontendChannel { |
17 public: | 17 public: |
18 virtual ~FrontendChannel() {} | 18 virtual ~FrontendChannel() {} |
19 virtual void SendMessageToFrontend( | 19 virtual void SendMessageToFrontend( |
20 const v8_inspector::StringView& message) = 0; | 20 const v8_inspector::StringView& message) = 0; |
21 }; | 21 }; |
22 | 22 |
23 InspectorClientImpl(TaskRunner* task_runner, | 23 InspectorClientImpl(TaskRunner* task_runner, |
24 FrontendChannel* frontend_channel, | 24 FrontendChannel* frontend_channel, |
25 v8::base::Semaphore* ready_semaphore); | 25 v8::base::Semaphore* ready_semaphore); |
26 virtual ~InspectorClientImpl(); | 26 virtual ~InspectorClientImpl(); |
27 | 27 |
| 28 static v8_inspector::V8Inspector* InspectorFromContext( |
| 29 v8::Local<v8::Context> context); |
| 30 |
28 private: | 31 private: |
29 // V8InspectorClient implementation. | 32 // V8InspectorClient implementation. |
30 v8::Local<v8::Context> ensureDefaultContextInGroup(int) override; | 33 v8::Local<v8::Context> ensureDefaultContextInGroup(int) override; |
31 double currentTimeMS() override; | 34 double currentTimeMS() override; |
32 void runMessageLoopOnPause(int) override; | 35 void runMessageLoopOnPause(int) override; |
33 void quitMessageLoopOnPause() override; | 36 void quitMessageLoopOnPause() override; |
34 | 37 |
35 static v8_inspector::V8InspectorSession* SessionFromContext( | 38 static v8_inspector::V8InspectorSession* SessionFromContext( |
36 v8::Local<v8::Context> context); | 39 v8::Local<v8::Context> context); |
37 | 40 |
(...skipping 28 matching lines...) Expand all Loading... |
66 } | 69 } |
67 | 70 |
68 private: | 71 private: |
69 static void SendMessageToBackend( | 72 static void SendMessageToBackend( |
70 const v8::FunctionCallbackInfo<v8::Value>& args); | 73 const v8::FunctionCallbackInfo<v8::Value>& args); |
71 | 74 |
72 static TaskRunner* backend_task_runner_; | 75 static TaskRunner* backend_task_runner_; |
73 }; | 76 }; |
74 | 77 |
75 #endif // V8_TEST_INSPECTOR_PROTOCOL_INSPECTOR_IMPL_H_ | 78 #endif // V8_TEST_INSPECTOR_PROTOCOL_INSPECTOR_IMPL_H_ |
OLD | NEW |