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

Unified Diff: third_party/WebKit/Source/core/inspector/PageDebuggerAgent.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/PageDebuggerAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/PageDebuggerAgent.cpp b/third_party/WebKit/Source/core/inspector/PageDebuggerAgent.cpp
index 5e041269259ba58b8ad0e82c0bf63dab2d739b64..d2b52e96635cf67795d7543dbfcfc9784c96bbf6 100644
--- a/third_party/WebKit/Source/core/inspector/PageDebuggerAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/PageDebuggerAgent.cpp
@@ -137,7 +137,13 @@ void PageDebuggerAgent::compileScript(ErrorString* errorString, const String& ex
*errorString = "Inspected frame has gone";
return;
}
- ExecutionContext* executionContext = injectedScript->scriptState()->executionContext();
+ v8::HandleScope handles(injectedScript->isolate());
+ ExecutionContext* executionContext = toExecutionContext(injectedScript->context());
+ if (!executionContext) {
+ *errorString = "Inspected frame has gone";
+ return;
+ }
+
RefPtrWillBeRawPtr<LocalFrame> protect(toDocument(executionContext)->frame());
InspectorDebuggerAgent::compileScript(errorString, expression, sourceURL, persistScript, executionContextId, scriptId, exceptionDetails);
if (!scriptId->isAssigned())
@@ -155,7 +161,12 @@ void PageDebuggerAgent::runScript(ErrorString* errorString, const ScriptId& scri
*errorString = "Inspected frame has gone";
return;
}
- ExecutionContext* executionContext = injectedScript->scriptState()->executionContext();
+ v8::HandleScope handles(injectedScript->isolate());
+ ExecutionContext* executionContext = toExecutionContext(injectedScript->context());
+ if (!executionContext) {
+ *errorString = "Inspected frame has gone";
+ return;
+ }
String sourceURL = m_compiledScriptURLs.take(scriptId);
LocalFrame* frame = toDocument(executionContext)->frame();

Powered by Google App Engine
This is Rietveld 408576698