Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1693)

Unified Diff: content/browser/speech/google_streaming_remote_engine.cc

Issue 10629003: Adding support for the SpeechRecognition.maxAlternatives JS API parameter (Speech CL2.5) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits + rebase Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 34ff8535f1a0e595b70a513c4a1da01b190fe927..b9155d65607d889dea6e117fc3e6889318bf0248 100644
--- a/content/browser/speech/google_streaming_remote_engine.cc
+++ b/content/browser/speech/google_streaming_remote_engine.cc
@@ -35,9 +35,6 @@ using net::URLFetcher;
namespace {
-// TODO(primiano): This shouldn't be a const, rather it should be taken from
-// maxNBest property (which is not yet implemented in WebKit).
-const int kMaxResults = 5;
const char kDownstreamUrl[] = "/down?";
const char kUpstreamUrl[] = "/up?";
const int kAudioPacketIntervalMs = 100;
@@ -322,8 +319,6 @@ GoogleStreamingRemoteEngine::ConnectBothStreams(const FSMEventArgs&) {
std::vector<std::string> downstream_args;
downstream_args.push_back("sky=" + GetWebserviceKey());
downstream_args.push_back("pair=" + request_key);
- downstream_args.push_back("maxresults=" + base::IntToString(kMaxResults));
-
GURL downstream_url(GetWebserviceBaseURL() + std::string(kDownstreamUrl) +
JoinString(downstream_args, '&'));
// TODO(primiano): /////////// Remove this after debug stage. /////////////
@@ -347,9 +342,12 @@ GoogleStreamingRemoteEngine::ConnectBothStreams(const FSMEventArgs&) {
"lang=" + net::EscapeQueryParamValue(GetAcceptedLanguages(), true));
upstream_args.push_back(
config_.filter_profanities ? "pfilter=2" : "pfilter=0");
- upstream_args.push_back("maxresults=" + base::IntToString(kMaxResults));
+ if (config_.max_hypotheses > 0U) {
+ upstream_args.push_back("maxresults=" +
+ base::UintToString(config_.max_hypotheses));
+ }
+ // TODO(primiano) What is this client= parameter? Check with speech team.
upstream_args.push_back("client=myapp.mycompany.com");
- // TODO(primiano): Can we remove this feature sending audio HW information?
if (!config_.hardware_info.empty()) {
upstream_args.push_back(
"xhw=" + net::EscapeQueryParamValue(config_.hardware_info, true));
« no previous file with comments | « content/browser/speech/google_one_shot_remote_engine.cc ('k') | content/browser/speech/input_tag_speech_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698