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

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: 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..91c3becd3d37d2ea1ed4a9290840c8fbb7214bf3 100644
--- a/third_party/WebKit/Source/core/inspector/PageDebuggerAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/PageDebuggerAgent.cpp
@@ -137,7 +137,14 @@ void PageDebuggerAgent::compileScript(ErrorString* errorString, const String& ex
*errorString = "Inspected frame has gone";
return;
}
- ExecutionContext* executionContext = injectedScript->scriptState()->executionContext();
+ v8::HandleScope handles(injectedScript->isolate());
+ ScriptState* scriptState = ScriptState::from(injectedScript->context());
+ if (!scriptState) {
+ *errorString = "Inspected frame has gone";
+ return;
+ }
+
+ ExecutionContext* executionContext = scriptState->executionContext();
dgozman 2016/01/27 22:05:47 toExecutionContext(injectedScript->context())
pfeldman 2016/01/27 22:15:45 Done.
RefPtrWillBeRawPtr<LocalFrame> protect(toDocument(executionContext)->frame());
InspectorDebuggerAgent::compileScript(errorString, expression, sourceURL, persistScript, executionContextId, scriptId, exceptionDetails);
if (!scriptId->isAssigned())
@@ -155,8 +162,14 @@ void PageDebuggerAgent::runScript(ErrorString* errorString, const ScriptId& scri
*errorString = "Inspected frame has gone";
return;
}
- ExecutionContext* executionContext = injectedScript->scriptState()->executionContext();
+ v8::HandleScope handles(injectedScript->isolate());
+ ScriptState* scriptState = ScriptState::from(injectedScript->context());
+ if (!scriptState) {
+ *errorString = "Inspected frame has gone";
+ return;
+ }
+ ExecutionContext* executionContext = scriptState->executionContext();
String sourceURL = m_compiledScriptURLs.take(scriptId);
LocalFrame* frame = toDocument(executionContext)->frame();
TRACE_EVENT1("devtools.timeline", "EvaluateScript", "data", InspectorEvaluateScriptEvent::data(frame, sourceURL, TextPosition::minimumPosition()));

Powered by Google App Engine
This is Rietveld 408576698