RESOLVED FIXED Bug 220436
Make SpeechRecognition permission error more informative
https://bugs.webkit.org/show_bug.cgi?id=220436
Summary Make SpeechRecognition permission error more informative
Sihui Liu
Reported 2021-01-07 14:19:08 PST
...
Attachments
Patch (23.33 KB, patch)
2021-01-07 14:25 PST, Sihui Liu
no flags
Patch for landing (23.88 KB, patch)
2021-01-11 13:52 PST, Sihui Liu
no flags
Sihui Liu
Comment 1 2021-01-07 14:25:21 PST
youenn fablet
Comment 2 2021-01-08 00:29:06 PST
Comment on attachment 417211 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=417211&action=review > Source/WebKit/ChangeLog:9 > + boolean value. For debug purposes, it might be good to add release logging for each error case so that we get the information in sysdiagnose. > Source/WebKit/UIProcess/SpeechRecognitionPermissionManager.cpp:78 > +void SpeechRecognitionPermissionManager::request(const String& lang, const WebCore::ClientOrigin& origin, CompletionHandler<void(Optional<WebCore::SpeechRecognitionError>)>&& completiontHandler) Optional<WebCore::SpeechRecognitionError>&& here and elsewhere > Source/WebKit/UIProcess/SpeechRecognitionPermissionManager.cpp:110 > m_speechRecognitionServiceCheck = CheckResult::Granted; We do not need to compute m_microphoneCheck and m_speechRecognitionServiceCheck if mockCaptureDevicesEnabled is true. We could write it as: if (mockCaptureDevicesEnabled) { m_microphoneCheck = CheckResult::Granted; ... } else { m_microphoneCheck = computeMicrophoneAccess(); if (m_microphoneCheck == CheckResult::Denied) { ... return; } ... } > Source/WebKit/UIProcess/SpeechRecognitionPermissionManager.cpp:124 > if (!mockCaptureDevicesEnabled && m_speechRecognitionServiceCheck != CheckResult::Denied) { We no longer need m_speechRecognitionServiceCheck != CheckResult::Denied > Source/WebKit/UIProcess/SpeechRecognitionServer.cpp:77 > sendUpdate(identifier, WebCore::SpeechRecognitionUpdateType::Error, error); WTFMove(error) > Source/WebKit/UIProcess/SpeechRecognitionServer.h:48 > +using SpeechRecognitionPermissionChecker = Function<void(const String&, const WebCore::ClientOrigin&, CompletionHandler<void(Optional<WebCore::SpeechRecognitionError>)>&&)>; Optional<WebCore::SpeechRecognitionError>&&
Sihui Liu
Comment 3 2021-01-11 13:52:47 PST
Created attachment 417409 [details] Patch for landing
EWS
Comment 4 2021-01-11 14:29:27 PST
Committed r271381: <https://trac.webkit.org/changeset/271381> All reviewed patches have been landed. Closing bug and clearing flags on attachment 417409 [details].
Radar WebKit Bug Importer
Comment 5 2021-01-11 14:30:15 PST
Note You need to log in before you can comment on or make changes to this bug.