Changeset 272735 in webkit


Ignore:
Timestamp:
Feb 11, 2021 9:30:34 AM (17 months ago)
Author:
youenn@apple.com
Message:

[MacOS] Enable Audio Capture in GPUProcess by default
https://bugs.webkit.org/show_bug.cgi?id=221400

Reviewed by Eric Carlson.

Source/WebKit:

Covered by existing API tests, in particular TestWebKitAPI.WebKit.OnDeviceChangeCrash.

  • WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:

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.

  • Shared/WebPreferencesDefaultValues.cpp:

(WebKit::defaultCaptureAudioInGPUProcessEnabled):

Tools:

  • TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm:

(-[GetUserMediaRepromptTestView haveStream:]):
Increase timeout since capture might require spinning GPUProcess.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r272731 r272735  
     12021-02-11  Youenn Fablet  <youenn@apple.com>
     2
     3        [MacOS] Enable Audio Capture in GPUProcess by default
     4        https://bugs.webkit.org/show_bug.cgi?id=221400
     5
     6        Reviewed by Eric Carlson.
     7
     8        Covered by existing API tests, in particular TestWebKitAPI.WebKit.OnDeviceChangeCrash.
     9
     10        * WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
     11        We need to synchronously fill the granted requests, otherwise there is a risk that
     12        the granted requests will be cleared (on page close for instance) and then later filled
     13        for the page that was gone.
     14        * Shared/WebPreferencesDefaultValues.cpp:
     15        (WebKit::defaultCaptureAudioInGPUProcessEnabled):
     16
    1172021-02-11  Sam Weinig  <weinig@apple.com>
    218
  • trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp

    r272686 r272735  
    184184bool defaultCaptureAudioInGPUProcessEnabled()
    185185{
    186 #if HAVE(SYSTEM_FEATURE_FLAGS)
    187 #if PLATFORM(MAC)
    188     return isFeatureFlagEnabled("gpu_process_webrtc");
    189 #elif PLATFORM(IOS_FAMILY)
     186#if PLATFORM(MAC)
     187    return true;
     188#elif HAVE(SYSTEM_FEATURE_FLAGS)
    190189    return isFeatureFlagEnabled("gpu_process_media");
    191 #endif
    192 #endif
    193 
    194     return false;
     190#else
     191    return false;
     192#endif
    195193}
    196194
  • trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp

    r272434 r272735  
    240240    ALWAYS_LOG(LOGIDENTIFIER, request.userMediaID(), ", video: ", request.videoDevice().label(), ", audio: ", request.audioDevice().label());
    241241
     242    if (request.requestType() == MediaStreamRequest::Type::UserMedia)
     243        m_grantedRequests.append(makeRef(request));
     244
    242245    if (auto callback = request.decisionCompletionHandler()) {
    243246        m_page.willStartCapture(request, [callback = WTFMove(callback)]() mutable {
    244247            callback(true);
    245248        });
    246         m_grantedRequests.append(makeRef(request));
    247249        return;
    248250    }
     
    272274        if (!weakThis)
    273275            return;
    274 
    275         auto& request = strongRequest.get();
    276 
    277         if (request.requestType() == MediaStreamRequest::Type::UserMedia)
    278             m_grantedRequests.append(makeRef(request));
    279276
    280277        // FIXME: m_hasFilteredDeviceList will trigger ondevicechange events for various documents from different origins.
     
    293290#endif
    294291
     292        auto& request = strongRequest.get();
    295293        m_page.sendWithAsyncReply(Messages::WebPage::UserMediaAccessWasGranted { request.userMediaID(), request.audioDevice(), request.videoDevice(), request.deviceIdentifierHashSalt(), handle }, [this, weakThis = WTFMove(weakThis)] {
    296294            if (!weakThis)
  • trunk/Tools/ChangeLog

    r272733 r272735  
     12021-02-11  Youenn Fablet  <youenn@apple.com>
     2
     3        [MacOS] Enable Audio Capture in GPUProcess by default
     4        https://bugs.webkit.org/show_bug.cgi?id=221400
     5
     6        Reviewed by Eric Carlson.
     7
     8        * TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm:
     9        (-[GetUserMediaRepromptTestView haveStream:]):
     10        Increase timeout since capture might require spinning GPUProcess.
     11
    1122021-02-11  Lauro Moura  <lmoura@igalia.com>
    213
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm

    r272686 r272735  
    8686- (BOOL)haveStream:(BOOL)expected
    8787{
    88     int retryCount = 10;
     88    int retryCount = 1000;
    8989    while (retryCount--) {
    9090        auto result = [self stringByEvaluatingJavaScript:@"haveStream()"];
Note: See TracChangeset for help on using the changeset viewer.