Bug 219021

Summary: Add a default action for SpeechRecognition permission request
Product: WebKit Reporter: Sihui Liu <sihui_liu>
Component: WebCore Misc.Assignee: 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   
See Also: https://bugs.webkit.org/show_bug.cgi?id=219891
Attachments:
Description Flags
Patch
none
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch none

Description Sihui Liu 2020-11-16 21:35:41 PST
...
Comment 1 Sihui Liu 2020-11-16 21:48:40 PST
Created attachment 414306 [details]
Patch
Comment 2 youenn fablet 2020-11-17 09:34:02 PST
Comment on attachment 414306 [details]
Patch

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

> Source/WebKit/UIProcess/Cocoa/UserMediaPermissionRequestProxy.mm:29
>  #if ENABLE(MEDIA_STREAM)

UserMediaPermissionRequestProxy.mm can probably be removed if we move the alter code in MediaPermissionUtilities.mm.

> Source/WebKit/UIProcess/MediaPermissionUtilities.h:77
> +template<> struct EnumTraits<WebKit::MediaPermissionType> {

Do we need to send this over IPC?

> Source/WebKit/UIProcess/WebPageProxy.cpp:10251
> +void WebPageProxy::decidePolicyForSpeechRecognitionPermission(const WebCore::SecurityOrigin& origin, CompletionHandler<void(bool)>&& completionHandler)

Maybe the name could be more descriptive here. I don't have a good name though.
Comment 3 Sihui Liu 2020-11-17 09:58:43 PST
(In reply to youenn fablet from comment #2)
> Comment on attachment 414306 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=414306&action=review
> 
> > Source/WebKit/UIProcess/Cocoa/UserMediaPermissionRequestProxy.mm:29
> >  #if ENABLE(MEDIA_STREAM)
> 
> UserMediaPermissionRequestProxy.mm can probably be removed if we move the
> alter code in MediaPermissionUtilities.mm.

Yes, will try removing it.

> 
> > Source/WebKit/UIProcess/MediaPermissionUtilities.h:77
> > +template<> struct EnumTraits<WebKit::MediaPermissionType> {
> 
> Do we need to send this over IPC?

Nope, will remove.

> 
> > Source/WebKit/UIProcess/WebPageProxy.cpp:10251
> > +void WebPageProxy::decidePolicyForSpeechRecognitionPermission(const WebCore::SecurityOrigin& origin, CompletionHandler<void(bool)>&& completionHandler)
> 
> Maybe the name could be more descriptive here. I don't have a good name
> though.

hmm, will change to requestSpeechRecognitionPermissionByDefaultAction.
Comment 4 Sihui Liu 2020-11-17 10:34:47 PST
Created attachment 414352 [details]
Patch
Comment 5 Sihui Liu 2020-11-17 11:02:11 PST
Created attachment 414354 [details]
Patch
Comment 6 Sihui Liu 2020-11-17 11:26:55 PST
Created attachment 414356 [details]
Patch
Comment 7 EWS 2020-11-17 13:01:09 PST
Committed r269918: <https://trac.webkit.org/changeset/269918>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 414356 [details].
Comment 8 Radar WebKit Bug Importer 2020-11-17 13:02:18 PST
<rdar://problem/71499713>