Bug 219021 - Add a default action for SpeechRecognition permission request
Summary: Add a default action for SpeechRecognition permission request
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sihui Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-11-16 21:35 PST by Sihui Liu
Modified: 2020-11-17 13:02 PST (History)
8 users (show)

See Also:


Attachments
Patch (22.92 KB, patch)
2020-11-16 21:48 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch (26.16 KB, patch)
2020-11-17 10:34 PST, Sihui Liu
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (27.43 KB, patch)
2020-11-17 11:02 PST, Sihui Liu
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (27.45 KB, patch)
2020-11-17 11:26 PST, Sihui Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>