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

Side by Side Diff: media/audio/audio_output_controller.h

Issue 9255017: Add thread safety to AudioManagerBase to protect access to the audio thread member variable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix style issue Created 8 years, 11 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 | « media/audio/audio_manager_base.cc ('k') | media/audio/audio_output_controller.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 MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_
6 #define MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ 6 #define MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 base::Lock lock_; 247 base::Lock lock_;
248 248
249 media::SeekableBuffer buffer_; 249 media::SeekableBuffer buffer_;
250 250
251 bool pending_request_; 251 bool pending_request_;
252 252
253 // SyncReader is used only in low latency mode for synchronous reading. 253 // SyncReader is used only in low latency mode for synchronous reading.
254 SyncReader* sync_reader_; 254 SyncReader* sync_reader_;
255 255
256 // The message loop of audio thread that this object runs on. 256 // The message loop of audio thread that this object runs on.
257 MessageLoop* message_loop_; 257 scoped_refptr<base::MessageLoopProxy> message_loop_;
258 258
259 // When starting stream we wait for data to become available. 259 // When starting stream we wait for data to become available.
260 // Number of times left. 260 // Number of times left.
261 int number_polling_attempts_left_; 261 int number_polling_attempts_left_;
262 262
263 // Used to post delayed tasks to ourselves that we can cancel. 263 // Used to post delayed tasks to ourselves that we can cancel.
264 // We don't want the tasks to hold onto a reference as it will slow down 264 // We don't want the tasks to hold onto a reference as it will slow down
265 // shutdown and force it to wait for the most delayed task. 265 // shutdown and force it to wait for the most delayed task.
266 // Also, if we're shutting down, we do not want to poll for more data. 266 // Also, if we're shutting down, we do not want to poll for more data.
267 base::WeakPtrFactory<AudioOutputController> weak_this_; 267 base::WeakPtrFactory<AudioOutputController> weak_this_;
268 268
269 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); 269 DISALLOW_COPY_AND_ASSIGN(AudioOutputController);
270 }; 270 };
271 271
272 } // namespace media 272 } // namespace media
273 273
274 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ 274 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_
OLDNEW
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698