WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
220033
Check availability of speech recognition service before requesting permissions
https://bugs.webkit.org/show_bug.cgi?id=220033
Summary
Check availability of speech recognition service before requesting permissions
Sihui Liu
Reported
2020-12-18 17:24:11 PST
...
Attachments
Patch
(15.58 KB, patch)
2020-12-18 17:33 PST
,
Sihui Liu
no flags
Details
Formatted Diff
Diff
Patch
(15.61 KB, patch)
2020-12-20 17:44 PST
,
Sihui Liu
no flags
Details
Formatted Diff
Diff
Patch for landing
(16.58 KB, patch)
2020-12-21 10:57 PST
,
Sihui Liu
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Sihui Liu
Comment 1
2020-12-18 17:33:21 PST
Created
attachment 416561
[details]
Patch
Sihui Liu
Comment 2
2020-12-20 17:44:48 PST
Created
attachment 416593
[details]
Patch
youenn fablet
Comment 3
2020-12-21 09:20:03 PST
Comment on
attachment 416593
[details]
Patch LGTM. I am unsure whether we can bypass the speech service TCC prompt to get a valid isAvailable check. Did you test that manually? View in context:
https://bugs.webkit.org/attachment.cgi?id=416593&action=review
> Source/WebKit/UIProcess/Cocoa/MediaPermissionUtilities.mm:267 > + return recognizer && [recognizer isAvailable];
Is it ok to try creating allocSFSpeechRecognizerInstance and do we get a valid isAvailable result when the TCC prompt is unknown?
> Source/WebKit/UIProcess/SpeechRecognitionPermissionManager.cpp:110 > + m_speechRecognitionServiceCheck = m_microphoneCheck = CheckResult::Denied;
Can we just do: if (!checkSpeechRecognitionServiceAvailability(m_requests.first()->lang())) { completeCurrentRequest(SpeechRecognitionPermissionDecision::Deny); return; }
> Source/WebKit/UIProcess/SpeechRecognitionServer.cpp:66 > + m_permissionChecker(request.lang(), request.clientOrigin(), [this, weakThis = makeWeakPtr(this), weakRequest = makeWeakPtr(request)](SpeechRecognitionPermissionDecision decision) mutable {
auto decision
> Source/WebKit/UIProcess/WebProcessProxy.cpp:1725 > + auto permissionChecker = [weakPage = makeWeakPtr(targetPage)](auto lang, auto& origin, auto&& completionHandler) mutable {
auto& lang
Sihui Liu
Comment 4
2020-12-21 10:57:14 PST
Created
attachment 416610
[details]
Patch for landing
Sihui Liu
Comment 5
2020-12-21 10:58:53 PST
(In reply to youenn fablet from
comment #3
)
> Comment on
attachment 416593
[details]
> Patch > > LGTM. > I am unsure whether we can bypass the speech service TCC prompt to get a > valid isAvailable check. > Did you test that manually?
Yes, I tested on a newly built MiniBrowser (no permission granted yet), and it did not crash or error when checking the availability.
> > View in context: >
https://bugs.webkit.org/attachment.cgi?id=416593&action=review
> > > Source/WebKit/UIProcess/Cocoa/MediaPermissionUtilities.mm:267 > > + return recognizer && [recognizer isAvailable]; > > Is it ok to try creating allocSFSpeechRecognizerInstance and do we get a > valid isAvailable result when the TCC prompt is unknown? > > > Source/WebKit/UIProcess/SpeechRecognitionPermissionManager.cpp:110 > > + m_speechRecognitionServiceCheck = m_microphoneCheck = CheckResult::Denied; > > Can we just do: > if (!checkSpeechRecognitionServiceAvailability(m_requests.first()->lang())) { > completeCurrentRequest(SpeechRecognitionPermissionDecision::Deny); > return; > } > > > Source/WebKit/UIProcess/SpeechRecognitionServer.cpp:66 > > + m_permissionChecker(request.lang(), request.clientOrigin(), [this, weakThis = makeWeakPtr(this), weakRequest = makeWeakPtr(request)](SpeechRecognitionPermissionDecision decision) mutable { > > auto decision > > > Source/WebKit/UIProcess/WebProcessProxy.cpp:1725 > > + auto permissionChecker = [weakPage = makeWeakPtr(targetPage)](auto lang, auto& origin, auto&& completionHandler) mutable { > > auto& lang
Radar WebKit Bug Importer
Comment 6
2020-12-21 11:05:34 PST
<
rdar://problem/72555917
>
EWS
Comment 7
2020-12-21 11:35:49 PST
Committed
r271031
: <
https://trac.webkit.org/changeset/271031
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 416610
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug