Speech JavaScript API: SpeechRecognitionAlternative, Result and ResultList
Created attachment 130389 [details] Patch
Created attachment 130589 [details] Patch Rebase and link to spec in the ChangeLog.
Comment on attachment 130589 [details] Patch looks good
Created attachment 130633 [details] Patch Remove FIXME as per offline discussion.
Comment on attachment 130633 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=130633&action=review > Source/WebCore/Modules/speech/SpeechRecognitionAlternative.h:42 > + String transcript() { return m_transcript; } String transcript() -> const String& transcript() const > Source/WebCore/Modules/speech/SpeechRecognitionAlternative.h:43 > + double confidence() { return m_confidence; } double confidence() -> double confidence() const > Source/WebCore/Modules/speech/SpeechRecognitionResult.h:42 > + PassRefPtr<SpeechRecognitionAlternative> item(unsigned long index); Why a PassRefPtr ? We're not transferring ownership. This should return a SpeechRecognitionAlternative*. Please see http://www.webkit.org/coding/RefPtr.html for more information about RefPtr and friends. > Source/WebCore/Modules/speech/SpeechRecognitionResult.idl:31 > + getter SpeechRecognitionAlternative item(in unsigned long index); As I mentioned in the other patch, we don't support the "getter" syntax (yet!). Instead you should use https://trac.webkit.org/wiki/WebKitIDL#IndexedGetter > Source/WebCore/Modules/speech/SpeechRecognitionResultList.h:42 > + PassRefPtr<SpeechRecognitionResult> item(unsigned long index); Same issue here. This should be a SpeechRecognitionResult* > Source/WebCore/Modules/speech/SpeechRecognitionResultList.idl:31 > + getter SpeechRecognitionResult item(in unsigned long index); Same issue with "getter"
Thanks very much for the review! (In reply to comment #5) > (From update of attachment 130633 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=130633&action=review > > > Source/WebCore/Modules/speech/SpeechRecognitionAlternative.h:42 > > + String transcript() { return m_transcript; } > > String transcript() -> const String& transcript() const Done. > > Source/WebCore/Modules/speech/SpeechRecognitionAlternative.h:43 > > + double confidence() { return m_confidence; } > > double confidence() -> double confidence() const Done. > > Source/WebCore/Modules/speech/SpeechRecognitionResult.h:42 > > + PassRefPtr<SpeechRecognitionAlternative> item(unsigned long index); > > Why a PassRefPtr ? We're not transferring ownership. This should return a SpeechRecognitionAlternative*. Please see http://www.webkit.org/coding/RefPtr.html for more information about RefPtr and friends. Done. I was thinking that we're passing ownership to the V8 wrapper object, but I see now that PassRefPtr is not used in this situation. Thanks for catching it. > > Source/WebCore/Modules/speech/SpeechRecognitionResult.idl:31 > > + getter SpeechRecognitionAlternative item(in unsigned long index); > > As I mentioned in the other patch, we don't support the "getter" syntax (yet!). Instead you should use https://trac.webkit.org/wiki/WebKitIDL#IndexedGetter Done. > > Source/WebCore/Modules/speech/SpeechRecognitionResultList.h:42 > > + PassRefPtr<SpeechRecognitionResult> item(unsigned long index); > > Same issue here. This should be a SpeechRecognitionResult* Done. > > Source/WebCore/Modules/speech/SpeechRecognitionResultList.idl:31 > > + getter SpeechRecognitionResult item(in unsigned long index); > > Same issue with "getter" Done.
Committed r110160: <http://trac.webkit.org/changeset/110160>