1 // Copyright 2015 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 "mojo/public/mojom/base/unguessable_token.mojom";
8 import "mojo/public/mojom/base/file_path.mojom";
9 import "media/mojo/mojom/media_types.mojom";
11 // Contains data linked to an origin that the CDM stores in the browser
14 struct MediaFoundationCdmData {
15 // The origin ID of the document associated with the CDM. The origin ID
16 // is used in place of the origin when hiding the concrete origin is needed.
17 // The origin ID is also user resettable by clearing the browsing data.
18 mojo_base.mojom.UnguessableToken origin_id;
20 // The token is set by the CDM. The token is then saved in the Pref Service so
21 // that it can be reused by the CDM for that same origin in the future.
22 array<uint8>? client_token;
24 // The path where the MediaFoundation CDM should store its data. The path is
25 // specific to the current chrome user and the device's architecture.
26 mojo_base.mojom.FilePath cdm_store_path_root;
29 // The service itself is associated with a RenderFrameHost in the browser
30 // process and will be called by a client living in the utility process hosting
32 interface CdmDocumentService {
33 // Allows authorized services to verify that the underlying platform is
34 // trusted. An example of a trusted platform is a Chrome OS device in
35 // verified boot mode. This can be used for protected content playback.
38 // - |service_id|: the service ID for the |challenge|.
39 // - |challenge|: the challenge data.
42 // - |success|: whether the platform is successfully verified. If true/false
43 // the following 3 parameters should be non-empty/empty.
44 // - |signed_data|: the data signed by the platform.
45 // - |signed_data_signature|: the signature of the signed data block.
46 // - |platform_key_certificate|: the device specific certificate for the
48 ChallengePlatform(string service_id, string challenge) =>
51 string signed_data_signature,
52 string platform_key_certificate);
54 // Requests a particular version of the device's Storage Id (or latest
55 // available version if 0 is specified). This returns the requested
56 // |storage_id|, which may be empty if it is not supported by the platform.
57 GetStorageId(uint32 version) => (uint32 version, array<uint8> storage_id);
59 // Returns true if Verified Access is enabled in settings, false otherwise.
60 [EnableIf=is_chromeos]
61 IsVerifiedAccessEnabled() => (bool enabled);
63 // Gets the Media FoundationCDM data for the origin associated with the CDM.
64 // - `media_foundation_cdm_data`: The CDM data for the origin associated with
67 GetMediaFoundationCdmData() => (MediaFoundationCdmData cdm_data);
69 // Sets the client token for the origin associated with the CDM. The token is
70 // set by the CDM. The token is then saved in the Pref Service so that it can
71 // be reused by the CDM for that same origin in the future.
73 SetCdmClientToken(array<uint8> client_token);
75 // Reports a CDM event, which can facilitate metrics reporting or fallback
76 // logic. For error events, the `hresult` provides more details about the
79 OnCdmEvent(CdmEvent event, uint32 hresult);