Changeset 250773 in webkit


Ignore:
Timestamp:
Oct 7, 2019 7:14:12 AM (5 years ago)
Author:
youenn@apple.com
Message:

WebPageProxy::updatePlayingMediaDidChange should protect from a null m_userMediaPermissionRequestManager
https://bugs.webkit.org/show_bug.cgi?id=202628
<rdar://problem/55935091>

Reviewed by Eric Carlson.

On process swap on navigation or process crash, m_userMediaPermissionRequestManager is made null.
At the same time, the media state is set back to not playing.
Future calls of updatePlayingMediaDidChange should not have any capture state change until getUserMedia/getDisplayMedia
is called, which would create m_userMediaPermissionRequestManager.
But this assumption is not always true given that the media state is computed as process-wide in MediaStreamTrack::captureState on iOS.
The above behavior is fixed as part of https://bugs.webkit.org/show_bug.cgi?id=202627.
Since the call to updatePlayingMediaDidChange is triggered straight from IPC, it should not be trusted and a null check should be added.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::updatePlayingMediaDidChange):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r250755 r250773  
     12019-10-07  youenn fablet  <youenn@apple.com>
     2
     3        WebPageProxy::updatePlayingMediaDidChange should protect from a null m_userMediaPermissionRequestManager
     4        https://bugs.webkit.org/show_bug.cgi?id=202628
     5        <rdar://problem/55935091>
     6
     7        Reviewed by Eric Carlson.
     8
     9        On process swap on navigation or process crash, m_userMediaPermissionRequestManager is made null.
     10        At the same time, the media state is set back to not playing.
     11        Future calls of updatePlayingMediaDidChange should not have any capture state change until getUserMedia/getDisplayMedia
     12        is called, which would create m_userMediaPermissionRequestManager.
     13        But this assumption is not always true given that the media state is computed as process-wide in MediaStreamTrack::captureState on iOS.
     14        The above behavior is fixed as part of https://bugs.webkit.org/show_bug.cgi?id=202627.
     15        Since the call to updatePlayingMediaDidChange is triggered straight from IPC, it should not be trusted and a null check should be added.
     16
     17        * UIProcess/WebPageProxy.cpp:
     18        (WebKit::WebPageProxy::updatePlayingMediaDidChange):
     19
    1202019-10-04  Dean Jackson  <dino@apple.com>
    221
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r250645 r250773  
    83078307    if (oldMediaCaptureState != newMediaCaptureState) {
    83088308        m_uiClient->mediaCaptureStateDidChange(m_mediaState);
    8309         m_userMediaPermissionRequestManager->captureStateChanged(oldMediaCaptureState, newMediaCaptureState);
     8309        ASSERT(m_userMediaPermissionRequestManager);
     8310        if (m_userMediaPermissionRequestManager)
     8311            m_userMediaPermissionRequestManager->captureStateChanged(oldMediaCaptureState, newMediaCaptureState);
    83108312    }
    83118313#endif
Note: See TracChangeset for help on using the changeset viewer.