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

Unified Diff: src/inspector/v8-injected-script-host.cc

Issue 2770823003: [inspector] Increased chances of successful InjectedScriptSource compilation (Closed)
Patch Set: fixed .isolate Created 3 years, 9 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
« no previous file with comments | « src/inspector/v8-injected-script-host.h ('k') | test/inspector/console/destroy-context-during-log.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-injected-script-host.cc
diff --git a/src/inspector/v8-injected-script-host.cc b/src/inspector/v8-injected-script-host.cc
index d3e89d9d7b8382523bbfca91ae101b663abf1a69..80c256fcb30d611f22ad7339693226d60a079420 100644
--- a/src/inspector/v8-injected-script-host.cc
+++ b/src/inspector/v8-injected-script-host.cc
@@ -55,6 +55,9 @@ v8::Local<v8::Object> V8InjectedScriptHost::create(
USE(success);
v8::Local<v8::External> debuggerExternal =
v8::External::New(isolate, inspector);
+ setFunctionProperty(context, injectedScriptHost, "nullifyPrototype",
+ V8InjectedScriptHost::nullifyPrototypeCallback,
+ debuggerExternal);
setFunctionProperty(context, injectedScriptHost, "internalConstructorName",
V8InjectedScriptHost::internalConstructorNameCallback,
debuggerExternal);
@@ -77,6 +80,16 @@ v8::Local<v8::Object> V8InjectedScriptHost::create(
return injectedScriptHost;
}
+void V8InjectedScriptHost::nullifyPrototypeCallback(
+ const v8::FunctionCallbackInfo<v8::Value>& info) {
+ CHECK(info.Length() == 1 && info[0]->IsObject());
+ v8::Isolate* isolate = info.GetIsolate();
+ info[0]
+ .As<v8::Object>()
+ ->SetPrototype(isolate->GetCurrentContext(), v8::Null(isolate))
+ .ToChecked();
+}
+
void V8InjectedScriptHost::internalConstructorNameCallback(
const v8::FunctionCallbackInfo<v8::Value>& info) {
if (info.Length() < 1 || !info[0]->IsObject()) return;
« no previous file with comments | « src/inspector/v8-injected-script-host.h ('k') | test/inspector/console/destroy-context-during-log.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698