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_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ | 5 #ifndef MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ |
6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ | 6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 private: | 86 private: |
87 // Emulates a session stored for |session_id_for_emulated_loadsession_|. This | 87 // Emulates a session stored for |session_id_for_emulated_loadsession_|. This |
88 // is necessary since aes_decryptor.cc does not support storing sessions. | 88 // is necessary since aes_decryptor.cc does not support storing sessions. |
89 void LoadLoadableSession(); | 89 void LoadLoadableSession(); |
90 | 90 |
91 // ContentDecryptionModule callbacks. | 91 // ContentDecryptionModule callbacks. |
92 void OnSessionMessage(const std::string& web_session_id, | 92 void OnSessionMessage(const std::string& web_session_id, |
93 const std::vector<uint8>& message, | 93 const std::vector<uint8>& message, |
94 const GURL& destination_url); | 94 const GURL& destination_url); |
| 95 void OnSessionKeysChange(const std::string& web_session_id, |
| 96 bool has_additional_usable_key); |
95 void OnSessionClosed(const std::string& web_session_id); | 97 void OnSessionClosed(const std::string& web_session_id); |
96 | 98 |
97 // Handle the success/failure of a promise. These methods are responsible for | 99 // Handle the success/failure of a promise. These methods are responsible for |
98 // calling |host_| to resolve or reject the promise. | 100 // calling |host_| to resolve or reject the promise. |
99 void OnSessionCreated(uint32 promise_id, const std::string& web_session_id); | 101 void OnSessionCreated(uint32 promise_id, const std::string& web_session_id); |
100 void OnSessionLoaded(uint32 promise_id, const std::string& web_session_id); | 102 void OnSessionLoaded(uint32 promise_id, const std::string& web_session_id); |
101 void OnSessionUpdated(uint32 promise_id, const std::string& web_session_id); | 103 void OnSessionUpdated(uint32 promise_id, const std::string& web_session_id); |
102 void OnSessionReleased(uint32 promise_id, const std::string& web_session_id); | |
103 void OnUsableKeyIdsObtained(uint32 promise_id, const KeyIdsVector& key_ids); | 104 void OnUsableKeyIdsObtained(uint32 promise_id, const KeyIdsVector& key_ids); |
| 105 void OnPromiseResolved(uint32 promise_id); |
104 void OnPromiseFailed(uint32 promise_id, | 106 void OnPromiseFailed(uint32 promise_id, |
105 MediaKeys::Exception exception_code, | 107 MediaKeys::Exception exception_code, |
106 uint32 system_code, | 108 uint32 system_code, |
107 const std::string& error_message); | 109 const std::string& error_message); |
108 | 110 |
109 // Prepares next heartbeat message and sets a timer for it. | 111 // Prepares next heartbeat message and sets a timer for it. |
110 void ScheduleNextHeartBeat(); | 112 void ScheduleNextHeartBeat(); |
111 | 113 |
112 // Decrypts the |encrypted_buffer| and puts the result in |decrypted_buffer|. | 114 // Decrypts the |encrypted_buffer| and puts the result in |decrypted_buffer|. |
113 // Returns cdm::kSuccess if decryption succeeded. The decrypted result is | 115 // Returns cdm::kSuccess if decryption succeeded. The decrypted result is |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 scoped_ptr<CdmVideoDecoder> video_decoder_; | 191 scoped_ptr<CdmVideoDecoder> video_decoder_; |
190 | 192 |
191 scoped_ptr<FileIOTestRunner> file_io_test_runner_; | 193 scoped_ptr<FileIOTestRunner> file_io_test_runner_; |
192 | 194 |
193 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); | 195 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); |
194 }; | 196 }; |
195 | 197 |
196 } // namespace media | 198 } // namespace media |
197 | 199 |
198 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ | 200 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ |
OLD | NEW |