Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: test/inspector/inspector-impl.h

Issue 2368393003: [inspector] added inspector test runner [part 2] (Closed)
Patch Set: fixed linter errors Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/inspector/inspector.gyp ('k') | test/inspector/inspector-impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef V8_TEST_INSPECTOR_PROTOCOL_INSPECTOR_IMPL_H_
6 #define V8_TEST_INSPECTOR_PROTOCOL_INSPECTOR_IMPL_H_
7
8 #include "include/v8-inspector.h"
9 #include "include/v8.h"
10 #include "src/base/macros.h"
11 #include "src/base/platform/platform.h"
12 #include "test/inspector/task-runner.h"
13
14 class InspectorClientImpl : public v8_inspector::V8InspectorClient {
15 public:
16 class FrontendChannel {
17 public:
18 virtual ~FrontendChannel() {}
alph 2016/09/29 20:05:52 = default;
kozy 2016/09/29 20:59:50 Done.
19 virtual void SendMessageToFrontend(
20 const v8_inspector::StringView& message) = 0;
21 };
22
23 InspectorClientImpl(TaskRunner* task_runner,
24 FrontendChannel* frontend_channel,
25 v8::base::Semaphore* ready_semaphore);
26 virtual ~InspectorClientImpl();
27
28 private:
29 // V8InspectorClient implementation.
30 v8::Local<v8::Context> ensureDefaultContextInGroup(int) override;
alph 2016/09/29 20:05:52 arg name
kozy 2016/09/29 20:59:50 Done.
31 double currentTimeMS() override;
32 void runMessageLoopOnPause(int) override;
alph 2016/09/29 20:05:52 ditto
kozy 2016/09/29 20:59:50 Done.
33 void quitMessageLoopOnPause() override;
34
35 static v8_inspector::V8InspectorSession* SessionFromContext(
36 v8::Local<v8::Context> context);
37
38 friend class SendMessageToBackendTask;
39
40 friend class ConnectTask;
41 void connect(v8::Local<v8::Context> context);
42
43 std::unique_ptr<v8_inspector::V8Inspector> inspector_;
44 std::unique_ptr<v8_inspector::V8InspectorSession> session_;
45 std::unique_ptr<v8_inspector::V8Inspector::Channel> channel_;
46
47 v8::Isolate* isolate_;
48 v8::Global<v8::Context> context_;
49
50 TaskRunner* task_runner_;
51 FrontendChannel* frontend_channel_;
52
53 DISALLOW_COPY_AND_ASSIGN(InspectorClientImpl);
54 };
55
56 class SendMessageToBackendExtension : public v8::Extension {
57 public:
58 SendMessageToBackendExtension()
59 : v8::Extension("v8_inspector/frontend",
60 "native function sendMessageToBackend();") {}
61 virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
62 v8::Isolate* isolate, v8::Local<v8::String> name);
63
64 static void set_backend_task_runner(TaskRunner* task_runner) {
65 backend_task_runner_ = task_runner;
66 }
67
68 private:
69 static void SendMessageToBackend(
70 const v8::FunctionCallbackInfo<v8::Value>& args);
71
72 static TaskRunner* backend_task_runner_;
73 };
74
75 #endif // V8_TEST_INSPECTOR_PROTOCOL_INSPECTOR_IMPL_H_
OLDNEW
« no previous file with comments | « test/inspector/inspector.gyp ('k') | test/inspector/inspector-impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698