Title: [208247] trunk/Source/WebCore
Revision
208247
Author
barraclo...@apple.com
Date
2016-11-01 14:49:40 -0700 (Tue, 01 Nov 2016)

Log Message

Port Page timer throttling to use ActivityState instead of PageThrottler
https://bugs.webkit.org/show_bug.cgi?id=164291

Reviewed by Geoff Garen & Antti Koivisto.

ActivityState now conveys this information; after this change PageThrottler is redundant and can be removed.

* page/Page.cpp:
(WebCore::Page::updateTimerThrottlingState):
    - determine page throttling mode based on IsAudible/IsLoading in ActivityState.
(WebCore::Page::setActivityState):
    - call updateTimerThrottlingState if IsAudible/IsLoading change.
* page/Page.h:
(WebCore::Page::pageActivityStateChanged):
    - no need to listen for PageActivityState changes from the PageThrottler.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (208246 => 208247)


--- trunk/Source/WebCore/ChangeLog	2016-11-01 21:48:31 UTC (rev 208246)
+++ trunk/Source/WebCore/ChangeLog	2016-11-01 21:49:40 UTC (rev 208247)
@@ -1,3 +1,21 @@
+2016-11-01  Gavin Barraclough  <barraclo...@apple.com>
+
+        Port Page timer throttling to use ActivityState instead of PageThrottler
+        https://bugs.webkit.org/show_bug.cgi?id=164291
+
+        Reviewed by Geoff Garen & Antti Koivisto.
+
+        ActivityState now conveys this information; after this change PageThrottler is redundant and can be removed.
+
+        * page/Page.cpp:
+        (WebCore::Page::updateTimerThrottlingState):
+            - determine page throttling mode based on IsAudible/IsLoading in ActivityState.
+        (WebCore::Page::setActivityState):
+            - call updateTimerThrottlingState if IsAudible/IsLoading change.
+        * page/Page.h:
+        (WebCore::Page::pageActivityStateChanged):
+            - no need to listen for PageActivityState changes from the PageThrottler.
+
 2016-11-01  Antoine Quint  <grao...@apple.com>
 
         [Modern Media Controls] Media Controller: Placard support

Modified: trunk/Source/WebCore/page/Page.cpp (208246 => 208247)


--- trunk/Source/WebCore/page/Page.cpp	2016-11-01 21:48:31 UTC (rev 208246)
+++ trunk/Source/WebCore/page/Page.cpp	2016-11-01 21:49:40 UTC (rev 208247)
@@ -1227,7 +1227,8 @@
 
     // If the page is visible (but idle), there is any activity (loading, media playing, etc), or per setting,
     // we allow timer throttling, but not increasing timer throttling.
-    if (!m_settings->hiddenPageDOMTimerThrottlingAutoIncreases() || m_activityState & ActivityState::IsVisible || m_pageThrottler.activityState()) {
+    if (!m_settings->hiddenPageDOMTimerThrottlingAutoIncreases()
+        || m_activityState & (ActivityState::IsVisible | ActivityState::IsAudible | ActivityState::IsLoading)) {
         setTimerThrottlingState(TimerThrottlingState::Enabled);
         return;
     }
@@ -1458,7 +1459,7 @@
     if (changed & ActivityState::IsVisuallyIdle)
         setIsVisuallyIdleInternal(activityState & ActivityState::IsVisuallyIdle);
 
-    if (changed & (ActivityState::IsVisible | ActivityState::IsVisuallyIdle))
+    if (changed & (ActivityState::IsVisible | ActivityState::IsVisuallyIdle | ActivityState::IsAudible | ActivityState::IsLoading))
         updateTimerThrottlingState();
 
     for (auto* observer : m_activityStateChangeObservers)

Modified: trunk/Source/WebCore/page/Page.h (208246 => 208247)


--- trunk/Source/WebCore/page/Page.h	2016-11-01 21:48:31 UTC (rev 208246)
+++ trunk/Source/WebCore/page/Page.h	2016-11-01 21:49:40 UTC (rev 208247)
@@ -336,7 +336,7 @@
     // Notifications when the Page starts and stops being presented via a native window.
     WEBCORE_EXPORT void setActivityState(ActivityState::Flags);
     bool isVisibleAndActive() const;
-    void pageActivityStateChanged() { updateTimerThrottlingState(); }
+    void pageActivityStateChanged() { }
     WEBCORE_EXPORT void setIsVisible(bool);
     WEBCORE_EXPORT void setIsPrerender();
     bool isVisible() const { return m_activityState & ActivityState::IsVisible; }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to