Bug 220133

Summary: Fail speech recognition when page is muted for audio capture
Product: WebKit Reporter: Sihui Liu <sihui_liu>
Component: New BugsAssignee: Sihui Liu <sihui_liu>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, ews-watchlist, glenn, jer.noble, philipj, sergio, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch for landing none

Description Sihui Liu 2020-12-23 16:41:55 PST
...
Comment 1 Sihui Liu 2020-12-23 16:49:36 PST
Created attachment 416734 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2020-12-30 16:42:12 PST
<rdar://problem/72745232>
Comment 3 Sihui Liu 2021-01-04 22:58:37 PST
Created attachment 416973 [details]
Patch
Comment 4 Sihui Liu 2021-01-05 00:08:43 PST
Created attachment 416975 [details]
Patch
Comment 5 youenn fablet 2021-01-05 02:08:06 PST
Comment on attachment 416975 [details]
Patch

Looks good overall.
Some style improvements below.

View in context: https://bugs.webkit.org/attachment.cgi?id=416975&action=review

> Source/WebKit/ChangeLog:11
> +        1. when page is muted, mute audio capture source used for speech recognition audion on the page. This will

s/audion/audio/

> Source/WebKit/UIProcess/UserMediaProcessManager.cpp:73
> +    }

I am not sure we need to create a HashSet here.
We could either add a SpeechRecognitionPermissionManager::muteCaptureExceptIn(WebPageProxy&) or rely on WebProcessProxy::globalPageMap() and remove UserMediaProcessManager::muteCaptureMediaStreamsExceptIn

> Source/WebKit/UIProcess/WebProcessProxy.cpp:1779
> +    speechRecognitionServer->mute();

I would write it as if (auto ...)
Comment 6 Sihui Liu 2021-01-05 09:37:29 PST
(In reply to youenn fablet from comment #5)
> Comment on attachment 416975 [details]
> Patch
> 
> Looks good overall.
> Some style improvements below.

Thanks for review!

> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=416975&action=review
> 
> > Source/WebKit/ChangeLog:11
> > +        1. when page is muted, mute audio capture source used for speech recognition audion on the page. This will
> 
> s/audion/audio/
> 
> > Source/WebKit/UIProcess/UserMediaProcessManager.cpp:73
> > +    }
> 
> I am not sure we need to create a HashSet here.
> We could either add a
> SpeechRecognitionPermissionManager::muteCaptureExceptIn(WebPageProxy&) or
> rely on WebProcessProxy::globalPageMap() and remove
> UserMediaProcessManager::muteCaptureMediaStreamsExceptIn

Okay, removing UserMediaProcessManager::muteCaptureMediaStreamsExceptIn and add it in WebProcessProxy.

> 
> > Source/WebKit/UIProcess/WebProcessProxy.cpp:1779
> > +    speechRecognitionServer->mute();
> 
> I would write it as if (auto ...)
Comment 7 Sihui Liu 2021-01-05 09:45:12 PST
Created attachment 417013 [details]
Patch for landing
Comment 8 EWS 2021-01-05 10:16:29 PST
Committed r271154: <https://trac.webkit.org/changeset/271154>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 417013 [details].