Changeset 215582 in webkit for trunk/Source/WebCore/page/Page.cpp


Ignore:
Timestamp:
Apr 20, 2017, 3:23:15 PM (8 years ago)
Author:
[email protected]
Message:

[MediaStream iOS] Hold process assertion while media capture is active
https://bugs.webkit.org/show_bug.cgi?id=171017
<rdar://problem/31719177>

Reviewed by Dean Jackson.

Source/WebCore:

  • page/ActivityState.h: Add IsCapturingMedia flag.
  • page/Page.cpp:

(WebCore::Page::updateTimerThrottlingState): Enable timer throttling when capture is active
like we do when playing audio.
(WebCore::Page::setActivityState): Ditto.

  • page/PerformanceMonitor.cpp:

(WebCore::PerformanceMonitor::updateProcessStateForMemoryPressure): A process is active when
capturing media, as it is when playing audio.

Source/WebKit2:

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::updateActivityState): Update IsCapturingMedia when necessary.
(WebKit::WebPageProxy::updateThrottleState): Hold a token when capture is active.
(WebKit::WebPageProxy::setMuted): Capture state may change when the page is muted,
so pass IsCapturingMedia to activityStateDidChange.
(WebKit::WebPageProxy::isPlayingMediaDidChange): Ditto.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::updateThrottleState): Don't allow page suppression when capture
is active.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/page/Page.cpp

    r215315 r215582  
    13671367    // we allow timer throttling, but not increasing timer throttling.
    13681368    if (!m_settings->hiddenPageDOMTimerThrottlingAutoIncreases()
    1369         || m_activityState & (ActivityState::IsVisible | ActivityState::IsAudible | ActivityState::IsLoading)) {
     1369        || m_activityState & (ActivityState::IsVisible | ActivityState::IsAudible | ActivityState::IsLoading | ActivityState::IsCapturingMedia)) {
    13701370        setTimerThrottlingState(TimerThrottlingState::Enabled);
    13711371        return;
     
    15991599    }
    16001600
    1601     if (changed & (ActivityState::IsVisible | ActivityState::IsVisuallyIdle | ActivityState::IsAudible | ActivityState::IsLoading))
     1601    if (changed & (ActivityState::IsVisible | ActivityState::IsVisuallyIdle | ActivityState::IsAudible | ActivityState::IsLoading | ActivityState::IsCapturingMedia))
    16021602        updateTimerThrottlingState();
    16031603
Note: See TracChangeset for help on using the changeset viewer.