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

Unified Diff: Source/core/page/PageGroupLoadDeferrer.cpp

Issue 23620020: Don't wait to notify client of spoof attempt if a modal dialog is created. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use PageGroupLoadDeferrer instead Created 7 years, 3 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.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/PageGroupLoadDeferrer.cpp
diff --git a/Source/core/page/PageGroupLoadDeferrer.cpp b/Source/core/page/PageGroupLoadDeferrer.cpp
index 43f66cb48b59951092661ec28287ae5272fd195f..fec74c1d9dee1d19443f2fb0ff6c6d78ac146815 100644
--- a/Source/core/page/PageGroupLoadDeferrer.cpp
+++ b/Source/core/page/PageGroupLoadDeferrer.cpp
@@ -22,6 +22,7 @@
#include "core/page/PageGroupLoadDeferrer.h"
#include "core/dom/Document.h"
+#include "core/loader/FrameLoader.h"
#include "core/page/Frame.h"
#include "core/page/Page.h"
#include "core/page/PageGroup.h"
@@ -42,6 +43,10 @@ PageGroupLoadDeferrer::PageGroupLoadDeferrer(Page* page, bool deferSelf)
if (!otherPage->defersLoading()) {
m_deferredFrames.append(otherPage->mainFrame());
+ // Ensure that we notify the client if the initial empty document is accessed before showing anything
+ // modal, to prevent spoofs while the modal window or sheet is visible.
+ otherPage->mainFrame()->loader()->notifyIfInitialDocumentAccessed();
+
// This code is not logically part of load deferring, but we do not want JS code executed beneath modal
// windows or sheets, which is exactly when PageGroupLoadDeferrer is used.
for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree()->traverseNext())
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698