| Index: content/browser/renderer_host/media/audio_output_service_context.h
|
| diff --git a/content/browser/renderer_host/media/audio_output_service_context.h b/content/browser/renderer_host/media/audio_output_service_context.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..88556c108d9a56fd2dc40d7651af11703abea1e0
|
| --- /dev/null
|
| +++ b/content/browser/renderer_host/media/audio_output_service_context.h
|
| @@ -0,0 +1,59 @@
|
| +// 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_AUDIO_OUTPUT_SERVICE_CONTEXT_H_
|
| +#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_H_
|
| +
|
| +// AudioOutputServiceContext provides functions common to all
|
| +// AudioOutputService instances for a single renderer process.
|
| +
|
| +#include <memory>
|
| +#include <string>
|
| +
|
| +#include "content/browser/renderer_host/media/audio_output_authorization_handler.h"
|
| +#include "content/browser/renderer_host/media/audio_output_delegate.h"
|
| +#include "content/common/content_export.h"
|
| +
|
| +namespace media {
|
| +class AudioParameters;
|
| +}
|
| +
|
| +namespace content {
|
| +
|
| +namespace mojom {
|
| +class RendererAudioOutputService;
|
| +} // namespace mojom
|
| +
|
| +class CONTENT_EXPORT AudioOutputServiceContext {
|
| + public:
|
| + virtual ~AudioOutputServiceContext() {}
|
| +
|
| + using AuthorizationCompletedCallback =
|
| + AudioOutputAuthorizationHandler::AuthorizationCompletedCallback;
|
| +
|
| + virtual int GetRenderProcessId() const = 0;
|
| + virtual const std::string& GetSalt() const = 0;
|
| +
|
| + // Called to request access to a device on behalf of the renderer.
|
| + virtual void RequestDeviceAuthorization(
|
| + int render_frame_id,
|
| + int session_id,
|
| + const std::string& device_id,
|
| + const url::Origin& security_origin,
|
| + AuthorizationCompletedCallback cb) const = 0;
|
| +
|
| + virtual std::unique_ptr<AudioOutputDelegate> CreateDelegate(
|
| + const std::string& unique_device_id,
|
| + int render_frame_id,
|
| + AudioOutputDelegate::EventHandler* handler,
|
| + const media::AudioParameters& params) = 0;
|
| +
|
| + // Should be called by a service when it's done or has encountered an error.
|
| + virtual void OnServiceFinished(
|
| + mojom::RendererAudioOutputService* service) = 0;
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_H_
|
|
|