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

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

Issue 9568002: Renamed speech input implementation from to speech_recognition_*. The namespace has been renamed fr… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebased from master. Created 8 years, 9 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/speech_recognizer_impl.cc
diff --git a/content/browser/speech/speech_recognizer_impl.cc b/content/browser/speech/speech_recognizer_impl.cc
index 9d4ed1c694f6b9cf08f289c55f63c8ddb10dae53..bbcfbd2fb10515e8589a6c2b24389b6f6006593b 100644
--- a/content/browser/speech/speech_recognizer_impl.cc
+++ b/content/browser/speech/speech_recognizer_impl.cc
@@ -9,7 +9,7 @@
#include "content/browser/browser_main_loop.h"
#include "content/public/browser/speech_recognizer_delegate.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/common/speech_input_result.h"
+#include "content/public/common/speech_recognition_result.h"
#include "net/url_request/url_request_context_getter.h"
using content::BrowserMainLoop;
@@ -61,12 +61,12 @@ SpeechRecognizer* SpeechRecognizer::Create(
bool filter_profanities,
const std::string& hardware_info,
const std::string& origin_url) {
- return new speech_input::SpeechRecognizerImpl(
+ return new speech::SpeechRecognizerImpl(
delegate, caller_id, language, grammar, context_getter,
filter_profanities, hardware_info, origin_url);
}
-namespace speech_input {
+namespace speech {
const int SpeechRecognizerImpl::kAudioSampleRate = 16000;
const int SpeechRecognizerImpl::kAudioPacketIntervalMs = 100;
@@ -208,7 +208,7 @@ void SpeechRecognizerImpl::HandleOnError(int error_code) {
if (!audio_controller_.get())
return;
- InformErrorAndCancelRecognition(content::SPEECH_INPUT_ERROR_AUDIO);
+ InformErrorAndCancelRecognition(content::SPEECH_RECOGNITION_ERROR_AUDIO);
}
void SpeechRecognizerImpl::OnData(AudioInputController* controller,
@@ -272,7 +272,8 @@ void SpeechRecognizerImpl::HandleOnData(string* data) {
bool speech_was_heard_after_packet = endpointer_.DidStartReceivingSpeech();
if (!speech_was_heard_after_packet &&
num_samples_recorded_ >= kNoSpeechTimeoutSec * kAudioSampleRate) {
- InformErrorAndCancelRecognition(content::SPEECH_INPUT_ERROR_NO_SPEECH);
+ InformErrorAndCancelRecognition(
+ content::SPEECH_RECOGNITION_ERROR_NO_SPEECH);
return;
}
@@ -303,8 +304,8 @@ void SpeechRecognizerImpl::HandleOnData(string* data) {
}
void SpeechRecognizerImpl::SetRecognitionResult(
- const content::SpeechInputResult& result) {
- if (result.error != content::SPEECH_INPUT_ERROR_NONE) {
+ const content::SpeechRecognitionResult& result) {
+ if (result.error != content::SPEECH_RECOGNITION_ERROR_NONE) {
InformErrorAndCancelRecognition(result.error);
return;
}
@@ -316,8 +317,8 @@ void SpeechRecognizerImpl::SetRecognitionResult(
}
void SpeechRecognizerImpl::InformErrorAndCancelRecognition(
- content::SpeechInputError error) {
- DCHECK_NE(error, content::SPEECH_INPUT_ERROR_NONE);
+ content::SpeechRecognitionErrorCode error) {
+ DCHECK_NE(error, content::SPEECH_RECOGNITION_ERROR_NONE);
CancelRecognition();
// Guard against the delegate freeing us until we finish our job.
@@ -343,4 +344,4 @@ void SpeechRecognizerImpl::SetAudioManagerForTesting(
audio_manager_ = audio_manager;
}
-} // namespace speech_input
+} // namespace speech
« no previous file with comments | « content/browser/speech/speech_recognizer_impl.h ('k') | content/browser/speech/speech_recognizer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698