Upload upstream chromium 94.0.4606.31
[platform/framework/web/chromium-efl.git] / media / mojo / mojom / cdm_document_service.mojom
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.
4
5 // TODO(xhwang): Move this out of media if it is needed anywhere else.
6 module media.mojom;
7
8 import "mojo/public/mojom/base/unguessable_token.mojom";
9
10 // Contains data linked to an origin that the CDM stores in the Preference
11 // Service.
12 [EnableIf=is_win]
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;
18
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;
22 };
23
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
26 // the CDM.
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.
31   //
32   // Input parameters:
33   // - |service_id|: the service ID for the |challenge|.
34   // - |challenge|: the challenge data.
35   //
36   // Output parameters:
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
42   //                               requested service.
43   ChallengePlatform(string service_id, string challenge) =>
44       (bool success,
45        string signed_data,
46        string signed_data_signature,
47        string platform_key_certificate);
48
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);
53
54   // Returns true if Verified Access is enabled in settings, false otherwise.
55   [EnableIf=is_chromeos]
56   IsVerifiedAccessEnabled() => (bool enabled);
57
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
60   //                          with the CDM.
61   [EnableIf=is_win]
62   GetCdmPreferenceData() => (CdmPreferenceData cdm_preference_data);
63
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.
67   [EnableIf=is_win]
68   SetCdmClientToken(array<uint8> client_token);
69 };