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

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: hammer 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..5dcd07bcd2a52559c7f7d6ffda40df0c950bb8ec 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
+ // cancelParsing() may have already detached the frame, since it fires a JS
+ // event.
+ if (m_frame->page() && m_frame->page()->defersLoading())
+ setDefersLoading(true);
dcheng 2016/07/25 06:48:18 This makes me pretty sad. When we initially create
takeObjectSnapshot();
}

Powered by Google App Engine
This is Rietveld 408576698