| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/browser/renderer_host/media/audio_output_delegate_impl.h" | 5 #include "content/browser/renderer_host/media/audio_output_delegate_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 164 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 165 DCHECK_GE(volume, 0); | 165 DCHECK_GE(volume, 0); |
| 166 DCHECK_LE(volume, 1); | 166 DCHECK_LE(volume, 1); |
| 167 controller_->SetVolume(volume); | 167 controller_->SetVolume(volume); |
| 168 audio_log_->OnSetVolume(stream_id_, volume); | 168 audio_log_->OnSetVolume(stream_id_, volume); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void AudioOutputDelegateImpl::SendCreatedNotification() { | 171 void AudioOutputDelegateImpl::SendCreatedNotification() { |
| 172 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 172 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 173 subscriber_->OnStreamCreated(stream_id_, reader_->shared_memory(), | 173 subscriber_->OnStreamCreated(stream_id_, reader_->shared_memory(), |
| 174 reader_->foreign_socket()); | 174 reader_->TakeForeignSocket()); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void AudioOutputDelegateImpl::UpdatePlayingState(bool playing) { | 177 void AudioOutputDelegateImpl::UpdatePlayingState(bool playing) { |
| 178 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 178 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 179 if (playing == playing_) | 179 if (playing == playing_) |
| 180 return; | 180 return; |
| 181 | 181 |
| 182 playing_ = playing; | 182 playing_ = playing; |
| 183 if (playing) { | 183 if (playing) { |
| 184 // Note that this takes a reference to |controller_|, and | 184 // Note that this takes a reference to |controller_|, and |
| (...skipping 10 matching lines...) Expand all Loading... |
| 195 } | 195 } |
| 196 | 196 |
| 197 void AudioOutputDelegateImpl::OnError() { | 197 void AudioOutputDelegateImpl::OnError() { |
| 198 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 198 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 199 | 199 |
| 200 audio_log_->OnError(stream_id_); | 200 audio_log_->OnError(stream_id_); |
| 201 subscriber_->OnStreamError(stream_id_); | 201 subscriber_->OnStreamError(stream_id_); |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace content | 204 } // namespace content |
| OLD | NEW |