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

Unified Diff: third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp

Issue 1648463002: DevTools: migrate injectedscript from ScriptValue to v8::Global. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 years, 11 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/core/inspector/v8/V8DebuggerAgentImpl.cpp
diff --git a/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp b/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp
index cb9d29f0faa20a1c255bebefdf5ae84918255af4..1e550dc23216314f5c2287227bbe6ce524f23048 100644
--- a/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp
+++ b/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp
@@ -980,12 +980,13 @@ void V8DebuggerAgentImpl::compileScript(ErrorString* errorString, const String&
if (!checkEnabled(errorString))
return;
InjectedScript* injectedScript = m_injectedScriptManager->findInjectedScript(executionContextId);
- if (!injectedScript || !injectedScript->scriptState()->contextIsValid()) {
+ if (!injectedScript) {
*errorString = "Inspected frame has gone";
return;
}
- ScriptState::Scope scope(injectedScript->scriptState());
+ v8::HandleScope handles(injectedScript->isolate());
+ v8::Context::Scope scope(injectedScript->context());
v8::Local<v8::String> source = v8String(m_isolate, expression);
v8::TryCatch tryCatch(m_isolate);
v8::Local<v8::Script> script;
@@ -1025,11 +1026,12 @@ void V8DebuggerAgentImpl::runScript(ErrorString* errorString, const ScriptId& sc
return;
}
- ScriptState* scriptState = injectedScript->scriptState();
- ScriptState::Scope scope(scriptState);
+ v8::HandleScope handles(m_isolate);
+ v8::Context::Scope scope(injectedScript->context());
v8::Local<v8::Script> script = v8::Local<v8::Script>::New(m_isolate, m_compiledScripts.Remove(scriptId));
+ ScriptState* scriptState = ScriptState::from(injectedScript->context());
- if (script.IsEmpty() || !scriptState->contextIsValid()) {
+ if (script.IsEmpty() || !scriptState) {
*errorString = "Script execution failed";
return;
}

Powered by Google App Engine
This is Rietveld 408576698