...
Created attachment 416561 [details] Patch
Created attachment 416593 [details] Patch
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
Created attachment 416610 [details] Patch for landing
(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
<rdar://problem/72555917>
Committed r271031: <https://trac.webkit.org/changeset/271031> All reviewed patches have been landed. Closing bug and clearing flags on attachment 416610 [details].