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

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

Issue 2524273002: Move ExecutionContext's task suspension from FrameLoader to Page
Patch Set: Created 4 years, 1 month 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 | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/page/Page.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 59426dd8146ebbc2ff770d250539ebfa8f54c7a1..86e0bd9574653dbdf768741d4e7d807eb8d20037 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -231,8 +231,11 @@ void FrameLoader::init() {
// Self-suspend if created in an already suspended 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()->suspended())
+ if (m_frame->page() && m_frame->page()->suspended()) {
+ m_provisionalDocumentLoader->fetcher()->setDefersLoading(true);
+ m_frame->document()->suspendScheduledTasks();
setDefersLoading(true);
+ }
takeObjectSnapshot();
}
@@ -244,14 +247,6 @@ void FrameLoader::setDefersLoading(bool defers) {
if (m_provisionalDocumentLoader)
m_provisionalDocumentLoader->fetcher()->setDefersLoading(defers);
- if (Document* document = m_frame->document()) {
- document->fetcher()->setDefersLoading(defers);
- if (defers)
- document->suspendScheduledTasks();
- else
- document->resumeScheduledTasks();
- }
-
if (!defers) {
if (m_deferredHistoryLoad) {
load(FrameLoadRequest(nullptr, m_deferredHistoryLoad->m_request),
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.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