[Webkit-unassigned] [Bug 107414] Refactor platform-specific code in SpeechSynthesis

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 20 22:17:42 PST 2013


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





--- Comment #2 from Adam Barth <abarth at webkit.org>  2013-01-20 22:19:32 PST ---
The general approach is that SpeechSynthesis.cpp in Source/WebCore/Modules/speech/SpeedSynthesis.cpp should be implemented in terms of a PlatformSpeechSynthesis.h header from Source/WebCore/platform/PlatformSpeechSynthesis.h.  We'd then have two cpp files that implement the PlatformSpeechSynthesis.h interface, SpeechSynthesisChromium.cpp and SpeechSynthesisMac.cpp (in the appropriate folder).

SpeechSynthesisChromium.cpp would implement the PlatformSpeechSynthesis API in terms of the Chromium WebKit API (i.e., in terms of an API we define in Source/Platform/chromium/public).  SpeechSynthesisMac.cpp would implement the PlatformSpeechSynthesis API in terms of Mac OS X APIs.  (Other ports could implement the PlatformSpeechSynthesis API in terms of facilities available on their platform.)

The idea behind this approach is that SpeechSynthesis.cpp should be in charge of the "webby" parts of the feature whereas PlatformSpeechSynthesis should be a simple abstraction over the multitude of libraries that you could use to implement the web feature.  I can be tricky to design a PlatformSpeechSynthesis that works for many platforms, but we try to do our best with the examples we have.

In general, I would recommend making the Chromium Platform API similar to the PlatformSpeechSynthesis API to make it as easy as possible to implement the latter in terms of the former.  I suspect we'll have less flexibility in the design of the Mac OS X API, so that often drives the design of the platform abstraction somewhat.

-- 
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