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

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

Issue 10377082: SpeechInputExtensionManager now interface with SpeechRecognitionManagerDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase before dcommit 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/speech_recognizer_impl.h
diff --git a/content/browser/speech/speech_recognizer_impl.h b/content/browser/speech/speech_recognizer_impl.h
index 1aa2eaa719426affd469ad6af0b384943c2c0404..8179e274398095ac7718efb02e7f2cda64266b46 100644
--- a/content/browser/speech/speech_recognizer_impl.h
+++ b/content/browser/speech/speech_recognizer_impl.h
@@ -11,7 +11,6 @@
#include "base/memory/scoped_ptr.h"
#include "content/browser/speech/endpointer/endpointer.h"
#include "content/browser/speech/speech_recognition_engine.h"
-#include "content/public/browser/speech_recognizer.h"
#include "content/public/common/speech_recognition_error.h"
#include "content/public/common/speech_recognition_result.h"
#include "media/audio/audio_input_controller.h"
@@ -27,15 +26,13 @@ class AudioManager;
namespace speech {
-// TODO(primiano) Next CL: Remove the Impl suffix and the exported
-// /content/public/browser/speech_recognizer.h interface since this class should
-// not be visible outside (currently we need it for speech input extension API).
+// TODO(primiano) Next CL: Remove the Impl suffix.
// Handles speech recognition for a session (identified by |session_id|), taking
// care of audio capture, silence detection/endpointer and interaction with the
// SpeechRecognitionEngine.
class CONTENT_EXPORT SpeechRecognizerImpl
- : public NON_EXPORTED_BASE(content::SpeechRecognizer),
+ : public base::RefCountedThreadSafe<SpeechRecognizerImpl>,
public media::AudioInputController::EventHandler,
public NON_EXPORTED_BASE(SpeechRecognitionEngineDelegate) {
public:
@@ -50,18 +47,15 @@ class CONTENT_EXPORT SpeechRecognizerImpl
int session_id,
SpeechRecognitionEngine* engine);
- // content::SpeechRecognizer methods.
- virtual void StartRecognition() OVERRIDE;
- virtual void AbortRecognition() OVERRIDE;
- virtual void StopAudioCapture() OVERRIDE;
- virtual bool IsActive() const OVERRIDE;
- virtual bool IsCapturingAudio() const OVERRIDE;
+ void StartRecognition();
+ void AbortRecognition();
+ void StopAudioCapture();
+ bool IsActive() const;
+ bool IsCapturingAudio() const;
const SpeechRecognitionEngine& recognition_engine() const;
- protected:
- virtual ~SpeechRecognizerImpl();
-
private:
+ friend class base::RefCountedThreadSafe<SpeechRecognizerImpl>;
friend class SpeechRecognizerImplTest;
enum FSMState {
@@ -96,6 +90,8 @@ class CONTENT_EXPORT SpeechRecognizerImpl
content::SpeechRecognitionError engine_error;
};
+ virtual ~SpeechRecognizerImpl();
+
// Entry point for pushing any new external event into the recognizer FSM.
void DispatchEvent(const FSMEventArgs& event_args);
« no previous file with comments | « content/browser/speech/speech_recognition_manager_impl.cc ('k') | content/browser/speech/speech_recognizer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698