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

Side by Side Diff: content/browser/speech/speech_recognition_manager_impl.h

Issue 11149006: Extend scoped_ptr to be closer to unique_ptr. Support custom deleters, and deleting arrays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: utility -> algorithm. Mac needs it. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_ 5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_
6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_ 6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 virtual void OnRecognitionResult( 92 virtual void OnRecognitionResult(
93 int session_id, const content::SpeechRecognitionResult& result) OVERRIDE; 93 int session_id, const content::SpeechRecognitionResult& result) OVERRIDE;
94 virtual void OnRecognitionError( 94 virtual void OnRecognitionError(
95 int session_id, const content::SpeechRecognitionError& error) OVERRIDE; 95 int session_id, const content::SpeechRecognitionError& error) OVERRIDE;
96 virtual void OnAudioLevelsChange(int session_id, float volume, 96 virtual void OnAudioLevelsChange(int session_id, float volume,
97 float noise_volume) OVERRIDE; 97 float noise_volume) OVERRIDE;
98 98
99 protected: 99 protected:
100 // BrowserMainLoop is the only one allowed to istantiate and free us. 100 // BrowserMainLoop is the only one allowed to istantiate and free us.
101 friend class content::BrowserMainLoop; 101 friend class content::BrowserMainLoop;
102 friend class scoped_ptr<SpeechRecognitionManagerImpl>; // Needed for dtor. 102
103 // Needed for dtor.
104 friend struct base::DefaultDeleter<SpeechRecognitionManagerImpl>;
105
103 SpeechRecognitionManagerImpl(); 106 SpeechRecognitionManagerImpl();
104 virtual ~SpeechRecognitionManagerImpl(); 107 virtual ~SpeechRecognitionManagerImpl();
105 108
106 private: 109 private:
107 // Data types for the internal Finite State Machine (FSM). 110 // Data types for the internal Finite State Machine (FSM).
108 enum FSMState { 111 enum FSMState {
109 SESSION_STATE_IDLE = 0, 112 SESSION_STATE_IDLE = 0,
110 SESSION_STATE_CAPTURING_AUDIO, 113 SESSION_STATE_CAPTURING_AUDIO,
111 SESSION_STATE_WAITING_FOR_RESULT, 114 SESSION_STATE_WAITING_FOR_RESULT,
112 SESSION_STATE_MAX_VALUE = SESSION_STATE_WAITING_FOR_RESULT 115 SESSION_STATE_MAX_VALUE = SESSION_STATE_WAITING_FOR_RESULT
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // since tasks pending on a destroyed WeakPtr are automatically discarded. 178 // since tasks pending on a destroyed WeakPtr are automatically discarded.
176 base::WeakPtrFactory<SpeechRecognitionManagerImpl> weak_factory_; 179 base::WeakPtrFactory<SpeechRecognitionManagerImpl> weak_factory_;
177 180
178 class PermissionRequest; 181 class PermissionRequest;
179 scoped_ptr<PermissionRequest> permission_request_; 182 scoped_ptr<PermissionRequest> permission_request_;
180 }; 183 };
181 184
182 } // namespace speech 185 } // namespace speech
183 186
184 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_ 187 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698