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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8Console.h

Issue 2030453002: [DevTools] Support CommandLineAPI in workers and Node.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 6 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: third_party/WebKit/Source/platform/v8_inspector/V8Console.h
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8Console.h b/third_party/WebKit/Source/platform/v8_inspector/V8Console.h
index 1080baa60a7c31b206c1d627f8d6c22c9d9d78e5..b539f4c0ad03edd43ad55106e0d57666b4408b4c 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8Console.h
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8Console.h
@@ -5,6 +5,7 @@
#ifndef V8Console_h
#define V8Console_h
+#include "platform/inspector_protocol/Allocator.h"
#include <v8.h>
namespace blink {
@@ -16,8 +17,25 @@ class InspectedContext;
class V8Console {
public:
static v8::Local<v8::Object> createConsole(InspectedContext*, bool hasMemoryAttribute);
- static v8::Local<v8::Object> createCommandLineAPI(InspectedContext*);
static void clearInspectedContextIfNeeded(v8::Local<v8::Context>, v8::Local<v8::Object> console);
+ static v8::Local<v8::Object> createCommandLineAPI(InspectedContext*);
+
+ class CommandLineAPIScope {
+ PROTOCOL_DISALLOW_COPY(CommandLineAPIScope);
+ public:
+ CommandLineAPIScope(v8::Local<v8::Context>, v8::Local<v8::Object> commandLineAPI, v8::Local<v8::Object> global);
+ ~CommandLineAPIScope();
+
+ private:
+ static void accessorGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&);
+ static void accessorSetterCallback(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&);
+
+ v8::Local<v8::Context> m_context;
+ v8::Local<v8::Object> m_commandLineAPI;
+ v8::Local<v8::Object> m_global;
+ v8::Local<v8::Set> m_installedMethods;
+ bool m_cleanup;
+ };
private:
static void debugCallback(const v8::FunctionCallbackInfo<v8::Value>&);

Powered by Google App Engine
This is Rietveld 408576698