1 // Copyright 2017 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";
10 // see media::MediaDrmKeyType
14 array<uint8> key_set_id;
19 // Allows MediaDrmBridge to store and retrieve persistent data. This is needed
20 // for features like per-origin provisioning and persistent license support.
21 // The persistent data stored by MediaDrmStorage is auxiliary data, which will
22 // be used by MediaDrmBridge to retrieve the actual license. MediaDrm in media
23 // service is the true source for the persistent license and origin
25 interface MediaDrmStorage {
26 // Initializes |this| and if successful (|success| = true) returns an origin
27 // ID that can be used to identify the current origin. If |origin_id| is
28 // not empty, then it must be valid and unique among all origins. The
29 // implementation will persist the information (e.g. origin ID, provision
30 // time) in the storage. If |origin_id| is empty, then device-wide
31 // provisioning is to be used. If Initialize() fails or returns an empty
32 // origin ID then the other methods below should not be called, and will
33 // fail if they are called.
34 Initialize() => (bool success, mojo_base.mojom.UnguessableToken? origin_id);
36 // Saves origin information (e.g. origin ID, provision time) in the storage
37 // after MediaDrm is provisioned for current origin. It will clear all
38 // existing persistent session data for the origin.
39 OnProvisioned() => (bool success);
41 // Saves persistent session data for |session_id|.
42 SavePersistentSession(
43 string session_id, SessionData session_data) => (bool success);
45 // Loads persistent session data for |session_id|.
46 // Upon failure, null |session_data| will be returned.
47 LoadPersistentSession(string session_id) => (SessionData? session_data);
49 // Removes the persistent session data for |session_id|.
50 RemovePersistentSession(string session_id) => (bool success);