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: Source/core/loader/FrameLoader.cpp

Issue 146693005: Clarify when what notifications are send when a window object is cleared (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updates Created 6 years, 7 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/core/loader/FrameLoader.h ('k') | Source/core/loader/FrameLoaderClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index 0b14245bc83460dec7287c89fb7b53ddc7fb2ccb..d602d080c9d6b349b6d109012f9dc51bd37a2421 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -307,7 +307,7 @@ void FrameLoader::receivedFirstData()
InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get());
m_frame->page()->didCommitLoad(m_frame);
- dispatchDidClearWindowObjectsInAllWorlds();
+ dispatchDidClearDocumentOfWindowObject();
}
static void didFailContentSecurityPolicyCheck(FrameLoader* loader)
@@ -335,7 +335,7 @@ void FrameLoader::didBeginDocument(bool dispatch)
m_frame->domWindow()->statePopped(m_provisionalItem->stateObject());
if (dispatch)
- dispatchDidClearWindowObjectsInAllWorlds();
+ dispatchDidClearDocumentOfWindowObject();
m_frame->document()->initContentSecurityPolicy(m_documentLoader ? ContentSecurityPolicyResponseHeaders(m_documentLoader->response()) : ContentSecurityPolicyResponseHeaders());
@@ -1377,27 +1377,28 @@ void FrameLoader::dispatchDocumentElementAvailable()
m_client->documentElementAvailable();
}
-void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
+void FrameLoader::dispatchDidClearDocumentOfWindowObject()
{
if (!m_frame->script().canExecuteScripts(NotAboutToExecuteScript))
return;
if (Page* page = m_frame->page())
- page->inspectorController().didClearWindowObjectInMainWorld(m_frame);
- InspectorInstrumentation::didClearWindowObjectInMainWorld(m_frame);
+ page->inspectorController().didClearDocumentOfWindowObject(m_frame);
+ InspectorInstrumentation::didClearDocumentOfWindowObject(m_frame);
- Vector<RefPtr<DOMWrapperWorld> > worlds;
- DOMWrapperWorld::allWorldsInMainThread(worlds);
- for (size_t i = 0; i < worlds.size(); ++i)
- m_client->dispatchDidClearWindowObjectInWorld(*worlds[i]);
+ // We just cleared the document, not the entire window object, but for the
+ // embedder that's close enough.
+ m_client->dispatchDidClearWindowObjectInMainWorld();
}
-void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world)
+void FrameLoader::dispatchDidClearWindowObjectInMainWorld()
{
- if (!m_frame->script().canExecuteScripts(NotAboutToExecuteScript) || !m_frame->script().existingWindowShell(world))
+ if (!m_frame->script().canExecuteScripts(NotAboutToExecuteScript))
return;
- m_client->dispatchDidClearWindowObjectInWorld(world);
+ // FIXME: Why isn't the inspector notified of this?
yurys 2014/05/07 14:14:08 Looks like a bug to me. InspectorController used t
+
+ m_client->dispatchDidClearWindowObjectInMainWorld();
}
SandboxFlags FrameLoader::effectiveSandboxFlags() const
« no previous file with comments | « Source/core/loader/FrameLoader.h ('k') | Source/core/loader/FrameLoaderClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698