| 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_CONTENT_DECRYPTION_MODULE_H_ | 5 #ifndef MEDIA_BASE_CONTENT_DECRYPTION_MODULE_H_ |
| 6 #define MEDIA_BASE_CONTENT_DECRYPTION_MODULE_H_ | 6 #define MEDIA_BASE_CONTENT_DECRYPTION_MODULE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_vector.h" |
| 17 #include "media/base/eme_constants.h" | 18 #include "media/base/eme_constants.h" |
| 18 #include "media/base/media_export.h" | 19 #include "media/base/media_export.h" |
| 19 #include "url/gurl.h" | 20 #include "url/gurl.h" |
| 20 | 21 |
| 21 namespace base { | 22 namespace base { |
| 22 class Time; | 23 class Time; |
| 23 } | 24 } |
| 24 | 25 |
| 25 namespace media { | 26 namespace media { |
| 26 | 27 |
| 27 class CdmContext; | 28 class CdmContext; |
| 28 struct CdmKeyInformation; | 29 struct CdmKeyInformation; |
| 29 struct ContentDecryptionModuleTraits; | 30 struct ContentDecryptionModuleTraits; |
| 30 | 31 |
| 31 template <typename... T> | 32 template <typename... T> |
| 32 class CdmPromiseTemplate; | 33 class CdmPromiseTemplate; |
| 33 | 34 |
| 34 typedef CdmPromiseTemplate<std::string> NewSessionCdmPromise; | 35 typedef CdmPromiseTemplate<std::string> NewSessionCdmPromise; |
| 35 typedef CdmPromiseTemplate<> SimpleCdmPromise; | 36 typedef CdmPromiseTemplate<> SimpleCdmPromise; |
| 36 typedef std::vector<std::unique_ptr<CdmKeyInformation>> CdmKeysInfo; | 37 typedef ScopedVector<CdmKeyInformation> CdmKeysInfo; |
| 37 | 38 |
| 38 // Type of license required when creating/loading a session. | 39 // Type of license required when creating/loading a session. |
| 39 // Must be consistent with the values specified in the spec: | 40 // Must be consistent with the values specified in the spec: |
| 40 // https://w3c.github.io/encrypted-media/#idl-def-MediaKeySessionType | 41 // https://w3c.github.io/encrypted-media/#idl-def-MediaKeySessionType |
| 41 enum class CdmSessionType { | 42 enum class CdmSessionType { |
| 42 TEMPORARY_SESSION, | 43 TEMPORARY_SESSION, |
| 43 PERSISTENT_LICENSE_SESSION, | 44 PERSISTENT_LICENSE_SESSION, |
| 44 PERSISTENT_RELEASE_MESSAGE_SESSION, | 45 PERSISTENT_RELEASE_MESSAGE_SESSION, |
| 45 SESSION_TYPE_MAX = PERSISTENT_RELEASE_MESSAGE_SESSION | 46 SESSION_TYPE_MAX = PERSISTENT_RELEASE_MESSAGE_SESSION |
| 46 }; | 47 }; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 // A null base::Time() will be translated to NaN in Javascript, which means "no | 192 // A null base::Time() will be translated to NaN in Javascript, which means "no |
| 192 // such time exists or if the license explicitly never expires, as determined | 193 // such time exists or if the license explicitly never expires, as determined |
| 193 // by the CDM", according to the EME spec. | 194 // by the CDM", according to the EME spec. |
| 194 typedef base::Callback<void(const std::string& session_id, | 195 typedef base::Callback<void(const std::string& session_id, |
| 195 base::Time new_expiry_time)> | 196 base::Time new_expiry_time)> |
| 196 SessionExpirationUpdateCB; | 197 SessionExpirationUpdateCB; |
| 197 | 198 |
| 198 } // namespace media | 199 } // namespace media |
| 199 | 200 |
| 200 #endif // MEDIA_BASE_CONTENT_DECRYPTION_MODULE_H_ | 201 #endif // MEDIA_BASE_CONTENT_DECRYPTION_MODULE_H_ |
| OLD | NEW |