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

Unified Diff: third_party/WebKit/Source/core/page/ScopedPageLoadDeferrer.cpp

Issue 2155393002: Fix ScopedPageLoadDeferrer to work with pages that have remote main frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheng's nit Created 4 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
Index: third_party/WebKit/Source/core/page/ScopedPageLoadDeferrer.cpp
diff --git a/third_party/WebKit/Source/core/page/ScopedPageLoadDeferrer.cpp b/third_party/WebKit/Source/core/page/ScopedPageLoadDeferrer.cpp
index 9ef36dc6860529ac2168ac77ac670d6186a40bae..8a41b18f1e98f0f6260cc1b1607b87c4a1d96796 100644
--- a/third_party/WebKit/Source/core/page/ScopedPageLoadDeferrer.cpp
+++ b/third_party/WebKit/Source/core/page/ScopedPageLoadDeferrer.cpp
@@ -32,18 +32,15 @@ namespace blink {
ScopedPageLoadDeferrer::ScopedPageLoadDeferrer(Page* exclusion)
{
- for (const Page* page : Page::ordinaryPages()) {
+ for (Page* page : Page::ordinaryPages()) {
if (page == exclusion || page->defersLoading())
continue;
-
- if (!page->mainFrame()->isLocalFrame())
- continue;
-
- m_deferredFrames.append(page->deprecatedLocalMainFrame());
+ m_deferredPages.append(page);
// 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.
- page->deprecatedLocalMainFrame()->loader().notifyIfInitialDocumentAccessed();
+ if (page->mainFrame()->isLocalFrame())
+ page->deprecatedLocalMainFrame()->loader().notifyIfInitialDocumentAccessed();
}
setDefersLoading(true);
@@ -58,10 +55,9 @@ ScopedPageLoadDeferrer::~ScopedPageLoadDeferrer()
void ScopedPageLoadDeferrer::setDefersLoading(bool isDeferred)
{
- for (const auto& frame : m_deferredFrames) {
- if (Page* page = frame->page())
- page->setDefersLoading(isDeferred);
- }
+
+ for (const auto& page : m_deferredPages)
+ page->setDefersLoading(isDeferred);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/page/ScopedPageLoadDeferrer.h ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698