1 // Copyright 2015 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.
5 // TODO(xhwang): Move this out of media if it is needed anywhere else.
8 import "mojo/public/mojom/base/unguessable_token.mojom";
10 // Contains data linked to an origin that the CDM stores in the Preference
13 struct CdmPreferenceData {
14 // The origin ID of the document associated with the CDM. The origin ID
15 // is used in place of the origin when hiding the concrete origin is needed.
16 // The origin ID is also user resettable by clearing the browsing data.
17 mojo_base.mojom.UnguessableToken origin_id;
19 // The token is set by the CDM. The token is then saved in the Pref Service so
20 // that it can be reused by the CDM for that same origin in the future.
21 array<uint8>? client_token;
24 // The service itself is associated with a RenderFrameHost in the browser
25 // process and will be called by a client living in the utility process hosting
27 interface CdmDocumentService {
28 // Allows authorized services to verify that the underlying platform is
29 // trusted. An example of a trusted platform is a Chrome OS device in
30 // verified boot mode. This can be used for protected content playback.
33 // - |service_id|: the service ID for the |challenge|.
34 // - |challenge|: the challenge data.
37 // - |success|: whether the platform is successfully verified. If true/false
38 // the following 3 parameters should be non-empty/empty.
39 // - |signed_data|: the data signed by the platform.
40 // - |signed_data_signature|: the signature of the signed data block.
41 // - |platform_key_certificate|: the device specific certificate for the
43 ChallengePlatform(string service_id, string challenge) =>
46 string signed_data_signature,
47 string platform_key_certificate);
49 // Requests a particular version of the device's Storage Id (or latest
50 // available version if 0 is specified). This returns the requested
51 // |storage_id|, which may be empty if it is not supported by the platform.
52 GetStorageId(uint32 version) => (uint32 version, array<uint8> storage_id);
54 // Returns true if Verified Access is enabled in settings, false otherwise.
55 [EnableIf=is_chromeos]
56 IsVerifiedAccessEnabled() => (bool enabled);
58 // Gets the CDM preference data for the origin associated with the CDM.
59 // - `cdm_preference_data`: The CDM preference data for the origin associated
62 GetCdmPreferenceData() => (CdmPreferenceData cdm_preference_data);
64 // Sets the client token for the origin associated with the CDM. The token is
65 // set by the CDM. The token is then saved in the Pref Service so that it can
66 // be reused by the CDM for that same origin in the future.
68 SetCdmClientToken(array<uint8> client_token);