Chromium Code Reviews| 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())); |