OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_IMPL_H_ |
| 7 |
| 8 // In addition to being an AudioOutputServiceContext, this class also handles |
| 9 // requests for mojom::RendererAudioOutputService instances. |
| 10 |
| 11 #include <memory> |
| 12 #include <string> |
| 13 #include <vector> |
| 14 |
| 15 #include "content/browser/renderer_host/media/audio_output_service_context.h" |
| 16 #include "mojo/public/cpp/bindings/interface_request.h" |
| 17 |
| 18 namespace media { |
| 19 class AudioManager; |
| 20 } // namespace media |
| 21 |
| 22 namespace content { |
| 23 |
| 24 class MediaStreamManager; |
| 25 |
| 26 class CONTENT_EXPORT AudioOutputServiceContextImpl |
| 27 : public AudioOutputServiceContext { |
| 28 public: |
| 29 AudioOutputServiceContextImpl(int render_process_id, |
| 30 media::AudioManager* audio_manager, |
| 31 MediaStreamManager* media_stream_manager, |
| 32 const std::string& salt); |
| 33 |
| 34 ~AudioOutputServiceContextImpl() override; |
| 35 |
| 36 void CreateService( |
| 37 int frame_host_id, |
| 38 mojo::InterfaceRequest<mojom::RendererAudioOutputService> request); |
| 39 |
| 40 int GetRenderProcessId() const override; |
| 41 |
| 42 void RequestDeviceAuthorization( |
| 43 int render_frame_id, |
| 44 int session_id, |
| 45 const std::string& device_id, |
| 46 const url::Origin& security_origin, |
| 47 AuthorizationCompletedCallback cb) const override; |
| 48 |
| 49 const std::string& GetSalt() const override; |
| 50 |
| 51 std::unique_ptr<AudioOutputDelegate> CreateDelegate( |
| 52 const std::string& unique_device_id, |
| 53 int render_frame_id, |
| 54 AudioOutputDelegate::EventHandler* handler, |
| 55 const media::AudioParameters& params) override; |
| 56 |
| 57 void OnServiceFinished(mojom::RendererAudioOutputService* service) override; |
| 58 |
| 59 private: |
| 60 const int render_process_id_; |
| 61 media::AudioManager* const audio_manager_; |
| 62 MediaStreamManager* const media_stream_manager_; |
| 63 const std::string salt_; |
| 64 const AudioOutputAuthorizationHandler authorization_handler_; |
| 65 int next_stream_id_ = 0; |
| 66 std::vector<std::unique_ptr<mojom::RendererAudioOutputService>> services_; |
| 67 }; |
| 68 |
| 69 } // namespace content |
| 70 |
| 71 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_IMPL
_H_ |
OLD | NEW |