Index: content/browser/renderer_host/media/audio_output_service_impl.cc |
diff --git a/content/browser/renderer_host/media/audio_output_service_impl.cc b/content/browser/renderer_host/media/audio_output_service_impl.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..da5416a274737ef8feac9cae3a3c265d29373ce1 |
--- /dev/null |
+++ b/content/browser/renderer_host/media/audio_output_service_impl.cc |
@@ -0,0 +1,45 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/browser/renderer_host/media/audio_output_service_impl.h" |
+ |
+namespace content { |
+ |
+void GetOutputControllers( |
+ const RenderProcessHost::GetAudioOutputControllersCallback& callback) { |
+ task_runner_->PostTask(DoGetOutputControllers, this, callback); |
+} |
+ |
+bool AudioOutputServiceImpl::HasActiveAudio() { |
+ return base::AtomicRefCountIsZero(&num_playing_streams); |
+} |
+ |
+void AudioOutputServiceImpl::NotifyStreamCreated(BindingId binding) { |
+ task_runner_->PostTask(Base::Bind(DoNotifyStreamCreated, this, binding)); |
+} |
+ |
+void AudioOutputServiceImpl::NotifyStreamStateChanged(BindingId binding) { |
+ task_runner_->PostTask( |
+ Base::Bind(DoNotifyStreamStateChanged, this, binding, render_frame_id)); |
+} |
+ |
+void DoGetOutputControllers( |
+ const RenderProcessHost::GetAudioOutputControllersCallback& callback) { |
+ RenderProcessHost::AudioOutputControllerList list; |
+} |
+ |
+void AudioOutputServiceImpl::DoNotifyStreamCreated(BindingId binding) { |
+ g_audio_streams_tracker.Get().IncreaseStreamCount(); |
+ max_simultaneous_streams_ = |
+ std::max(bindings_.size(), max_simultaneous_streams_); |
+} |
+ |
+void AudioOutputServiceImpl::RegisterStartedStream(BindingId binding); |
+{ |
+ g_audio_streams_tracker.Get().IncreaseStreamCount(); |
+ if (audio_entries_.size() > max_simultaneous_streams_) |
+ max_simultaneous_streams_ = audio_entries_.size(); |
+} |
+ |
+} // namespace content |