| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // which must be AFTER the |promise| is resolved. Otherwise, the session ID | 114 // which must be AFTER the |promise| is resolved. Otherwise, the session ID |
| 115 // in the callback will not be recognized. | 115 // in the callback will not be recognized. |
| 116 // 3. UpdateSession(), CloseSession() and RemoveSession() should only be | 116 // 3. UpdateSession(), CloseSession() and RemoveSession() should only be |
| 117 // called after the |promise| is resolved. | 117 // called after the |promise| is resolved. |
| 118 virtual void CreateSessionAndGenerateRequest( | 118 virtual void CreateSessionAndGenerateRequest( |
| 119 SessionType session_type, | 119 SessionType session_type, |
| 120 EmeInitDataType init_data_type, | 120 EmeInitDataType init_data_type, |
| 121 const std::vector<uint8_t>& init_data, | 121 const std::vector<uint8_t>& init_data, |
| 122 std::unique_ptr<NewSessionCdmPromise> promise) = 0; | 122 std::unique_ptr<NewSessionCdmPromise> promise) = 0; |
| 123 | 123 |
| 124 // Loads a session with the |session_id| provided. | 124 // Loads a session with the |session_id| provided. Resolves the |promise| with |
| 125 // |session_id| if the session is successfully loaded. Resolves the |promise| |
| 126 // with an empty session ID if the session cannot be found. Rejects the |
| 127 // |promise| if session loading is not supported, or other unexpected failure |
| 128 // happened. |
| 125 // Note: UpdateSession(), CloseSession() and RemoveSession() should only be | 129 // Note: UpdateSession(), CloseSession() and RemoveSession() should only be |
| 126 // called after the |promise| is resolved. | 130 // called after the |promise| is resolved. |
| 127 virtual void LoadSession(SessionType session_type, | 131 virtual void LoadSession(SessionType session_type, |
| 128 const std::string& session_id, | 132 const std::string& session_id, |
| 129 std::unique_ptr<NewSessionCdmPromise> promise) = 0; | 133 std::unique_ptr<NewSessionCdmPromise> promise) = 0; |
| 130 | 134 |
| 131 // Updates a session specified by |session_id| with |response|. | 135 // Updates a session specified by |session_id| with |response|. |
| 132 virtual void UpdateSession(const std::string& session_id, | 136 virtual void UpdateSession(const std::string& session_id, |
| 133 const std::vector<uint8_t>& response, | 137 const std::vector<uint8_t>& response, |
| 134 std::unique_ptr<SimpleCdmPromise> promise) = 0; | 138 std::unique_ptr<SimpleCdmPromise> promise) = 0; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 202 |
| 199 // Called when the CDM changes the expiration time of a session. | 203 // Called when the CDM changes the expiration time of a session. |
| 200 // See http://w3c.github.io/encrypted-media/#update-expiration | 204 // See http://w3c.github.io/encrypted-media/#update-expiration |
| 201 typedef base::Callback<void(const std::string& session_id, | 205 typedef base::Callback<void(const std::string& session_id, |
| 202 const base::Time& new_expiry_time)> | 206 const base::Time& new_expiry_time)> |
| 203 SessionExpirationUpdateCB; | 207 SessionExpirationUpdateCB; |
| 204 | 208 |
| 205 } // namespace media | 209 } // namespace media |
| 206 | 210 |
| 207 #endif // MEDIA_BASE_MEDIA_KEYS_H_ | 211 #endif // MEDIA_BASE_MEDIA_KEYS_H_ |
| OLD | NEW |