| 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 "content/browser/renderer_host/media/audio_renderer_host.h" | 5 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 if (!base::AtomicRefCountDec(&num_playing_streams_)) { | 783 if (!base::AtomicRefCountDec(&num_playing_streams_)) { |
| 784 BrowserThread::PostTask( | 784 BrowserThread::PostTask( |
| 785 BrowserThread::UI, FROM_HERE, | 785 BrowserThread::UI, FROM_HERE, |
| 786 base::Bind(&NotifyRenderProcessHostThatAudioStateChanged, | 786 base::Bind(&NotifyRenderProcessHostThatAudioStateChanged, |
| 787 render_process_id_)); | 787 render_process_id_)); |
| 788 } | 788 } |
| 789 } | 789 } |
| 790 } | 790 } |
| 791 | 791 |
| 792 bool AudioRendererHost::HasActiveAudio() { | 792 bool AudioRendererHost::HasActiveAudio() { |
| 793 LOG(ERROR) << __func__ << " : " |
| 794 << (!base::AtomicRefCountIsZero(&num_playing_streams_)); |
| 793 return !base::AtomicRefCountIsZero(&num_playing_streams_); | 795 return !base::AtomicRefCountIsZero(&num_playing_streams_); |
| 794 } | 796 } |
| 795 | 797 |
| 796 void AudioRendererHost::CheckOutputDeviceAccess( | 798 void AudioRendererHost::CheckOutputDeviceAccess( |
| 797 int render_frame_id, | 799 int render_frame_id, |
| 798 const std::string& device_id, | 800 const std::string& device_id, |
| 799 const url::Origin& security_origin, | 801 const url::Origin& security_origin, |
| 800 const OutputDeviceAccessCB& callback) { | 802 const OutputDeviceAccessCB& callback) { |
| 801 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 803 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 802 | 804 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 callback.Run(false, device_info); | 865 callback.Run(false, device_info); |
| 864 } | 866 } |
| 865 | 867 |
| 866 bool AudioRendererHost::IsAuthorizationStarted(int stream_id) { | 868 bool AudioRendererHost::IsAuthorizationStarted(int stream_id) { |
| 867 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 869 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 868 const auto& i = authorizations_.find(stream_id); | 870 const auto& i = authorizations_.find(stream_id); |
| 869 return i != authorizations_.end(); | 871 return i != authorizations_.end(); |
| 870 } | 872 } |
| 871 | 873 |
| 872 } // namespace content | 874 } // namespace content |
| OLD | NEW |