Chromium Code Reviews| Index: content/browser/renderer_host/media/render_frame_audio_output_stream_factory.h |
| diff --git a/content/browser/renderer_host/media/render_frame_audio_output_stream_factory.h b/content/browser/renderer_host/media/render_frame_audio_output_stream_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bdfcf2034f87bc83d2bf21f7ae3b51cc570c2256 |
| --- /dev/null |
| +++ b/content/browser/renderer_host/media/render_frame_audio_output_stream_factory.h |
| @@ -0,0 +1,66 @@ |
| +// Copyright 2017 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_RENDER_FRAME_AUDIO_OUTPUT_STREAM_FACTORY_H_ |
| +#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_RENDER_FRAME_AUDIO_OUTPUT_STREAM_FACTORY_H_ |
| + |
| +#include <memory> |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "content/common/content_export.h" |
| +#include "content/common/media/renderer_audio_output_stream_factory.mojom.h" |
| +#include "mojo/public/cpp/bindings/binding.h" |
| + |
| +namespace content { |
| + |
| +class RendererAudioOutputStreamFactoryContext; |
| + |
| +// Handles a RendererAudioOutputStreamFactory request for a render frame host, |
|
DaleCurtis
2017/03/24 17:47:12
Again technically descriptive, but doesn't really
|
| +// using the provided RendererAudioOutputStreamFactoryContext. |
| +class CONTENT_EXPORT RenderFrameAudioOutputStreamFactory |
| + : public mojom::RendererAudioOutputStreamFactory { |
| + public: |
| + RenderFrameAudioOutputStreamFactory( |
| + RendererAudioOutputStreamFactoryContext* context, |
| + int render_frame_id); |
| + |
| + ~RenderFrameAudioOutputStreamFactory() override; |
| + |
| + private: |
| + using OutputStreamProviderVector = |
| + std::vector<std::unique_ptr<media::mojom::AudioOutputStreamProvider>>; |
| + |
| + // mojom::RendererAudioOutputStreamFactory implementation. |
| + void RequestDeviceAuthorization( |
| + media::mojom::AudioOutputStreamProviderRequest stream_provider, |
| + int64_t session_id, |
|
DaleCurtis
2017/03/24 17:47:12
For session_id, should we start using base::Ungues
Max Morin
2017/03/27 14:40:50
Replied to a comment in cc file.
|
| + const std::string& device_id, |
| + const url::Origin& origin, |
| + const RequestDeviceAuthorizationCallback& callback) override; |
| + |
| + void AuthorizationCompleted( |
| + const url::Origin& origin, |
| + base::TimeTicks auth_start_time, |
| + media::mojom::AudioOutputStreamProviderRequest request, |
| + const RequestDeviceAuthorizationCallback& callback, |
| + media::OutputDeviceStatus status, |
| + bool should_send_id, |
| + const media::AudioParameters& params, |
| + const std::string& raw_device_id); |
| + |
| + void RemoveStream(media::mojom::AudioOutputStreamProvider* stream_provider); |
| + |
| + base::ThreadChecker thread_checker_; |
| + RendererAudioOutputStreamFactoryContext* const context_; |
| + // The stream providers will contain the corresponding streams. |
| + OutputStreamProviderVector stream_providers_; |
| + const int render_frame_id_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(RenderFrameAudioOutputStreamFactory); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_RENDER_FRAME_AUDIO_OUTPUT_STREAM_FACTORY_H_ |