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

Side by Side Diff: webrtc/pc/remoteaudiosource.cc

Issue 2988153003: Replace CHECK(x && y) with two separate CHECK() calls (Closed)
Patch Set: fix mistakes Created 3 years, 4 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 | « webrtc/pc/datachannel.cc ('k') | webrtc/pc/rtpreceiver.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 /* 1 /*
2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 RTC_DCHECK(main_thread_->IsCurrent()); 89 RTC_DCHECK(main_thread_->IsCurrent());
90 return state_; 90 return state_;
91 } 91 }
92 92
93 bool RemoteAudioSource::remote() const { 93 bool RemoteAudioSource::remote() const {
94 RTC_DCHECK(main_thread_->IsCurrent()); 94 RTC_DCHECK(main_thread_->IsCurrent());
95 return true; 95 return true;
96 } 96 }
97 97
98 void RemoteAudioSource::SetVolume(double volume) { 98 void RemoteAudioSource::SetVolume(double volume) {
99 RTC_DCHECK(volume >= 0 && volume <= 10); 99 RTC_DCHECK_GE(volume, 0);
100 RTC_DCHECK_LE(volume, 10);
100 for (auto* observer : audio_observers_) 101 for (auto* observer : audio_observers_)
101 observer->OnSetVolume(volume); 102 observer->OnSetVolume(volume);
102 } 103 }
103 104
104 void RemoteAudioSource::RegisterAudioObserver(AudioObserver* observer) { 105 void RemoteAudioSource::RegisterAudioObserver(AudioObserver* observer) {
105 RTC_DCHECK(observer != NULL); 106 RTC_DCHECK(observer != NULL);
106 RTC_DCHECK(std::find(audio_observers_.begin(), audio_observers_.end(), 107 RTC_DCHECK(std::find(audio_observers_.begin(), audio_observers_.end(),
107 observer) == audio_observers_.end()); 108 observer) == audio_observers_.end());
108 audio_observers_.push_back(observer); 109 audio_observers_.push_back(observer);
109 } 110 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 152 }
152 153
153 void RemoteAudioSource::OnMessage(rtc::Message* msg) { 154 void RemoteAudioSource::OnMessage(rtc::Message* msg) {
154 RTC_DCHECK(main_thread_->IsCurrent()); 155 RTC_DCHECK(main_thread_->IsCurrent());
155 sinks_.clear(); 156 sinks_.clear();
156 state_ = MediaSourceInterface::kEnded; 157 state_ = MediaSourceInterface::kEnded;
157 FireOnChanged(); 158 FireOnChanged();
158 } 159 }
159 160
160 } // namespace webrtc 161 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/pc/datachannel.cc ('k') | webrtc/pc/rtpreceiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698