Title: [151244] trunk/Source/WebCore
- Revision
- 151244
- Author
- [email protected]
- Date
- 2013-06-05 15:24:29 -0700 (Wed, 05 Jun 2013)
Log Message
Don't throttle timers if a page is doing something that might be interesting
https://bugs.webkit.org/show_bug.cgi?id=117273
Reviewed by Gavin Barraclough.
Make the decision about whether or not to throttle timers be
determined by the PageThrottler
* page/Page.cpp:
(WebCore::Page::throttleTimers):
(WebCore::Page::unthrottleTimers):
(WebCore::Page::setVisibilityState):
(WebCore::Page::hiddenPageDOMTimerThrottlingStateChanged):
* page/Page.h:
* page/PageThrottler.cpp:
(WebCore::PageThrottler::throttlePage):
(WebCore::PageThrottler::unthrottlePage):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (151243 => 151244)
--- trunk/Source/WebCore/ChangeLog 2013-06-05 22:19:18 UTC (rev 151243)
+++ trunk/Source/WebCore/ChangeLog 2013-06-05 22:24:29 UTC (rev 151244)
@@ -1,3 +1,23 @@
+2013-06-05 Oliver Hunt <[email protected]>
+
+ Don't throttle timers if a page is doing something that might be interesting
+ https://bugs.webkit.org/show_bug.cgi?id=117273
+
+ Reviewed by Gavin Barraclough.
+
+ Make the decision about whether or not to throttle timers be
+ determined by the PageThrottler
+
+ * page/Page.cpp:
+ (WebCore::Page::throttleTimers):
+ (WebCore::Page::unthrottleTimers):
+ (WebCore::Page::setVisibilityState):
+ (WebCore::Page::hiddenPageDOMTimerThrottlingStateChanged):
+ * page/Page.h:
+ * page/PageThrottler.cpp:
+ (WebCore::PageThrottler::throttlePage):
+ (WebCore::PageThrottler::unthrottlePage):
+
2013-06-05 Mark Salisbury <[email protected]>
[WinCE,WinCairo] RenderThemeWin.cpp needs to include FrameSelection.h.
Modified: trunk/Source/WebCore/page/Page.cpp (151243 => 151244)
--- trunk/Source/WebCore/page/Page.cpp 2013-06-05 22:19:18 UTC (rev 151243)
+++ trunk/Source/WebCore/page/Page.cpp 2013-06-05 22:24:29 UTC (rev 151244)
@@ -1250,6 +1250,22 @@
}
#endif
+void Page::throttleTimers()
+{
+#if ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
+ if (m_settings->hiddenPageDOMTimerThrottlingEnabled())
+ setTimerAlignmentInterval(Settings::hiddenPageDOMTimerAlignmentInterval());
+#endif
+}
+
+void Page::unthrottleTimers()
+{
+#if ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
+ if (m_settings->hiddenPageDOMTimerThrottlingEnabled())
+ setTimerAlignmentInterval(Settings::defaultDOMTimerAlignmentInterval());
+#endif
+}
+
#if ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
void Page::setVisibilityState(PageVisibilityState visibilityState, bool isInitialState)
{
@@ -1265,17 +1281,12 @@
#endif
if (visibilityState == WebCore::PageVisibilityStateHidden) {
-#if ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
- if (m_settings->hiddenPageDOMTimerThrottlingEnabled())
- setTimerAlignmentInterval(Settings::hiddenPageDOMTimerAlignmentInterval());
-#endif
+ if (m_pageThrottler->shouldThrottleTimers())
+ throttleTimers();
if (m_settings->hiddenPageCSSAnimationSuspensionEnabled())
mainFrame()->animation()->suspendAnimations();
} else {
-#if ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
- if (m_settings->hiddenPageDOMTimerThrottlingEnabled())
- setTimerAlignmentInterval(Settings::defaultDOMTimerAlignmentInterval());
-#endif
+ unthrottleTimers();
if (m_settings->hiddenPageCSSAnimationSuspensionEnabled())
mainFrame()->animation()->resumeAnimations();
}
@@ -1525,7 +1536,7 @@
{
if (m_settings->hiddenPageDOMTimerThrottlingEnabled()) {
#if ENABLE(PAGE_VISIBILITY_API)
- if (m_visibilityState == WebCore::PageVisibilityStateHidden)
+ if (m_pageThrottler->shouldThrottleTimers())
setTimerAlignmentInterval(Settings::hiddenPageDOMTimerAlignmentInterval());
#endif
} else
Modified: trunk/Source/WebCore/page/Page.h (151243 => 151244)
--- trunk/Source/WebCore/page/Page.h 2013-06-05 22:19:18 UTC (rev 151243)
+++ trunk/Source/WebCore/page/Page.h 2013-06-05 22:24:29 UTC (rev 151244)
@@ -431,6 +431,9 @@
void collectPluginViews(Vector<RefPtr<PluginViewBase>, 32>& pluginViewBases);
+ void throttleTimers();
+ void unthrottleTimers();
+
const OwnPtr<Chrome> m_chrome;
OwnPtr<DragCaretController> m_dragCaretController;
Modified: trunk/Source/WebCore/page/PageThrottler.cpp (151243 => 151244)
--- trunk/Source/WebCore/page/PageThrottler.cpp 2013-06-05 22:19:18 UTC (rev 151243)
+++ trunk/Source/WebCore/page/PageThrottler.cpp 2013-06-05 22:24:29 UTC (rev 151244)
@@ -77,6 +77,8 @@
if (frame->document())
frame->document()->scriptedAnimationControllerSetThrottled(true);
}
+
+ m_page->throttleTimers();
}
void PageThrottler::unthrottlePage()
@@ -96,6 +98,8 @@
if (frame->document())
frame->document()->scriptedAnimationControllerSetThrottled(false);
}
+
+ m_page->unthrottleTimers();
}
void PageThrottler::setThrottled(bool isThrottled)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes