| 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> |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 // Updates a session specified by |session_id| with |response|. | 119 // Updates a session specified by |session_id| with |response|. |
| 120 virtual void UpdateSession(const std::string& session_id, | 120 virtual void UpdateSession(const std::string& session_id, |
| 121 const std::vector<uint8_t>& response, | 121 const std::vector<uint8_t>& response, |
| 122 std::unique_ptr<SimpleCdmPromise> promise) = 0; | 122 std::unique_ptr<SimpleCdmPromise> promise) = 0; |
| 123 | 123 |
| 124 // Closes the session specified by |session_id|. The CDM should resolve or | 124 // Closes the session specified by |session_id|. The CDM should resolve or |
| 125 // reject the |promise| when the call has been processed. This may be before | 125 // reject the |promise| when the call has been processed. This may be before |
| 126 // the session is closed. Once the session is closed, a SessionClosedCB must | 126 // the session is closed. Once the session is closed, a SessionClosedCB must |
| 127 // also be called. | 127 // also be called. |
| 128 // Note that the EME spec executes the close() action asynchronously, so |
| 129 // CloseSession() may be called multiple times on the same session. |
| 128 virtual void CloseSession(const std::string& session_id, | 130 virtual void CloseSession(const std::string& session_id, |
| 129 std::unique_ptr<SimpleCdmPromise> promise) = 0; | 131 std::unique_ptr<SimpleCdmPromise> promise) = 0; |
| 130 | 132 |
| 131 // Removes stored session data associated with the session specified by | 133 // Removes stored session data associated with the session specified by |
| 132 // |session_id|. | 134 // |session_id|. |
| 133 virtual void RemoveSession(const std::string& session_id, | 135 virtual void RemoveSession(const std::string& session_id, |
| 134 std::unique_ptr<SimpleCdmPromise> promise) = 0; | 136 std::unique_ptr<SimpleCdmPromise> promise) = 0; |
| 135 | 137 |
| 136 // Returns the CdmContext associated with |this|. The returned CdmContext is | 138 // Returns the CdmContext associated with |this|. The returned CdmContext is |
| 137 // owned by |this| and the caller needs to make sure it is not used after | 139 // owned by |this| and the caller needs to make sure it is not used after |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 190 |
| 189 // Called when the CDM changes the expiration time of a session. | 191 // Called when the CDM changes the expiration time of a session. |
| 190 // See http://w3c.github.io/encrypted-media/#update-expiration | 192 // See http://w3c.github.io/encrypted-media/#update-expiration |
| 191 typedef base::Callback<void(const std::string& session_id, | 193 typedef base::Callback<void(const std::string& session_id, |
| 192 base::Time new_expiry_time)> | 194 base::Time new_expiry_time)> |
| 193 SessionExpirationUpdateCB; | 195 SessionExpirationUpdateCB; |
| 194 | 196 |
| 195 } // namespace media | 197 } // namespace media |
| 196 | 198 |
| 197 #endif // MEDIA_BASE_CONTENT_DECRYPTION_MODULE_H_ | 199 #endif // MEDIA_BASE_CONTENT_DECRYPTION_MODULE_H_ |
| OLD | NEW |