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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 20 22:11:59 PST 2013


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





--- Comment #1 from Adam Barth <abarth at webkit.org>  2013-01-20 22:13:50 PST ---
> See https://bugs.webkit.org/show_bug.cgi?id=107382 for discussion; the idea is to move platform-specific code to the platform directory.
> 
> Questions:
> * Is it okay to have a method defined in a header file, but have the method implemented differently in different platform source files, without subclassing?

Yes.  This is a common pattern we use to avoid introducing unnecessary virtual functions.

> * If not, is there a preferred style for factory classes?

N/A

> * What's a good example of a module that implements the cross-platform abstraction correctly, in terms of code style? Ideally, pick something that's NOT a core WebCore feature (i.e. some platforms might disable it) because core features tend to be much more complicated or have other requirements.

Sam might have some ideas here, but each feature has its own quirks, and I'm not sure off-hand of one that's a particularly good showpiece.  One that we've done relatively recently is MEDIA_STREAM.  Unfortunately, there aren't really non-Chromium implementations of MEDIA_STREAM, and that feature is likely slightly different from what you want because so much of the "guts" is in the WebRTC library.

WEB_AUDIO might be a good example.  I'm pretty sure I know what Sam has in mind, and I'm happy to help by reviewing patches.  Perhaps we can make SpeechSynthesis a good example for others to follow.

> Finally, could we either document the best practices somewhere, or file bugs to refactor all of the modules that violate this rule? As it is, WebCore has several examples of both approaches so there's no way for a contributor to know that one style is preferred.

I would like to clean up all the features to use a consistent approach, but it's a big unsexy project and I haven't managed to convince anyone to do it (yet).  :)

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