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

Side by Side Diff: media/audio/audio_input_controller.cc

Issue 7825026: Revert "Currently, base/timer.cc calls PostTask with FROM_HERE as the Location, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 | « jingle/notifier/communicator/login.cc ('k') | media/audio/audio_output_dispatcher.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "media/audio/audio_input_controller.h" 5 #include "media/audio/audio_input_controller.h"
6 6
7 #include "base/threading/thread_restrictions.h" 7 #include "base/threading/thread_restrictions.h"
8 #include "media/base/limits.h" 8 #include "media/base/limits.h"
9 9
10 namespace { 10 namespace {
11 const int kMaxInputChannels = 2; 11 const int kMaxInputChannels = 2;
12 const int kTimerResetInterval = 1; // One second. 12 const int kTimerResetInterval = 1; // One second.
13 } 13 }
14 14
15 namespace media { 15 namespace media {
16 16
17 // static 17 // static
18 AudioInputController::Factory* AudioInputController::factory_ = NULL; 18 AudioInputController::Factory* AudioInputController::factory_ = NULL;
19 19
20 AudioInputController::AudioInputController(EventHandler* handler, 20 AudioInputController::AudioInputController(EventHandler* handler,
21 SyncWriter* sync_writer) 21 SyncWriter* sync_writer)
22 : handler_(handler), 22 : handler_(handler),
23 stream_(NULL), 23 stream_(NULL),
24 ALLOW_THIS_IN_INITIALIZER_LIST(no_data_timer_(FROM_HERE, 24 ALLOW_THIS_IN_INITIALIZER_LIST(no_data_timer_(
25 base::TimeDelta::FromSeconds(kTimerResetInterval), 25 base::TimeDelta::FromSeconds(kTimerResetInterval),
26 this, 26 this,
27 &AudioInputController::DoReportNoDataError)), 27 &AudioInputController::DoReportNoDataError)),
28 state_(kEmpty), 28 state_(kEmpty),
29 thread_("AudioInputControllerThread"), 29 thread_("AudioInputControllerThread"),
30 sync_writer_(sync_writer) { 30 sync_writer_(sync_writer) {
31 } 31 }
32 32
33 AudioInputController::~AudioInputController() { 33 AudioInputController::~AudioInputController() {
34 DCHECK(kClosed == state_ || kCreated == state_ || kEmpty == state_); 34 DCHECK(kClosed == state_ || kCreated == state_ || kEmpty == state_);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 } 217 }
218 218
219 void AudioInputController::OnError(AudioInputStream* stream, int code) { 219 void AudioInputController::OnError(AudioInputStream* stream, int code) {
220 // Handle error on the audio controller thread. 220 // Handle error on the audio controller thread.
221 thread_.message_loop()->PostTask( 221 thread_.message_loop()->PostTask(
222 FROM_HERE, 222 FROM_HERE,
223 NewRunnableMethod(this, &AudioInputController::DoReportError, code)); 223 NewRunnableMethod(this, &AudioInputController::DoReportError, code));
224 } 224 }
225 225
226 } // namespace media 226 } // namespace media
OLDNEW
« no previous file with comments | « jingle/notifier/communicator/login.cc ('k') | media/audio/audio_output_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698