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

Unified Diff: content/browser/speech/speech_recognizer.h

Issue 9433006: Remove GetAudioManager and GetMediaStreamManager from ResourceContext. The reason is the content mo… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 8 years, 10 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
« no previous file with comments | « content/browser/speech/speech_input_manager.cc ('k') | content/browser/speech/speech_recognizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/speech/speech_recognizer.h
===================================================================
--- content/browser/speech/speech_recognizer.h (revision 123165)
+++ content/browser/speech/speech_recognizer.h (working copy)
@@ -18,6 +18,8 @@
#include "content/public/common/speech_input_result.h"
#include "media/audio/audio_input_controller.h"
+class AudioManager;
+
namespace content {
class SpeechRecognizerDelegate;
}
@@ -40,7 +42,6 @@
const std::string& language,
const std::string& grammar,
net::URLRequestContextGetter* context_getter,
- AudioManager* audio_manager,
bool filter_profanities,
const std::string& hardware_info,
const std::string& origin_url);
@@ -74,8 +75,6 @@
virtual void SetRecognitionResult(
const content::SpeechInputResult& result) OVERRIDE;
- AudioManager* audio_manager() const { return audio_manager_; }
-
static const int kAudioSampleRate;
static const int kAudioPacketIntervalMs; // Duration of each audio packet.
static const ChannelLayout kChannelLayout;
@@ -84,6 +83,8 @@
static const int kEndpointerEstimationTimeMs;
private:
+ friend class SpeechRecognizerTest;
+
void InformErrorAndCancelRecognition(content::SpeechInputError error);
void SendRecordedAudioToServer();
@@ -95,6 +96,8 @@
// Helper method which closes the audio controller and blocks until done.
void CloseAudioControllerSynchronously();
+ void SetAudioManagerForTesting(AudioManager* audio_manager);
+
content::SpeechRecognizerDelegate* delegate_;
int caller_id_;
std::string language_;
@@ -106,12 +109,12 @@
scoped_ptr<SpeechRecognitionRequest> request_;
scoped_refptr<media::AudioInputController> audio_controller_;
scoped_refptr<net::URLRequestContextGetter> context_getter_;
- AudioManager* audio_manager_;
AudioEncoder::Codec codec_;
scoped_ptr<AudioEncoder> encoder_;
Endpointer endpointer_;
int num_samples_recorded_;
float audio_level_;
+ AudioManager* audio_manager_;
DISALLOW_COPY_AND_ASSIGN(SpeechRecognizer);
};
« no previous file with comments | « content/browser/speech/speech_input_manager.cc ('k') | content/browser/speech/speech_recognizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698