| 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 <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/compiler_specific.h" | 14 #include "base/compiler_specific.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/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 18 #include "media/base/cdm_key_information.h" | 18 #include "media/base/cdm_key_information.h" |
| 19 #include "media/base/cdm_promise.h" |
| 19 #include "media/cdm/aes_decryptor.h" | 20 #include "media/cdm/aes_decryptor.h" |
| 20 #include "media/cdm/ppapi/external_clear_key/clear_key_cdm_common.h" | 21 #include "media/cdm/ppapi/external_clear_key/clear_key_cdm_common.h" |
| 21 | 22 |
| 22 // Enable this to use the fake decoder for testing. | 23 // Enable this to use the fake decoder for testing. |
| 23 // TODO(tomfinegan): Move fake audio decoder into a separate class. | 24 // TODO(tomfinegan): Move fake audio decoder into a separate class. |
| 24 #if 0 | 25 #if 0 |
| 25 #define CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER | 26 #define CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER |
| 26 #endif | 27 #endif |
| 27 | 28 |
| 28 class GURL; | 29 class GURL; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 bool has_additional_usable_key, | 100 bool has_additional_usable_key, |
| 100 CdmKeysInfo keys_info); | 101 CdmKeysInfo keys_info); |
| 101 void OnSessionClosed(const std::string& session_id); | 102 void OnSessionClosed(const std::string& session_id); |
| 102 | 103 |
| 103 // Handle the success/failure of a promise. These methods are responsible for | 104 // Handle the success/failure of a promise. These methods are responsible for |
| 104 // calling |host_| to resolve or reject the promise. | 105 // calling |host_| to resolve or reject the promise. |
| 105 void OnSessionCreated(uint32_t promise_id, const std::string& session_id); | 106 void OnSessionCreated(uint32_t promise_id, const std::string& session_id); |
| 106 void OnSessionLoaded(uint32_t promise_id, const std::string& session_id); | 107 void OnSessionLoaded(uint32_t promise_id, const std::string& session_id); |
| 107 void OnPromiseResolved(uint32_t promise_id); | 108 void OnPromiseResolved(uint32_t promise_id); |
| 108 void OnPromiseFailed(uint32_t promise_id, | 109 void OnPromiseFailed(uint32_t promise_id, |
| 109 MediaKeys::Exception exception_code, | 110 CdmPromise::Exception exception_code, |
| 110 uint32_t system_code, | 111 uint32_t system_code, |
| 111 const std::string& error_message); | 112 const std::string& error_message); |
| 112 | 113 |
| 113 // Prepares next renewal message and sets a timer for it. | 114 // Prepares next renewal message and sets a timer for it. |
| 114 void ScheduleNextRenewal(); | 115 void ScheduleNextRenewal(); |
| 115 | 116 |
| 116 // Decrypts the |encrypted_buffer| and puts the result in |decrypted_buffer|. | 117 // Decrypts the |encrypted_buffer| and puts the result in |decrypted_buffer|. |
| 117 // Returns cdm::kSuccess if decryption succeeded. The decrypted result is | 118 // Returns cdm::kSuccess if decryption succeeded. The decrypted result is |
| 118 // put in |decrypted_buffer|. If |encrypted_buffer| is empty, the | 119 // put in |decrypted_buffer|. If |encrypted_buffer| is empty, the |
| 119 // |decrypted_buffer| is set to an empty (EOS) buffer. | 120 // |decrypted_buffer| is set to an empty (EOS) buffer. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 std::unique_ptr<FileIOTestRunner> file_io_test_runner_; | 214 std::unique_ptr<FileIOTestRunner> file_io_test_runner_; |
| 214 | 215 |
| 215 bool is_running_output_protection_test_; | 216 bool is_running_output_protection_test_; |
| 216 | 217 |
| 217 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); | 218 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); |
| 218 }; | 219 }; |
| 219 | 220 |
| 220 } // namespace media | 221 } // namespace media |
| 221 | 222 |
| 222 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ | 223 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ |
| OLD | NEW |