Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_manager_base.h" | 5 #include "media/audio/audio_manager_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 max_num_input_streams_(kDefaultMaxInputStreams), | 91 max_num_input_streams_(kDefaultMaxInputStreams), |
| 92 num_output_streams_(0), | 92 num_output_streams_(0), |
| 93 // TODO(dalecurtis): Switch this to an base::ObserverListThreadSafe, so we | 93 // TODO(dalecurtis): Switch this to an base::ObserverListThreadSafe, so we |
| 94 // don't block the UI thread when swapping devices. | 94 // don't block the UI thread when swapping devices. |
| 95 output_listeners_( | 95 output_listeners_( |
| 96 base::ObserverList<AudioDeviceListener>::NOTIFY_EXISTING_ONLY), | 96 base::ObserverList<AudioDeviceListener>::NOTIFY_EXISTING_ONLY), |
| 97 audio_log_factory_(audio_log_factory) {} | 97 audio_log_factory_(audio_log_factory) {} |
| 98 | 98 |
| 99 AudioManagerBase::~AudioManagerBase() { | 99 AudioManagerBase::~AudioManagerBase() { |
| 100 // All the output streams should have been deleted. | 100 // All the output streams should have been deleted. |
| 101 CHECK_EQ(0, num_output_streams_); | 101 DCHECK_EQ(0, num_output_streams_); |
|
alokp
2017/06/13 23:35:51
Changing CHECKs in the constructor to DCHECKs sinc
DaleCurtis
2017/06/13 23:43:15
I think a better option would be to skip AM::Shutd
alokp
2017/06/14 17:34:35
Good idea. Done.
| |
| 102 // All the input streams should have been deleted. | 102 // All the input streams should have been deleted. |
| 103 CHECK(input_streams_.empty()); | 103 DCHECK(input_streams_.empty()); |
| 104 } | 104 } |
| 105 | 105 |
| 106 base::string16 AudioManagerBase::GetAudioInputDeviceModel() { | 106 base::string16 AudioManagerBase::GetAudioInputDeviceModel() { |
| 107 return base::string16(); | 107 return base::string16(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void AudioManagerBase::GetAudioInputDeviceDescriptions( | 110 void AudioManagerBase::GetAudioInputDeviceDescriptions( |
| 111 AudioDeviceDescriptions* device_descriptions) { | 111 AudioDeviceDescriptions* device_descriptions) { |
| 112 CHECK(GetTaskRunner()->BelongsToCurrentThread()); | 112 CHECK(GetTaskRunner()->BelongsToCurrentThread()); |
| 113 AudioDeviceNames device_names; | 113 AudioDeviceNames device_names; |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 483 return base::MakeUnique<AudioDebugRecordingManager>(std::move(task_runner)); | 483 return base::MakeUnique<AudioDebugRecordingManager>(std::move(task_runner)); |
| 484 } | 484 } |
| 485 | 485 |
| 486 void AudioManagerBase::SetMaxStreamCountForTesting(int max_input, | 486 void AudioManagerBase::SetMaxStreamCountForTesting(int max_input, |
| 487 int max_output) { | 487 int max_output) { |
| 488 max_num_output_streams_ = max_output; | 488 max_num_output_streams_ = max_output; |
| 489 max_num_input_streams_ = max_input; | 489 max_num_input_streams_ = max_input; |
| 490 } | 490 } |
| 491 | 491 |
| 492 } // namespace media | 492 } // namespace media |
| OLD | NEW |