Title: [272381] trunk/Source/WebKit
Revision
272381
Author
you...@apple.com
Date
2021-02-04 13:32:14 -0800 (Thu, 04 Feb 2021)

Log Message

Test landed flaky: [iOS] TestWebKitAPI.WebKit2.CrashGPUProcessWhileCapturing
https://bugs.webkit.org/show_bug.cgi?id=221331
<rdar://problem/73935129>

Reviewed by Eric Carlson.

For video sources tied to a remote source in GPUProcess, we are calling requestToEnd instead of end
since the same remote source may be shared with other cloned video sources.
In that case, the source in WebProcess should be considered as ended as soon as requestToEnd is called.

This is important as in case of GPUProcess, we are recreating sources that are not ended.
We were thus recreating a source which was actually ended in WebProcess.
This appears in particular on iOS where only one source can be active at a time.

A further refactoring should probably change the way we clone video sources given we are now supporting size and frame rate adaptations in RealtimeVideoSource.

Covered by API test no longer falkily failing.

* WebProcess/cocoa/RemoteRealtimeMediaSource.cpp:
(WebKit::RemoteRealtimeMediaSource::captureFailed):
(WebKit::RemoteRealtimeMediaSource::requestToEnd):
* WebProcess/cocoa/RemoteRealtimeMediaSource.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (272380 => 272381)


--- trunk/Source/WebKit/ChangeLog	2021-02-04 21:31:22 UTC (rev 272380)
+++ trunk/Source/WebKit/ChangeLog	2021-02-04 21:32:14 UTC (rev 272381)
@@ -1,3 +1,28 @@
+2021-02-04  Youenn Fablet  <you...@apple.com>
+
+        Test landed flaky: [iOS] TestWebKitAPI.WebKit2.CrashGPUProcessWhileCapturing
+        https://bugs.webkit.org/show_bug.cgi?id=221331
+        <rdar://problem/73935129>
+
+        Reviewed by Eric Carlson.
+
+        For video sources tied to a remote source in GPUProcess, we are calling requestToEnd instead of end
+        since the same remote source may be shared with other cloned video sources.
+        In that case, the source in WebProcess should be considered as ended as soon as requestToEnd is called.
+
+        This is important as in case of GPUProcess, we are recreating sources that are not ended.
+        We were thus recreating a source which was actually ended in WebProcess.
+        This appears in particular on iOS where only one source can be active at a time.
+
+        A further refactoring should probably change the way we clone video sources given we are now supporting size and frame rate adaptations in RealtimeVideoSource.
+
+        Covered by API test no longer falkily failing.
+
+        * WebProcess/cocoa/RemoteRealtimeMediaSource.cpp:
+        (WebKit::RemoteRealtimeMediaSource::captureFailed):
+        (WebKit::RemoteRealtimeMediaSource::requestToEnd):
+        * WebProcess/cocoa/RemoteRealtimeMediaSource.h:
+
 2021-02-04  Alex Christensen  <achristen...@apple.com>
 
         REGRESSION(r267763) Network process launches earlier than before

Modified: trunk/Source/WebKit/WebProcess/cocoa/RemoteRealtimeMediaSource.cpp (272380 => 272381)


--- trunk/Source/WebKit/WebProcess/cocoa/RemoteRealtimeMediaSource.cpp	2021-02-04 21:31:22 UTC (rev 272380)
+++ trunk/Source/WebKit/WebProcess/cocoa/RemoteRealtimeMediaSource.cpp	2021-02-04 21:32:14 UTC (rev 272381)
@@ -303,6 +303,7 @@
 
 void RemoteRealtimeMediaSource::stopBeingObserved()
 {
+    m_hasRequestedToEnd = true;
     connection()->send(Messages::UserMediaCaptureManagerProxy::RequestToEnd { m_identifier }, 0);
 }
 
@@ -324,7 +325,7 @@
 void RemoteRealtimeMediaSource::gpuProcessConnectionDidClose(GPUProcessConnection&)
 {
     ASSERT(m_shouldCaptureInGPUProcess);
-    if (isEnded())
+    if (isEnded() || m_hasRequestedToEnd)
         return;
 
     m_manager.didUpdateSourceConnection(*this);

Modified: trunk/Source/WebKit/WebProcess/cocoa/RemoteRealtimeMediaSource.h (272380 => 272381)


--- trunk/Source/WebKit/WebProcess/cocoa/RemoteRealtimeMediaSource.h	2021-02-04 21:31:22 UTC (rev 272380)
+++ trunk/Source/WebKit/WebProcess/cocoa/RemoteRealtimeMediaSource.h	2021-02-04 21:32:14 UTC (rev 272381)
@@ -113,6 +113,7 @@
     Deque<ApplyConstraintsHandler> m_pendingApplyConstraintsCallbacks;
     bool m_shouldCaptureInGPUProcess { false };
     bool m_isReady { false };
+    bool m_hasRequestedToEnd { false };
     String m_errorMessage;
     CompletionHandler<void(String)> m_callback;
     WebCore::CaptureDevice m_device;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to