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

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

Issue 10233010: Introducing new data types and IPC messages for scripted JS speech recognition APIs (Speech CL2.0) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added CONTENT_EXPORT to SpeechRecognitionEngine::Config Created 8 years, 7 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_one_shot_remote_engine.cc
diff --git a/content/browser/speech/google_one_shot_remote_engine.cc b/content/browser/speech/google_one_shot_remote_engine.cc
index 2007d4bd717833dae956aa28107d9b5d41bb321b..7d7b237b1e94a1ed236a23558159be3a7bd8865b 100644
--- a/content/browser/speech/google_one_shot_remote_engine.cc
+++ b/content/browser/speech/google_one_shot_remote_engine.cc
@@ -35,8 +35,6 @@ const char* const kConfidenceString = "confidence";
const int kWebServiceStatusNoError = 0;
const int kWebServiceStatusNoSpeech = 4;
const int kWebServiceStatusNoMatch = 5;
-const int kDefaultConfigSampleRate = 8000;
-const int kDefaultConfigBitsPerSample = 16;
const speech::AudioEncoder::Codec kDefaultAudioCodec =
speech::AudioEncoder::CODEC_FLAC;
// TODO(satish): Remove this hardcoded value once the page is allowed to
@@ -156,14 +154,6 @@ namespace speech {
const int GoogleOneShotRemoteEngine::kAudioPacketIntervalMs = 100;
int GoogleOneShotRemoteEngine::url_fetcher_id_for_tests = 0;
-GoogleOneShotRemoteEngineConfig::GoogleOneShotRemoteEngineConfig()
- : filter_profanities(false),
- audio_sample_rate(kDefaultConfigSampleRate),
- audio_num_bits_per_sample(kDefaultConfigBitsPerSample) {
-}
-
-GoogleOneShotRemoteEngineConfig::~GoogleOneShotRemoteEngineConfig() {}
-
GoogleOneShotRemoteEngine::GoogleOneShotRemoteEngine(
net::URLRequestContextGetter* context)
: url_context_(context) {
@@ -172,7 +162,7 @@ GoogleOneShotRemoteEngine::GoogleOneShotRemoteEngine(
GoogleOneShotRemoteEngine::~GoogleOneShotRemoteEngine() {}
void GoogleOneShotRemoteEngine::SetConfig(
- const GoogleOneShotRemoteEngineConfig& config) {
+ const SpeechRecognitionEngineConfig& config) {
config_ = config;
}
@@ -199,8 +189,11 @@ void GoogleOneShotRemoteEngine::StartRecognition() {
std::vector<std::string> parts;
parts.push_back("lang=" + net::EscapeQueryParamValue(lang_param, true));
- if (!config_.grammar.empty())
- parts.push_back("lm=" + net::EscapeQueryParamValue(config_.grammar, true));
+ if (!config_.grammars.empty()) {
+ DCHECK_EQ(config_.grammars.size(), 1U);
+ parts.push_back("lm=" + net::EscapeQueryParamValue(config_.grammars[0].url,
+ true));
+ }
if (!config_.hardware_info.empty())
parts.push_back("xhw=" + net::EscapeQueryParamValue(config_.hardware_info,
« no previous file with comments | « content/browser/speech/google_one_shot_remote_engine.h ('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