Title: [251141] branches/safari-608.3.10.0-branch/Source/WebKit
Revision
251141
Author
alanc...@apple.com
Date
2019-10-15 09:42:55 -0700 (Tue, 15 Oct 2019)

Log Message

Cherry-pick r250773. rdar://problem/56271907

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

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250773 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-608.3.10.0-branch/Source/WebKit/ChangeLog (251140 => 251141)


--- branches/safari-608.3.10.0-branch/Source/WebKit/ChangeLog	2019-10-15 16:40:44 UTC (rev 251140)
+++ branches/safari-608.3.10.0-branch/Source/WebKit/ChangeLog	2019-10-15 16:42:55 UTC (rev 251141)
@@ -1,3 +1,46 @@
+2019-10-15  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r250773. rdar://problem/56271907
+
+    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):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-10-07  youenn fablet  <you...@apple.com>
+
+            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):
+
 2019-10-08  Alan Coon  <alanc...@apple.com>
 
         Cherry-pick r250438. rdar://problem/55984974

Modified: branches/safari-608.3.10.0-branch/Source/WebKit/UIProcess/WebPageProxy.cpp (251140 => 251141)


--- branches/safari-608.3.10.0-branch/Source/WebKit/UIProcess/WebPageProxy.cpp	2019-10-15 16:40:44 UTC (rev 251140)
+++ branches/safari-608.3.10.0-branch/Source/WebKit/UIProcess/WebPageProxy.cpp	2019-10-15 16:42:55 UTC (rev 251141)
@@ -8275,7 +8275,9 @@
 #if ENABLE(MEDIA_STREAM)
     if (oldMediaCaptureState != newMediaCaptureState) {
         m_uiClient->mediaCaptureStateDidChange(m_mediaState);
-        m_userMediaPermissionRequestManager->captureStateChanged(oldMediaCaptureState, newMediaCaptureState);
+        ASSERT(m_userMediaPermissionRequestManager);
+        if (m_userMediaPermissionRequestManager)
+            m_userMediaPermissionRequestManager->captureStateChanged(oldMediaCaptureState, newMediaCaptureState);
     }
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to