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

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

Issue 1116683002: [media] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased patch Created 5 years, 7 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
« no previous file with comments | « no previous file | media/audio/audio_manager_base.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 #include "media/audio/audio_input_controller.h" 5 #include "media/audio/audio_input_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/single_thread_task_runner.h"
9 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "base/thread_task_runner_handle.h"
11 #include "base/threading/thread_restrictions.h" 13 #include "base/threading/thread_restrictions.h"
12 #include "base/time/time.h" 14 #include "base/time/time.h"
13 #include "media/audio/audio_parameters.h" 15 #include "media/audio/audio_parameters.h"
14 #include "media/base/user_input_monitor.h" 16 #include "media/base/user_input_monitor.h"
15 17
16 using base::TimeDelta; 18 using base::TimeDelta;
17 19
18 namespace { 20 namespace {
19 21
20 const int kMaxInputChannels = 3; 22 const int kMaxInputChannels = 3;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 114
113 namespace media { 115 namespace media {
114 116
115 // static 117 // static
116 AudioInputController::Factory* AudioInputController::factory_ = NULL; 118 AudioInputController::Factory* AudioInputController::factory_ = NULL;
117 119
118 AudioInputController::AudioInputController(EventHandler* handler, 120 AudioInputController::AudioInputController(EventHandler* handler,
119 SyncWriter* sync_writer, 121 SyncWriter* sync_writer,
120 UserInputMonitor* user_input_monitor, 122 UserInputMonitor* user_input_monitor,
121 const bool agc_is_enabled) 123 const bool agc_is_enabled)
122 : creator_task_runner_(base::MessageLoopProxy::current()), 124 : creator_task_runner_(base::ThreadTaskRunnerHandle::Get()),
123 handler_(handler), 125 handler_(handler),
124 stream_(NULL), 126 stream_(NULL),
125 data_is_active_(false), 127 data_is_active_(false),
126 state_(CLOSED), 128 state_(CLOSED),
127 sync_writer_(sync_writer), 129 sync_writer_(sync_writer),
128 max_volume_(0.0), 130 max_volume_(0.0),
129 user_input_monitor_(user_input_monitor), 131 user_input_monitor_(user_input_monitor),
130 agc_is_enabled_(agc_is_enabled), 132 agc_is_enabled_(agc_is_enabled),
131 #if defined(AUDIO_POWER_MONITORING) 133 #if defined(AUDIO_POWER_MONITORING)
132 power_measurement_is_enabled_(false), 134 power_measurement_is_enabled_(false),
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 } 671 }
670 672
671 void AudioInputController::LogSilenceState(SilenceState value) { 673 void AudioInputController::LogSilenceState(SilenceState value) {
672 UMA_HISTOGRAM_ENUMERATION("Media.AudioInputControllerSessionSilenceReport", 674 UMA_HISTOGRAM_ENUMERATION("Media.AudioInputControllerSessionSilenceReport",
673 value, 675 value,
674 SILENCE_STATE_MAX + 1); 676 SILENCE_STATE_MAX + 1);
675 } 677 }
676 #endif 678 #endif
677 679
678 } // namespace media 680 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698