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

Unified Diff: Source/WebCore/inspector/PageRuntimeAgent.cpp

Issue 10779021: Merge 120822 - Web Inspector: don't report context ids before DidCommitLoad (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « Source/WebCore/inspector/PageRuntimeAgent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/PageRuntimeAgent.cpp
===================================================================
--- Source/WebCore/inspector/PageRuntimeAgent.cpp (revision 122761)
+++ Source/WebCore/inspector/PageRuntimeAgent.cpp (working copy)
@@ -38,6 +38,7 @@
#include "Document.h"
#include "InjectedScript.h"
#include "InjectedScriptManager.h"
+#include "InspectorAgent.h"
#include "InspectorPageAgent.h"
#include "InspectorState.h"
#include "InstrumentingAgents.h"
@@ -52,10 +53,11 @@
static const char reportExecutionContextCreation[] = "reportExecutionContextCreation";
};
-PageRuntimeAgent::PageRuntimeAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, InjectedScriptManager* injectedScriptManager, Page* page, InspectorPageAgent* pageAgent)
+PageRuntimeAgent::PageRuntimeAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, InjectedScriptManager* injectedScriptManager, Page* page, InspectorPageAgent* pageAgent, InspectorAgent* inspectorAgent)
: InspectorRuntimeAgent(instrumentingAgents, state, injectedScriptManager)
, m_inspectedPage(page)
, m_pageAgent(pageAgent)
+ , m_inspectorAgent(inspectorAgent)
, m_frontend(0)
{
}
@@ -81,8 +83,13 @@
{
if (!m_state->getBoolean(PageRuntimeAgentState::reportExecutionContextCreation))
return;
- String error;
- setReportExecutionContextCreation(&error, true);
+ // 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()) {
+ String error;
+ setReportExecutionContextCreation(&error, true);
+ }
}
void PageRuntimeAgent::setReportExecutionContextCreation(ErrorString*, bool enable)
« no previous file with comments | « Source/WebCore/inspector/PageRuntimeAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698