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

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

Issue 66183002: Replace MessageLoopProxy with SingleThreadTaskRunner for the rest of media/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 #include "media/audio/audio_output_controller.h" 5 #include "media/audio/audio_output_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/message_loop/message_loop.h"
10 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
11 #include "base/task_runner_util.h" 10 #include "base/task_runner_util.h"
12 #include "base/threading/platform_thread.h" 11 #include "base/threading/platform_thread.h"
13 #include "base/time/time.h" 12 #include "base/time/time.h"
14 #include "build/build_config.h" 13 #include "build/build_config.h"
15 #include "media/base/scoped_histogram_timer.h" 14 #include "media/base/scoped_histogram_timer.h"
16 15
17 using base::Time; 16 using base::Time;
18 using base::TimeDelta; 17 using base::TimeDelta;
19 18
(...skipping 24 matching lines...) Expand all
44 params_(params), 43 params_(params),
45 handler_(handler), 44 handler_(handler),
46 output_device_id_(output_device_id), 45 output_device_id_(output_device_id),
47 input_device_id_(input_device_id), 46 input_device_id_(input_device_id),
48 stream_(NULL), 47 stream_(NULL),
49 diverting_to_stream_(NULL), 48 diverting_to_stream_(NULL),
50 volume_(1.0), 49 volume_(1.0),
51 state_(kEmpty), 50 state_(kEmpty),
52 num_allowed_io_(0), 51 num_allowed_io_(0),
53 sync_reader_(sync_reader), 52 sync_reader_(sync_reader),
54 message_loop_(audio_manager->GetMessageLoop()), 53 message_loop_(audio_manager->GetTaskRunner()),
55 #if defined(AUDIO_POWER_MONITORING) 54 #if defined(AUDIO_POWER_MONITORING)
56 power_monitor_( 55 power_monitor_(
57 params.sample_rate(), 56 params.sample_rate(),
58 TimeDelta::FromMilliseconds(kPowerMeasurementTimeConstantMillis)), 57 TimeDelta::FromMilliseconds(kPowerMeasurementTimeConstantMillis)),
59 #endif 58 #endif
60 on_more_io_data_called_(0) { 59 on_more_io_data_called_(0) {
61 DCHECK(audio_manager); 60 DCHECK(audio_manager);
62 DCHECK(handler_); 61 DCHECK(handler_);
63 DCHECK(sync_reader_); 62 DCHECK(sync_reader_);
64 DCHECK(message_loop_.get()); 63 DCHECK(message_loop_.get());
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 DCHECK(message_loop_->BelongsToCurrentThread()); 473 DCHECK(message_loop_->BelongsToCurrentThread());
475 474
476 // If we should be playing and we haven't, that's a wedge. 475 // If we should be playing and we haven't, that's a wedge.
477 if (state_ == kPlaying) { 476 if (state_ == kPlaying) {
478 UMA_HISTOGRAM_BOOLEAN("Media.AudioOutputControllerPlaybackStartupSuccess", 477 UMA_HISTOGRAM_BOOLEAN("Media.AudioOutputControllerPlaybackStartupSuccess",
479 base::AtomicRefCountIsOne(&on_more_io_data_called_)); 478 base::AtomicRefCountIsOne(&on_more_io_data_called_));
480 } 479 }
481 } 480 }
482 481
483 } // namespace media 482 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698