| Index: Source/WebCore/inspector/PageRuntimeAgent.cpp
|
| ===================================================================
|
| --- Source/WebCore/inspector/PageRuntimeAgent.cpp (revision 133600)
|
| +++ Source/WebCore/inspector/PageRuntimeAgent.cpp (working copy)
|
| @@ -38,7 +38,6 @@
|
| #include "Document.h"
|
| #include "InjectedScript.h"
|
| #include "InjectedScriptManager.h"
|
| -#include "InspectorAgent.h"
|
| #include "InspectorPageAgent.h"
|
| #include "InspectorState.h"
|
| #include "InstrumentingAgents.h"
|
| @@ -53,28 +52,28 @@
|
| static const char runtimeEnabled[] = "runtimeEnabled";
|
| };
|
|
|
| -PageRuntimeAgent::PageRuntimeAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, InjectedScriptManager* injectedScriptManager, Page* page, InspectorPageAgent* pageAgent, InspectorAgent* inspectorAgent)
|
| +PageRuntimeAgent::PageRuntimeAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, InjectedScriptManager* injectedScriptManager, Page* page, InspectorPageAgent* pageAgent)
|
| : InspectorRuntimeAgent(instrumentingAgents, state, injectedScriptManager)
|
| , m_inspectedPage(page)
|
| , m_pageAgent(pageAgent)
|
| - , m_inspectorAgent(inspectorAgent)
|
| , m_frontend(0)
|
| + , m_mainWorldContextCreated(false)
|
| {
|
| + m_instrumentingAgents->setPageRuntimeAgent(this);
|
| }
|
|
|
| PageRuntimeAgent::~PageRuntimeAgent()
|
| {
|
| + m_instrumentingAgents->setPageRuntimeAgent(0);
|
| }
|
|
|
| void PageRuntimeAgent::setFrontend(InspectorFrontend* frontend)
|
| {
|
| m_frontend = frontend->runtime();
|
| - m_instrumentingAgents->setPageRuntimeAgent(this);
|
| }
|
|
|
| void PageRuntimeAgent::clearFrontend()
|
| {
|
| - m_instrumentingAgents->setPageRuntimeAgent(0);
|
| m_frontend = 0;
|
| String errorString;
|
| disable(&errorString);
|
| @@ -98,7 +97,7 @@
|
| // Only report existing contexts if the page did commit load, otherwise we may
|
| // 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_inspectorAgent->didCommitLoadFired())
|
| + if (m_mainWorldContextCreated)
|
| reportExecutionContextCreation();
|
| }
|
|
|
| @@ -111,8 +110,10 @@
|
| m_state->setBoolean(PageRuntimeAgentState::runtimeEnabled, false);
|
| }
|
|
|
| -void PageRuntimeAgent::didClearWindowObject(Frame* frame)
|
| +void PageRuntimeAgent::didCreateMainWorldContext(Frame* frame)
|
| {
|
| + m_mainWorldContextCreated = true;
|
| +
|
| if (!m_enabled)
|
| return;
|
| ASSERT(m_frontend);
|
|
|