- Source/WebCore/ChangeLog +20 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2016-03-02  Gavin Barraclough  <barraclough@apple.com>
2
3
        Disable timer throttling increases for visually idle / active pages.
4
        https://bugs.webkit.org/show_bug.cgi?id=154935
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Currently any page that is visually idle can timer throttle, and all are eligible for throttling
9
        allow throttling to increase.
10
11
        Instead, still allow any visually idle page to timer throttle, but only allow increasing in those
12
        that are fully hidden & inactive (no page loading or media activity).
13
14
        * page/Page.cpp:
15
        (WebCore::Page::setTimerThrottlingState):
16
            - Updated policy per commet above.
17
        (WebCore::Page::setPageActivityState):
18
        (WebCore::Page::setIsVisible):
19
            - We now may need to updated timer throttling when these change.
20
1
2016-03-02  Konstantin Tokarev  <annulen@yandex.ru>
21
2016-03-02  Konstantin Tokarev  <annulen@yandex.ru>
2
22
3
        [cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK.
23
        [cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK.
- Source/WebCore/page/Page.cpp -4 / +16 lines
Lines 1185-1196 void Page::hiddenPageDOMTimerThrottlingS Source/WebCore/page/Page.cpp_sec1
1185
1185
1186
void Page::updateTimerThrottlingState()
1186
void Page::updateTimerThrottlingState()
1187
{
1187
{
1188
    TimerThrottlingState state = TimerThrottlingState::Disabled;
1188
    // Timer throttling disabled is page is visually active, or disabled by setting.
1189
    if (!(m_viewState & ViewState::IsVisuallyIdle) || !m_settings->hiddenPageDOMTimerThrottlingEnabled()) {
1190
        setTimerThrottlingState(TimerThrottlingState::Disabled);
1191
        return;
1192
    }
1189
1193
1190
    if (m_settings->hiddenPageDOMTimerThrottlingEnabled() && m_viewState & ViewState::IsVisuallyIdle)
1194
    // If the page is visible (but idle), there is any activity (loading, media playing, etc), or per setting,
1191
        state = m_settings->hiddenPageDOMTimerThrottlingAutoIncreases() ? TimerThrottlingState::EnabledIncreasing : TimerThrottlingState::Enabled;
1195
    // we allow timer throttling, but not increasing timer throttling.
1196
    if (m_viewState & ViewState::IsVisible || m_pageThrottler.activityState() || !m_settings->hiddenPageDOMTimerThrottlingAutoIncreases()) {
1197
        setTimerThrottlingState(TimerThrottlingState::Enabled);
1198
        return;
1199
    }
1192
1200
1193
    setTimerThrottlingState(state);
1201
    // If we get here increasing timer throttling is enabled.
1202
    setTimerThrottlingState(TimerThrottlingState::EnabledIncreasing);
1194
}
1203
}
1195
1204
1196
void Page::setTimerThrottlingState(TimerThrottlingState state)
1205
void Page::setTimerThrottlingState(TimerThrottlingState state)
Lines 1402-1407 void Page::setViewState(ViewState::Flags Source/WebCore/page/Page.cpp_sec2
1402
void Page::setPageActivityState(PageActivityState::Flags activityState)
1411
void Page::setPageActivityState(PageActivityState::Flags activityState)
1403
{
1412
{
1404
    chrome().client().setPageActivityState(activityState);
1413
    chrome().client().setPageActivityState(activityState);
1414
    updateTimerThrottlingState();
1405
}
1415
}
1406
1416
1407
void Page::setIsVisible(bool isVisible)
1417
void Page::setIsVisible(bool isVisible)
Lines 1453-1458 void Page::setIsVisibleInternal(bool isV Source/WebCore/page/Page.cpp_sec3
1453
        if (FrameView* view = mainFrame().view())
1463
        if (FrameView* view = mainFrame().view())
1454
            view->hide();
1464
            view->hide();
1455
    }
1465
    }
1466
1467
    updateTimerThrottlingState();
1456
}
1468
}
1457
1469
1458
void Page::setIsPrerender()
1470
void Page::setIsPrerender()

Return to Bug 154935