[Webkit-unassigned] [Bug 41518] Speech input plumbing in webcore and webkit

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 6 16:08:20 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=41518





--- Comment #6 from Satish Sampath <satish at chromium.org>  2010-07-06 16:08:20 PST ---
Thanks for the review comments Steve. I have now removed all non-WebCore files from this patch and made most of the suggested changes. Here are replies for those which are not implemented:

WebCore/page/Page.h:155
 +          void setSpeechInputClient(SpeechInputClient* client) {
m_speechInputClient = client; }

> Is there any reason for the client to be reset, other than for testing
> purposes? If not, I don't think we need this method. The embedder can
> configure their SpeechInputClient to be mocked out without having to
> call into WebCore.

Testing was one of the main reasons, since there was a need to enable the mock SpeechInputClient when a layout test's JS code says so. Was your suggestion to always use the mock SpeechInputClient in LayoutTestController? If not, I am not sure how else the layout test can enable the mock client object without an additional layer of indirection in WebKit.
However, the other reason was the growing number of arguments to the constructor (8 already) and some of the clients passed in as null by majority of the callers. It seemed cleaner to move away from that model as new features get added.

WebCore/page/Page.cpp:133
 +      , m_speechInputClient(0)

> For other services (eg Geolocation, DeviceOrientation), the Page
> owns a FooController object, which holds a weak reference to the
> client, which is owned by the embedder.

The controller model did not look like a good fit here since the speech interface requires 2-way communication between WebKit and WebCore, rather than how Geolocation for e.g. works (WebCore calling WebKit to get current location, the result would be same irrespective of how many ever callers invoke this method in WebCore, and all of them get broadcasted the same new location when the result comes in). Here we have each SpeechInput object getting invoked separately by SpeechInputClient when it has new events and no two SpeechInput objects will receive the same speech recognized result data. Effectively the SpeechInput class is the controller here, though there are multiple instances of it.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list