Title: [273398] branches/safari-611-branch/Source/WebKit
Revision
273398
Author
repst...@apple.com
Date
2021-02-24 09:10:37 -0800 (Wed, 24 Feb 2021)

Log Message

Cherry-pick r273265. rdar://problem/74623623

    UserMediaPermissionRequestManagerProxy may be released while computing capture device list
    https://bugs.webkit.org/show_bug.cgi?id=222236
    <rdar://74480265>

    Reviewed by Youenn Fablet.

    * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
    (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList): Return early
    if `weakThis` is NULL.

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

Modified Paths

Diff

Modified: branches/safari-611-branch/Source/WebKit/ChangeLog (273397 => 273398)


--- branches/safari-611-branch/Source/WebKit/ChangeLog	2021-02-24 17:10:34 UTC (rev 273397)
+++ branches/safari-611-branch/Source/WebKit/ChangeLog	2021-02-24 17:10:37 UTC (rev 273398)
@@ -1,5 +1,33 @@
 2021-02-23  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r273265. rdar://problem/74623623
+
+    UserMediaPermissionRequestManagerProxy may be released while computing capture device list
+    https://bugs.webkit.org/show_bug.cgi?id=222236
+    <rdar://74480265>
+    
+    Reviewed by Youenn Fablet.
+    
+    * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
+    (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList): Return early
+    if `weakThis` is NULL.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-22  Eric Carlson  <eric.carl...@apple.com>
+
+            UserMediaPermissionRequestManagerProxy may be released while computing capture device list
+            https://bugs.webkit.org/show_bug.cgi?id=222236
+            <rdar://74480265>
+
+            Reviewed by Youenn Fablet.
+
+            * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
+            (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList): Return early
+            if `weakThis` is NULL.
+
+2021-02-23  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r273196. rdar://problem/74623520
 
     Crash under Decoder::Decoder()

Modified: branches/safari-611-branch/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp (273397 => 273398)


--- branches/safari-611-branch/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp	2021-02-24 17:10:34 UTC (rev 273397)
+++ branches/safari-611-branch/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp	2021-02-24 17:10:37 UTC (rev 273398)
@@ -698,6 +698,10 @@
     static const unsigned defaultMaximumMicrophoneCount = 1;
 
     RealtimeMediaSourceCenter::singleton().getMediaStreamDevices([this, weakThis = makeWeakPtr(this), revealIdsAndLabels, completion = WTFMove(completion)] (auto&& devices) mutable {
+
+        if (!weakThis)
+            completion({ });
+
         unsigned cameraCount = 0;
         unsigned microphoneCount = 0;
 
@@ -722,10 +726,9 @@
             filteredDevices.append(revealIdsAndLabels ? device : CaptureDevice({ }, device.type(), { }, { }));
         }
 
-        if (weakThis)
-            m_hasFilteredDeviceList = !revealIdsAndLabels;
+        weakThis->m_hasFilteredDeviceList = !revealIdsAndLabels;
+        ALWAYS_LOG(LOGIDENTIFIER, filteredDevices.size(), " devices revealed");
 
-        ALWAYS_LOG(LOGIDENTIFIER, filteredDevices.size(), " devices revealed");
         completion(WTFMove(filteredDevices));
     });
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to