// Copyright 2017 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. module media.mojom; import "media/mojo/mojom/content_decryption_module.mojom"; import "media/mojo/mojom/frame_interface_factory.mojom"; import "mojo/public/mojom/base/file_path.mojom"; import "sandbox/policy/mojom/sandbox.mojom"; import "services/service_manager/public/mojom/interface_provider.mojom"; [EnableIf=is_mac] import "sandbox/mac/mojom/seatbelt_extension_token.mojom"; // A service to create a CdmFactory that can provide CDM service, typically // to the media pipeline running in the renderer process. The service itself // runs in the CDM (utility) process. The service is always connected from the // browser process. interface CdmService { // Requests an CdmFactory. `frame_interfaces` can optionally be used to // provide interfaces hosted by the caller to the remote CdmFactory // implementation. CreateCdmFactory(pending_receiver factory, pending_remote frame_interfaces); }; // An interface to provide a sandbox seatbelt extension token synchronously. [EnableIf=is_mac] interface SeatbeltExtensionTokenProvider { [Sync] GetTokens() => (array tokens); }; // A broker service to get the `CdmService`, needed to pass necessary parameters // to preload the CDM before creating the `CdmService`. The `CdmServiceBroker` // runs in the CDM (utility) process and is connected from the browser process // (see content/browser/media/service_factory.cc). In the process there should // only be one `CdmServiceBroker` and one `CdmService` instance running. As such // the `GetService()` should only be called once and the subsequent calls will // simply fail. // // Notes on CDM preloading and sandbox: // - On Windows, when `CdmServiceBroker` is connected the CDM was not sandboxed // to allow CDM preloading. After `GetService()` the process is fully sandboxed. // - On Mac, the process is fully sandboxed when launched, and `token_provider` // is needed to help load the CDM in the process. // - On Linux/ChromeOS, the CDM is preloaded in the zygote sandbox. [ServiceSandbox=sandbox.mojom.Sandbox.kCdm] interface CdmServiceBroker { // Loads the CDM at `cdm_path` into the process and returns the `CdmService`. GetService(mojo_base.mojom.FilePath cdm_path, [EnableIf=is_mac] pending_remote? token_provider, pending_receiver receiver); };