Bug 86348 - Speech JavaScript API: pass WebSecurityOrigin to embedder
Summary: Speech JavaScript API: pass WebSecurityOrigin to embedder
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Hans Wennborg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-14 03:22 PDT by Hans Wennborg
Modified: 2012-05-16 03:24 PDT (History)
8 users (show)

See Also:


Attachments
Patch (4.08 KB, patch)
2012-05-14 03:29 PDT, Hans Wennborg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Wennborg 2012-05-14 03:22:39 PDT
Speech JavaScript API: pass WebSecurityOrigin to embedder
Comment 1 Hans Wennborg 2012-05-14 03:29:15 PDT
Created attachment 141680 [details]
Patch
Comment 2 WebKit Review Bot 2012-05-14 03:32:22 PDT
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 3 Adam Barth 2012-05-14 11:00:01 PDT
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 ?
Comment 4 Hans Wennborg 2012-05-15 04:02:15 PDT
> 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?
Comment 5 Adam Barth 2012-05-15 11:09:10 PDT
Yeah, we've been using WebPermissionClient when we need a synchronous answer.

@fishd: Is this patch the right approach for asynchronous permissions?
Comment 6 Darin Fisher (:fishd, Google) 2012-05-15 14:01:24 PDT
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 7 Adam Barth 2012-05-15 14:09:12 PDT
Comment on attachment 141680 [details]
Patch

Ok.  Sounds like this approach is fine then.  Thanks.
Comment 8 WebKit Review Bot 2012-05-16 03:24:08 PDT
Comment on attachment 141680 [details]
Patch

Clearing flags on attachment: 141680

Committed r117251: <http://trac.webkit.org/changeset/117251>
Comment 9 WebKit Review Bot 2012-05-16 03:24:13 PDT
All reviewed patches have been landed.  Closing bug.