Index: content/browser/renderer_host/media/audio_stream_registry_impl.h |
diff --git a/content/browser/renderer_host/media/audio_stream_registry_impl.h b/content/browser/renderer_host/media/audio_stream_registry_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..783c54bee6a3b196d286811abeb54e1508d66942 |
--- /dev/null |
+++ b/content/browser/renderer_host/media/audio_stream_registry_impl.h |
@@ -0,0 +1,49 @@ |
+// 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. |
+ |
+#ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_STREAM_REGISTRY_IMPL_H_ |
+#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_STREAM_REGISTRY_IMPL_H_ |
+ |
+#include <map> |
+#include <memory> |
+#include <set> |
+ |
+#include "base/atomic_ref_count.h" |
+#include "base/files/file_path.h" |
+#include "base/macros.h" |
+#include "base/threading/thread_checker.h" |
+#include "content/browser/renderer_host/media/audio_stream_registry.h" |
+#include "content/common/content_export.h" |
+#include "content/public/browser/browser_thread.h" |
+ |
+namespace content { |
+ |
+class CONTENT_EXPORT AudioStreamRegistryImpl : public AudioStreamRegistry { |
+ public: |
+ explicit AudioStreamRegistryImpl(int render_process_id); |
DaleCurtis
2017/01/12 19:22:12
Typically we don't expose both a normal constructo
|
+ ~AudioStreamRegistryImpl() override; |
+ |
+ using UniquePtr = |
+ std::unique_ptr<AudioStreamRegistryImpl, BrowserThread::DeleteOnIOThread>; |
+ |
+ static UniquePtr Create(int render_process_id); |
+ |
+ // Indicates whether there is an output stream currently playing. |
+ // May be called from any thread. |
+ bool HasActiveAudio(); |
+ |
+ void RegisterStream() override; |
+ void DeregisterStream() override; |
+ void StreamStateChanged(bool playing) override; |
+ |
+ private: |
+ int32_t num_output_streams_ = 0; |
+ int32_t max_simultaneous_output_streams_ = 0; |
+ base::AtomicRefCount num_playing_output_streams_ = 0; |
+ const int render_process_id_; |
+}; |
DaleCurtis
2017/01/12 19:22:12
DISALLOW_COPY_AND_ASSIGN
|
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_STREAM_REGISTRY_IMPL_H_ |