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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2174263002: Defer loads in new pages/frames if ScopedPageLoadDeferral is active (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make the unfortunate hack slightly less ugly. 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/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index f1aff24f70f0195ec8f20ae6326178d8892c8647..71c83104e397736e7214f911b59faa32001ca352 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -204,6 +204,11 @@ void FrameLoader::init()
m_provisionalDocumentLoader->startLoadingMainResource();
m_frame->document()->cancelParsing();
m_stateMachine.advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocument);
+ // Self-suspend if created in an already deferred Page. Note that both
+ // startLoadingMainResource() and cancelParsing() may have already detached
+ // the frame, since they both fire JS events.
+ if (m_frame->page() && m_frame->page()->defersLoading())
+ setDefersLoading(true);
takeObjectSnapshot();
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.cpp ('k') | third_party/WebKit/Source/core/page/Page.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698