|
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() |