summaryrefslogtreecommitdiffstats
path: root/content/browser/speech/google_streaming_remote_engine.cc
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-01 18:10:13 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-01 18:10:13 +0000
commitc0cd97078bcc108053e1a5906e72478511ded3ec (patch)
treed470d69eb2e05ce6ae80532046d8b6107ce0e232 /content/browser/speech/google_streaming_remote_engine.cc
parent5b819ee7638bfc85f6b7700dcb6977b6fcf4bee7 (diff)
downloadchromium_src-c0cd97078bcc108053e1a5906e72478511ded3ec.zip
chromium_src-c0cd97078bcc108053e1a5906e72478511ded3ec.tar.gz
chromium_src-c0cd97078bcc108053e1a5906e72478511ded3ec.tar.bz2
Update the Speech Api to support array(s) of result items
instead of a single item at a time. BUG=143124 TEST=Covered by content_unittests Review URL: https://chromiumcodereview.appspot.com/11421103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170668 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/speech/google_streaming_remote_engine.cc')
-rw-r--r--content/browser/speech/google_streaming_remote_engine.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/content/browser/speech/google_streaming_remote_engine.cc b/content/browser/speech/google_streaming_remote_engine.cc
index 974118f..2ababe5 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);
}