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

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

Issue 25550003: Web Speech API: Fix a race condition causing renderer crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed return condition Created 7 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
« no previous file with comments | « no previous file | content/browser/speech/speech_recognition_manager_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 EVENT_AUDIO_ENDED, 120 EVENT_AUDIO_ENDED,
121 EVENT_RECOGNITION_ENDED, 121 EVENT_RECOGNITION_ENDED,
122 EVENT_MAX_VALUE = EVENT_RECOGNITION_ENDED 122 EVENT_MAX_VALUE = EVENT_RECOGNITION_ENDED
123 }; 123 };
124 124
125 struct Session { 125 struct Session {
126 Session(); 126 Session();
127 ~Session(); 127 ~Session();
128 128
129 int id; 129 int id;
130 bool abort_requested;
130 bool listener_is_active; 131 bool listener_is_active;
131 SpeechRecognitionSessionConfig config; 132 SpeechRecognitionSessionConfig config;
132 SpeechRecognitionSessionContext context; 133 SpeechRecognitionSessionContext context;
133 scoped_refptr<SpeechRecognizer> recognizer; 134 scoped_refptr<SpeechRecognizer> recognizer;
134 scoped_ptr<MediaStreamUIProxy> ui; 135 scoped_ptr<MediaStreamUIProxy> ui;
135 }; 136 };
136 137
137 // Callback issued by the SpeechRecognitionManagerDelegate for reporting 138 // Callback issued by the SpeechRecognitionManagerDelegate for reporting
138 // asynchronously the result of the CheckRecognitionIsAllowed call. 139 // asynchronously the result of the CheckRecognitionIsAllowed call.
139 void RecognitionAllowedCallback(int session_id, 140 void RecognitionAllowedCallback(int session_id,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 185
185 // Used for posting asynchronous tasks (on the IO thread) without worrying 186 // Used for posting asynchronous tasks (on the IO thread) without worrying
186 // about this class being destroyed in the meanwhile (due to browser shutdown) 187 // about this class being destroyed in the meanwhile (due to browser shutdown)
187 // since tasks pending on a destroyed WeakPtr are automatically discarded. 188 // since tasks pending on a destroyed WeakPtr are automatically discarded.
188 base::WeakPtrFactory<SpeechRecognitionManagerImpl> weak_factory_; 189 base::WeakPtrFactory<SpeechRecognitionManagerImpl> weak_factory_;
189 }; 190 };
190 191
191 } // namespace content 192 } // namespace content
192 193
193 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_ 194 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/speech/speech_recognition_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698