Title: [274370] trunk
Revision
274370
Author
[email protected]
Date
2021-03-12 13:47:36 -0800 (Fri, 12 Mar 2021)

Log Message

Enable video capture in GPUProcess by default on iOS
https://bugs.webkit.org/show_bug.cgi?id=223061

Patch by Youenn Fablet <[email protected]> on 2021-03-12
Reviewed by Eric Carlson.

Source/WebKit:

Covered by existing tests.

* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultCaptureVideoInGPUProcessEnabled):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
We need to synchronously fill the granted requests, otherwise there is a risk that
the granted requests will be cleared (on page close for instance) and then later filled
for the page that was gone.

Tools:

* TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm:
(-[GetUserMediaRepromptTestView haveStream:]):
Upgrade timeout period as GPU process capture might take longer.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (274369 => 274370)


--- trunk/Source/WebKit/ChangeLog	2021-03-12 21:33:09 UTC (rev 274369)
+++ trunk/Source/WebKit/ChangeLog	2021-03-12 21:47:36 UTC (rev 274370)
@@ -1,3 +1,20 @@
+2021-03-12  Youenn Fablet  <[email protected]>
+
+        Enable video capture in GPUProcess by default on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=223061
+
+        Reviewed by Eric Carlson.
+
+        Covered by existing tests.
+
+        * Shared/WebPreferencesDefaultValues.cpp:
+        (WebKit::defaultCaptureVideoInGPUProcessEnabled):
+        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
+        (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
+        We need to synchronously fill the granted requests, otherwise there is a risk that
+        the granted requests will be cleared (on page close for instance) and then later filled
+        for the page that was gone.
+
 2021-03-12  Chris Dumez  <[email protected]>
 
         Unreviewed, fix debug assertion on bots after r274323.

Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp (274369 => 274370)


--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp	2021-03-12 21:33:09 UTC (rev 274369)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp	2021-03-12 21:47:36 UTC (rev 274370)
@@ -205,11 +205,13 @@
 
 bool defaultCaptureVideoInGPUProcessEnabled()
 {
-#if HAVE(SYSTEM_FEATURE_FLAGS)
+#if PLATFORM(IOS)
+    return true;
+#elif HAVE(SYSTEM_FEATURE_FLAGS)
     return isFeatureFlagEnabled("gpu_process_webrtc");
+#else
+    return false;
 #endif
-
-    return false;
 }
 
 #endif // ENABLE(MEDIA_STREAM)

Modified: trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp (274369 => 274370)


--- trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp	2021-03-12 21:33:09 UTC (rev 274369)
+++ trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp	2021-03-12 21:47:36 UTC (rev 274370)
@@ -268,6 +268,8 @@
 void UserMediaPermissionRequestManagerProxy::finishGrantingRequest(UserMediaPermissionRequestProxy& request)
 {
     ALWAYS_LOG(LOGIDENTIFIER, request.userMediaID());
+    updateStoredRequests(request);
+
     if (!UserMediaProcessManager::singleton().willCreateMediaStream(*this, request.hasAudioDevice(), request.hasVideoDevice())) {
         denyRequest(request, UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::OtherFailure, "Unable to extend sandbox.");
         return;
@@ -277,10 +279,6 @@
         if (!weakThis)
             return;
 
-        auto& request = strongRequest.get();
-
-        updateStoredRequests(request);
-
         // FIXME: m_hasFilteredDeviceList will trigger ondevicechange events for various documents from different origins.
         if (m_hasFilteredDeviceList)
             captureDevicesChanged(PermissionInfo::Granted);
@@ -296,6 +294,7 @@
         }
 #endif
 
+        auto& request = strongRequest.get();
         m_page.sendWithAsyncReply(Messages::WebPage::UserMediaAccessWasGranted { request.userMediaID(), request.audioDevice(), request.videoDevice(), request.deviceIdentifierHashSalt(), handle }, [this, weakThis = WTFMove(weakThis)] {
             if (!weakThis)
                 return;

Modified: trunk/Tools/ChangeLog (274369 => 274370)


--- trunk/Tools/ChangeLog	2021-03-12 21:33:09 UTC (rev 274369)
+++ trunk/Tools/ChangeLog	2021-03-12 21:47:36 UTC (rev 274370)
@@ -1,3 +1,14 @@
+2021-03-12  Youenn Fablet  <[email protected]>
+
+        Enable video capture in GPUProcess by default on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=223061
+
+        Reviewed by Eric Carlson.
+
+        * TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm:
+        (-[GetUserMediaRepromptTestView haveStream:]):
+        Upgrade timeout period as GPU process capture might take longer.
+
 2021-03-12  Jonathan Bedard  <[email protected]>
 
         REGRESSION: two webkitscmpy.test.svn_unittest.TestRemoteSvn tests are flaky failures

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm (274369 => 274370)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm	2021-03-12 21:33:09 UTC (rev 274369)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm	2021-03-12 21:47:36 UTC (rev 274370)
@@ -45,7 +45,7 @@
 @implementation GetUserMediaRepromptTestView
 - (BOOL)haveStream:(BOOL)expected
 {
-    int retryCount = 10;
+    int retryCount = 1000;
     while (retryCount--) {
         auto result = [self stringByEvaluatingJavaScript:@"haveStream()"];
         if (result.boolValue == expected)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to