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

Unified Diff: third_party/WebKit/Source/core/page/Page.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/loader/FrameLoader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/Page.cpp
diff --git a/third_party/WebKit/Source/core/page/Page.cpp b/third_party/WebKit/Source/core/page/Page.cpp
index 9f0f41c7b54da782a8403ff3ba28394b572689b2..8e101779021d5f6d4fd426f306f187837094c347 100644
--- a/third_party/WebKit/Source/core/page/Page.cpp
+++ b/third_party/WebKit/Source/core/page/Page.cpp
@@ -260,8 +260,17 @@ void Page::setSuspended(bool suspend) {
m_suspended = suspend;
for (Frame* frame = mainFrame(); frame;
frame = frame->tree().traverseNext()) {
- if (frame->isLocalFrame())
- toLocalFrame(frame)->loader().setDefersLoading(suspend);
+ if (!frame->isLocalFrame())
+ continue;
+ LocalFrame* localFrame = toLocalFrame(frame);
+ if (Document* document = localFrame->document()) {
+ if (suspend)
+ document->suspendScheduledTasks();
+ else
+ document->resumeScheduledTasks();
+ }
+
+ localFrame->loader().setDefersLoading(suspend);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698