1 // Copyright 2020 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 import "media/mojo/mojom/cdm_storage.mojom";
8 import "media/mojo/mojom/provision_fetcher.mojom";
9 import "mojo/public/mojom/base/generic_pending_receiver.mojom";
10 import "url/mojom/origin.mojom";
12 import "media/mojo/mojom/dcomp_surface_registry.mojom";
14 // Implemented by things like audio playback in the utility process to respond
15 // to mute state changes (e.g. the user checks "Mute Site" or "Unmute Site" on a
18 interface MuteStateObserver {
19 // Notifies mute state change.
20 OnMuteStateChange(bool muted);
23 // A factory providing extra services for media mojo services running remotely.
24 // The implementation of this interface lives in the browser process and
25 // is bound to a RenderFrameHost (see MediaInterfaceProxy). Interfaces created
26 // via this interface also live in the browser process and are mostly bound to
27 // a document's lifetime.
28 interface FrameInterfaceFactory {
29 // Binds the ProvisionFetcher for the frame.
30 CreateProvisionFetcher(pending_receiver<ProvisionFetcher> provision_fetcher);
32 // Binds the CdmStorage for the frame. This requires that the frame have
33 // CDM storage available.
34 CreateCdmStorage(pending_receiver<CdmStorage> cdm_storage);
36 // Registers `site_mute_observer` to get notified of site mute state changes.
38 RegisterMuteStateObserver(
39 pending_remote<MuteStateObserver> site_mute_observer);
41 // Binds a DCOMPSurfaceRegistry to register a surface handle in GPU process.
43 CreateDCOMPSurfaceRegistry(pending_receiver<DCOMPSurfaceRegistry> registry);
45 // Gets the origin of the frame associated with the CDM.
47 GetCdmOrigin() => (url.mojom.Origin cdm_origin);
49 // Binds a generic media frame-bound interface. This is to allow //content
50 // embedders to provide additional interfaces.
51 BindEmbedderReceiver(mojo_base.mojom.GenericPendingReceiver receiver);