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

Side by Side Diff: content/browser/speech/speech_recognition_engine.cc

Issue 1892483002: Drop support for uploading hardware info with speech recognition requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@devirtualize_speechrecognitionengine
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/speech/speech_recognition_engine.h" 5 #include "content/browser/speech/speech_recognition_engine.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/big_endian.h" 10 #include "base/big_endian.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 "lang=" + net::EscapeQueryParamValue(GetAcceptedLanguages(), true)); 355 "lang=" + net::EscapeQueryParamValue(GetAcceptedLanguages(), true));
356 upstream_args.push_back( 356 upstream_args.push_back(
357 config_.filter_profanities ? "pFilter=2" : "pFilter=0"); 357 config_.filter_profanities ? "pFilter=2" : "pFilter=0");
358 if (config_.max_hypotheses > 0U) { 358 if (config_.max_hypotheses > 0U) {
359 uint32_t max_alternatives = 359 uint32_t max_alternatives =
360 std::min(kMaxMaxAlternatives, config_.max_hypotheses); 360 std::min(kMaxMaxAlternatives, config_.max_hypotheses);
361 upstream_args.push_back("maxAlternatives=" + 361 upstream_args.push_back("maxAlternatives=" +
362 base::UintToString(max_alternatives)); 362 base::UintToString(max_alternatives));
363 } 363 }
364 upstream_args.push_back("app=chromium"); 364 upstream_args.push_back("app=chromium");
365 if (!config_.hardware_info.empty()) {
366 upstream_args.push_back(
367 "xhw=" + net::EscapeQueryParamValue(config_.hardware_info, true));
368 }
369 for (const SpeechRecognitionGrammar& grammar : config_.grammars) { 365 for (const SpeechRecognitionGrammar& grammar : config_.grammars) {
370 std::string grammar_value( 366 std::string grammar_value(
371 base::DoubleToString(grammar.weight) + ":" + grammar.url); 367 base::DoubleToString(grammar.weight) + ":" + grammar.url);
372 upstream_args.push_back( 368 upstream_args.push_back(
373 "grammar=" + net::EscapeQueryParamValue(grammar_value, true)); 369 "grammar=" + net::EscapeQueryParamValue(grammar_value, true));
374 } 370 }
375 if (config_.continuous) 371 if (config_.continuous)
376 upstream_args.push_back("continuous"); 372 upstream_args.push_back("continuous");
377 else 373 else
378 upstream_args.push_back("endpoint=1"); 374 upstream_args.push_back("endpoint=1");
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 } 642 }
647 643
648 SpeechRecognitionEngine::FSMEventArgs::FSMEventArgs(FSMEvent event_value) 644 SpeechRecognitionEngine::FSMEventArgs::FSMEventArgs(FSMEvent event_value)
649 : event(event_value) { 645 : event(event_value) {
650 } 646 }
651 647
652 SpeechRecognitionEngine::FSMEventArgs::~FSMEventArgs() { 648 SpeechRecognitionEngine::FSMEventArgs::~FSMEventArgs() {
653 } 649 }
654 650
655 } // namespace content 651 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/speech/speech_recognition_engine.h ('k') | content/browser/speech/speech_recognition_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698