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

Unified Diff: test/inspector-protocol/inspector-extension.h

Issue 2358943002: [inspector] added inspector protocol test runner (Closed)
Patch Set: a Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: test/inspector-protocol/inspector-extension.h
diff --git a/test/inspector-protocol/inspector-extension.h b/test/inspector-protocol/inspector-extension.h
new file mode 100644
index 0000000000000000000000000000000000000000..150054bc5bcb1c4679e882e8d01df2ae72e4d829
--- /dev/null
+++ b/test/inspector-protocol/inspector-extension.h
@@ -0,0 +1,54 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_TEST_INSPECTOR_PROTOCOL_INSPECTOR_EXTENSION_H_
+#define V8_TEST_INSPECTOR_PROTOCOL_INSPECTOR_EXTENSION_H_
+
+#include "include/v8.h"
+
+namespace v8_inspector {
+
+class TaskQueue;
+
+class BackendExtension : public v8::Extension {
+ public:
+ BackendExtension()
+ : v8::Extension("v8_inspector/backend",
+ "native function evaluateInFrontend();") {}
+ virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
+ v8::Isolate* isolate, v8::Local<v8::String> name);
+
+ static void set_frontend_task_queue(TaskQueue* queue) {
+ frontend_queue_ = queue;
+ }
+
+ private:
+ static void EvaluateInFrontend(
+ const v8::FunctionCallbackInfo<v8::Value>& args);
+
+ static TaskQueue* frontend_queue_;
+};
+
+class FrontendExtension : public v8::Extension {
+ public:
+ FrontendExtension()
+ : v8::Extension("v8_inspector/frontend",
+ "native function sendMessageToBackend();") {}
+ virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
+ v8::Isolate* isolate, v8::Local<v8::String> name);
+
+ static void set_backend_task_queue(TaskQueue* queue) {
+ backend_queue_ = queue;
+ }
+
+ private:
+ static void SendMessageToBackend(
+ const v8::FunctionCallbackInfo<v8::Value>& args);
+
+ static TaskQueue* backend_queue_;
+};
+
+} // namespace v8_inspector
+
+#endif // V8_TEST_INSPECTOR_PROTOCOL_INSPECTOR_EXTENSION_H_

Powered by Google App Engine
This is Rietveld 408576698