| Index: Source/core/inspector/PageRuntimeAgent.cpp
|
| diff --git a/Source/core/inspector/PageRuntimeAgent.cpp b/Source/core/inspector/PageRuntimeAgent.cpp
|
| index e7cfb5414956a6797ed45dc482fc2816d0476a1f..9c1d5a2d6d0912b7907f10a6bb0e2972ec1027e8 100644
|
| --- a/Source/core/inspector/PageRuntimeAgent.cpp
|
| +++ b/Source/core/inspector/PageRuntimeAgent.cpp
|
| @@ -85,7 +85,7 @@
|
| // unintentionally initialize contexts in the frames which may trigger some listeners
|
| // that are expected to be triggered only after the load is committed, see http://crbug.com/131623
|
| if (m_mainWorldContextCreated)
|
| - reportExecutionContextsToFrontend();
|
| + reportExecutionContextCreation();
|
| }
|
|
|
| void PageRuntimeAgent::run(ErrorString* errorString)
|
| @@ -104,27 +104,9 @@
|
| if (frame == m_inspectedPage->mainFrame()) {
|
| m_scriptStateToId.clear();
|
| m_frontend->executionContextsCleared();
|
| - registerMainWorldContext(frame);
|
| }
|
| -}
|
| -
|
| -void PageRuntimeAgent::registerMainWorldContext(LocalFrame* frame)
|
| -{
|
| - if (!frame->script().isMainWorldInitialized())
|
| - return;
|
| -
|
| String frameId = m_pageAgent->frameId(frame);
|
| addExecutionContextToFrontend(ScriptState::forMainWorld(frame), true, "", frameId);
|
| -}
|
| -
|
| -void PageRuntimeAgent::didCreateMainWorldContext(LocalFrame* frame, ScriptState* scriptState, SecurityOrigin* origin)
|
| -{
|
| - if (!m_enabled)
|
| - return;
|
| - ASSERT(m_frontend);
|
| -
|
| - String frameId = m_pageAgent->frameId(frame);
|
| - addExecutionContextToFrontend(scriptState, true, origin->toRawString(), frameId);
|
| }
|
|
|
| void PageRuntimeAgent::didCreateIsolatedContext(LocalFrame* frame, ScriptState* scriptState, SecurityOrigin* origin)
|
| @@ -161,7 +143,7 @@
|
| FrameConsole::unmute();
|
| }
|
|
|
| -void PageRuntimeAgent::reportExecutionContextsToFrontend()
|
| +void PageRuntimeAgent::reportExecutionContextCreation()
|
| {
|
| Vector<std::pair<ScriptState*, SecurityOrigin*> > isolatedContexts;
|
| for (Frame* frame = m_inspectedPage->mainFrame(); frame; frame = frame->tree().traverseNext()) {
|
| @@ -172,7 +154,8 @@
|
| continue;
|
| String frameId = m_pageAgent->frameId(localFrame);
|
|
|
| - registerMainWorldContext(localFrame);
|
| + ScriptState* scriptState = ScriptState::forMainWorld(localFrame);
|
| + addExecutionContextToFrontend(scriptState, true, "", frameId);
|
| localFrame->script().collectIsolatedContexts(isolatedContexts);
|
| if (isolatedContexts.isEmpty())
|
| continue;
|
|
|