Speech JavaScript API: pass WebSecurityOrigin to embedder
Created attachment 141680 [details] Patch
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment on attachment 141680 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=141680&action=review > Source/WebKit/chromium/ChangeLog:10 > + Pass the WebSecurityOrigin of the SpeecReco object to the embedder when calling > + start(). The origin will be used to determine whether speech recognition is > + allowed or not. Why not just ask the embedder whether speech recognition is allowed using http://trac.webkit.org/browser/trunk/Source/WebKit/chromium/public/WebPermissionClient.h ?
> Why not just ask the embedder whether speech recognition is allowed using http://trac.webkit.org/browser/trunk/Source/WebKit/chromium/public/WebPermissionClient.h ? Can WebPermissionClient be used in an asynchronous way? I was looking at how Geolocation does this, and we'd like to do something similar. The idea is that the page would request start() of speech recognition. The embedder would then asynchronously ask for the user's permission. If it's denied, we fire an error event, otherwise we start recognizing. Looking at WebPermissionClient, it seems more suited to static permissions, so I'm not sure it would work here?
Yeah, we've been using WebPermissionClient when we need a synchronous answer. @fishd: Is this patch the right approach for asynchronous permissions?
EXAMPLES 1. Notifications: void WebNotificationPresenter::requestPermission(origin, callback) WebNotificationPresenter* WebViewClient::notificationPresenter() 2. Geolocation: void WebGeolocationClient::requestPermission(request) WebGeolocationClient* WebViewClient::geolocationClient() We don't seem to have a generic async mechanism.
Comment on attachment 141680 [details] Patch Ok. Sounds like this approach is fine then. Thanks.
Comment on attachment 141680 [details] Patch Clearing flags on attachment: 141680 Committed r117251: <http://trac.webkit.org/changeset/117251>
All reviewed patches have been landed. Closing bug.