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

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

Issue 11347004: content/browser: Move speech code into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 8180844446d65471ecb6a20307273d8f332f9fd7..d713dfdf47d437681664bbe49cfc64f288b6ff0a 100644
--- a/content/browser/speech/google_one_shot_remote_engine.cc
+++ b/content/browser/speech/google_one_shot_remote_engine.cc
@@ -21,10 +21,7 @@
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
-using content::SpeechRecognitionError;
-using content::SpeechRecognitionHypothesis;
-using content::SpeechRecognitionResult;
-
+namespace content {
namespace {
const char* const kDefaultSpeechRecognitionUrl =
@@ -36,8 +33,7 @@ const char* const kConfidenceString = "confidence";
const int kWebServiceStatusNoError = 0;
const int kWebServiceStatusNoSpeech = 4;
const int kWebServiceStatusNoMatch = 5;
-const speech::AudioEncoder::Codec kDefaultAudioCodec =
- speech::AudioEncoder::CODEC_FLAC;
+const AudioEncoder::Codec kDefaultAudioCodec = AudioEncoder::CODEC_FLAC;
bool ParseServerResponse(const std::string& response_body,
SpeechRecognitionResult* result,
@@ -78,13 +74,13 @@ bool ParseServerResponse(const std::string& response_body,
case kWebServiceStatusNoError:
break;
case kWebServiceStatusNoSpeech:
- error->code = content::SPEECH_RECOGNITION_ERROR_NO_SPEECH;
+ error->code = SPEECH_RECOGNITION_ERROR_NO_SPEECH;
return false;
case kWebServiceStatusNoMatch:
- error->code = content::SPEECH_RECOGNITION_ERROR_NO_MATCH;
+ error->code = SPEECH_RECOGNITION_ERROR_NO_MATCH;
return false;
default:
- error->code = content::SPEECH_RECOGNITION_ERROR_NETWORK;
+ error->code = SPEECH_RECOGNITION_ERROR_NETWORK;
// Other status codes should not be returned by the server.
VLOG(1) << "ParseServerResponse: unexpected status code " << status;
return false;
@@ -148,8 +144,6 @@ bool ParseServerResponse(const std::string& response_body,
} // namespace
-namespace speech {
-
const int GoogleOneShotRemoteEngine::kAudioPacketIntervalMs = 100;
int GoogleOneShotRemoteEngine::url_fetcher_id_for_tests = 0;
@@ -266,7 +260,7 @@ void GoogleOneShotRemoteEngine::OnURLFetchComplete(
const net::URLFetcher* source) {
DCHECK_EQ(url_fetcher_.get(), source);
SpeechRecognitionResult result;
- SpeechRecognitionError error(content::SPEECH_RECOGNITION_ERROR_NETWORK);
+ SpeechRecognitionError error(SPEECH_RECOGNITION_ERROR_NETWORK);
std::string data;
// The default error code in case of parse errors is NETWORK_FAILURE, however
@@ -293,4 +287,4 @@ int GoogleOneShotRemoteEngine::GetDesiredAudioChunkDurationMs() const {
return kAudioPacketIntervalMs;
}
-} // namespace speech
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698