Chromium Code Reviews| Index: Source/web/SpeechRecognitionClientProxy.cpp |
| diff --git a/Source/web/SpeechRecognitionClientProxy.cpp b/Source/web/SpeechRecognitionClientProxy.cpp |
| index 479f15d5ed6cbc5bad804618516c0547c1a9c980..d8c11e0f324904cbccc1add8150c6d3d2ad2b928 100644 |
| --- a/Source/web/SpeechRecognitionClientProxy.cpp |
| +++ b/Source/web/SpeechRecognitionClientProxy.cpp |
| @@ -33,6 +33,7 @@ |
| #include "modules/speech/SpeechRecognitionResult.h" |
| #include "modules/speech/SpeechRecognitionResultList.h" |
| #include "platform/weborigin/SecurityOrigin.h" |
| +#include "public/platform/WebMediaStreamTrack.h" |
| #include "public/web/WebSecurityOrigin.h" |
| #include "public/web/WebSpeechGrammar.h" |
| #include "public/web/WebSpeechRecognitionHandle.h" |
| @@ -52,14 +53,17 @@ PassOwnPtr<SpeechRecognitionClientProxy> SpeechRecognitionClientProxy::create(We |
| return adoptPtr(new SpeechRecognitionClientProxy(recognizer)); |
| } |
| -void SpeechRecognitionClientProxy::start(SpeechRecognition* recognition, const SpeechGrammarList* grammarList, const String& lang, bool continuous, bool interimResults, unsigned long maxAlternatives) |
| +void SpeechRecognitionClientProxy::start(SpeechRecognition* recognition, const SpeechGrammarList* grammarList, const String& lang, bool continuous, bool interimResults, unsigned long maxAlternatives, MediaStreamTrack* audioTrack) |
| { |
| WebVector<WebSpeechGrammar> webSpeechGrammars(static_cast<size_t>(grammarList->length())); |
| for (unsigned long i = 0; i < grammarList->length(); ++i) |
| webSpeechGrammars[i] = grammarList->item(i); |
| WebSpeechRecognitionParams params(webSpeechGrammars, lang, continuous, interimResults, maxAlternatives, WebSecurityOrigin(recognition->executionContext()->securityOrigin())); |
| - m_recognizer->start(WebSpeechRecognitionHandle(recognition), params, this); |
| + if (audioTrack) |
| + m_recognizer->start(WebSpeechRecognitionHandle(recognition), params, audioTrack->component(), this); |
|
Mike West
2014/09/17 10:20:27
Could the new MediaStreamComponent argument instea
burnik
2014/09/17 11:17:20
Good point as well. Although that would require mo
Mike West
2014/09/17 11:30:46
Sure. But I think it reduces the complexity of the
|
| + else |
| + m_recognizer->start(WebSpeechRecognitionHandle(recognition), params, this); |
| } |
| void SpeechRecognitionClientProxy::stop(SpeechRecognition* recognition) |