OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_BASE_MEDIA_KEYS_H_ | 5 #ifndef MEDIA_BASE_MEDIA_KEYS_H_ |
6 #define MEDIA_BASE_MEDIA_KEYS_H_ | 6 #define MEDIA_BASE_MEDIA_KEYS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // that thread. For example, if the CDM supports a Decryptor interface, the | 59 // that thread. For example, if the CDM supports a Decryptor interface, the |
60 // Decryptor methods could be called on a different thread. The CDM | 60 // Decryptor methods could be called on a different thread. The CDM |
61 // implementation should make sure it's thread safe for these situations. | 61 // implementation should make sure it's thread safe for these situations. |
62 // | 62 // |
63 // TODO(xhwang): Rename MediaKeys to ContentDecryptionModule. See | 63 // TODO(xhwang): Rename MediaKeys to ContentDecryptionModule. See |
64 // http://crbug.com/309237 | 64 // http://crbug.com/309237 |
65 | 65 |
66 class MEDIA_EXPORT MediaKeys | 66 class MEDIA_EXPORT MediaKeys |
67 : public base::RefCountedThreadSafe<MediaKeys, MediaKeysTraits> { | 67 : public base::RefCountedThreadSafe<MediaKeys, MediaKeysTraits> { |
68 public: | 68 public: |
69 // TODO(xhwang): Remove after prefixed EME support is removed. See | |
70 // http://crbug.com/249976 | |
71 // Must be a superset of cdm::MediaKeyException. | |
72 enum Exception { | |
73 NOT_SUPPORTED_ERROR, | |
74 INVALID_STATE_ERROR, | |
75 INVALID_ACCESS_ERROR, | |
76 QUOTA_EXCEEDED_ERROR, | |
77 UNKNOWN_ERROR, | |
78 CLIENT_ERROR, | |
79 OUTPUT_ERROR, | |
80 EXCEPTION_MAX = OUTPUT_ERROR | |
81 }; | |
82 | |
83 // Type of license required when creating/loading a session. | 69 // Type of license required when creating/loading a session. |
84 // Must be consistent with the values specified in the spec: | 70 // Must be consistent with the values specified in the spec: |
85 // https://w3c.github.io/encrypted-media/#idl-def-MediaKeySessionType | 71 // https://w3c.github.io/encrypted-media/#idl-def-MediaKeySessionType |
86 enum SessionType { | 72 enum SessionType { |
87 TEMPORARY_SESSION, | 73 TEMPORARY_SESSION, |
88 PERSISTENT_LICENSE_SESSION, | 74 PERSISTENT_LICENSE_SESSION, |
89 PERSISTENT_RELEASE_MESSAGE_SESSION, | 75 PERSISTENT_RELEASE_MESSAGE_SESSION, |
90 SESSION_TYPE_MAX = PERSISTENT_RELEASE_MESSAGE_SESSION | 76 SESSION_TYPE_MAX = PERSISTENT_RELEASE_MESSAGE_SESSION |
91 }; | 77 }; |
92 | 78 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 188 |
203 // Called when the CDM changes the expiration time of a session. | 189 // Called when the CDM changes the expiration time of a session. |
204 // See http://w3c.github.io/encrypted-media/#update-expiration | 190 // See http://w3c.github.io/encrypted-media/#update-expiration |
205 typedef base::Callback<void(const std::string& session_id, | 191 typedef base::Callback<void(const std::string& session_id, |
206 const base::Time& new_expiry_time)> | 192 const base::Time& new_expiry_time)> |
207 SessionExpirationUpdateCB; | 193 SessionExpirationUpdateCB; |
208 | 194 |
209 } // namespace media | 195 } // namespace media |
210 | 196 |
211 #endif // MEDIA_BASE_MEDIA_KEYS_H_ | 197 #endif // MEDIA_BASE_MEDIA_KEYS_H_ |
OLD | NEW |