Index: content/browser/speech/google_streaming_remote_engine.cc |
diff --git a/content/browser/speech/google_streaming_remote_engine.cc b/content/browser/speech/google_streaming_remote_engine.cc |
index 974118f26ddcbe6545f9f91578b51b36a4101e8b..2ababe56d8bb7e9d66dcc322a412d87c17d5e048 100644 |
--- a/content/browser/speech/google_streaming_remote_engine.cc |
+++ b/content/browser/speech/google_streaming_remote_engine.cc |
@@ -436,9 +436,11 @@ GoogleStreamingRemoteEngine::ProcessDownstreamResponse( |
} |
} |
+ SpeechRecognitionResults results; |
for (int i = 0; i < ws_event.result_size(); ++i) { |
const proto::SpeechRecognitionResult& ws_result = ws_event.result(i); |
- SpeechRecognitionResult result; |
+ results.push_back(SpeechRecognitionResult()); |
+ SpeechRecognitionResult& result = results.back(); |
result.is_provisional = !(ws_result.has_final() && ws_result.final()); |
if (!result.is_provisional) |
@@ -459,10 +461,10 @@ GoogleStreamingRemoteEngine::ProcessDownstreamResponse( |
result.hypotheses.push_back(hypothesis); |
} |
- |
- delegate()->OnSpeechRecognitionEngineResult(result); |
} |
+ delegate()->OnSpeechRecognitionEngineResults(results); |
+ |
return state_; |
} |
@@ -472,7 +474,7 @@ GoogleStreamingRemoteEngine::RaiseNoMatchErrorIfGotNoResults( |
if (!got_last_definitive_result_) { |
// Provide an empty result to notify that recognition is ended with no |
// errors, yet neither any further results. |
- delegate()->OnSpeechRecognitionEngineResult(SpeechRecognitionResult()); |
+ delegate()->OnSpeechRecognitionEngineResults(SpeechRecognitionResults()); |
} |
return AbortSilently(event_args); |
} |