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_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_H_ |
| 7 |
| 8 // AudioOutputServiceContext provides functions common to all |
| 9 // AudioOutputService instances for a single renderer process. |
| 10 |
| 11 #include <memory> |
| 12 #include <string> |
| 13 |
| 14 #include "content/browser/renderer_host/media/audio_output_authorization_handler
.h" |
| 15 #include "content/browser/renderer_host/media/audio_output_delegate.h" |
| 16 #include "content/common/content_export.h" |
| 17 |
| 18 namespace media { |
| 19 class AudioParameters; |
| 20 } |
| 21 |
| 22 namespace content { |
| 23 |
| 24 namespace mojom { |
| 25 class RendererAudioOutputService; |
| 26 } // namespace mojom |
| 27 |
| 28 class CONTENT_EXPORT AudioOutputServiceContext { |
| 29 public: |
| 30 virtual ~AudioOutputServiceContext() {} |
| 31 |
| 32 using AuthorizationCompletedCallback = |
| 33 AudioOutputAuthorizationHandler::AuthorizationCompletedCallback; |
| 34 |
| 35 virtual int GetRenderProcessId() const = 0; |
| 36 virtual const std::string& GetSalt() const = 0; |
| 37 |
| 38 // Called to request access to a device on behalf of the renderer. |
| 39 virtual void RequestDeviceAuthorization( |
| 40 int render_frame_id, |
| 41 int session_id, |
| 42 const std::string& device_id, |
| 43 const url::Origin& security_origin, |
| 44 AuthorizationCompletedCallback cb) const = 0; |
| 45 |
| 46 virtual std::unique_ptr<AudioOutputDelegate> CreateDelegate( |
| 47 const std::string& unique_device_id, |
| 48 int render_frame_id, |
| 49 AudioOutputDelegate::EventHandler* handler, |
| 50 const media::AudioParameters& params) = 0; |
| 51 |
| 52 // Should be called by a service when it's done or has encountered an error. |
| 53 virtual void OnServiceFinished( |
| 54 mojom::RendererAudioOutputService* service) = 0; |
| 55 }; |
| 56 |
| 57 } // namespace content |
| 58 |
| 59 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_H_ |
OLD | NEW |