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

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

Issue 1340343003: scheduler: Implement WebFrameScheduler and WebPageScheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased + fixed gn build. Created 5 years, 3 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/Page.cpp
diff --git a/third_party/WebKit/Source/core/page/Page.cpp b/third_party/WebKit/Source/core/page/Page.cpp
index 09455237e5189f80610d5d02fe139f2fe73d877d..c0143018d66ce8160d10b5cb5e116f953ad3cfda 100644
--- a/third_party/WebKit/Source/core/page/Page.cpp
+++ b/third_party/WebKit/Source/core/page/Page.cpp
@@ -50,6 +50,8 @@
#include "platform/MemoryPurgeController.h"
#include "platform/graphics/GraphicsLayer.h"
#include "platform/plugins/PluginData.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebFrameHostScheduler.h"
namespace blink {
@@ -387,10 +389,14 @@ void Page::setVisibilityState(PageVisibilityState visibilityState, bool isInitia
return;
m_visibilityState = visibilityState;
- if (visibilityState == PageVisibilityStateVisible)
+ // TODO(alexclarke): Move throttling of timers to chromium.
+ if (visibilityState == PageVisibilityStateVisible) {
+ m_frameHost->frameHostScheduler()->setPageInBackground(false);
setTimerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval());
- else
+ } else {
+ m_frameHost->frameHostScheduler()->setPageInBackground(true);
setTimerAlignmentInterval(DOMTimer::hiddenPageAlignmentInterval());
+ }
if (!isInitialState)
notifyPageVisibilityChanged();
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698