Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ | 5 #ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ |
| 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ | 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 14 #include "media/base/decryptor_client.h" | 14 #include "media/base/decryptor_client.h" |
| 15 #include "media/crypto/aes_decryptor.h" | 15 #include "media/crypto/aes_decryptor.h" |
| 16 #include "webkit/media/crypto/ppapi/content_decryption_module.h" | 16 #include "webkit/media/crypto/ppapi/content_decryption_module.h" |
| 17 | 17 |
| 18 namespace media { | 18 namespace media { |
| 19 class DecoderBuffer; | 19 class DecoderBuffer; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace webkit_media { | 22 namespace webkit_media { |
| 23 | 23 |
| 24 // Clear key implementation of the cdm::ContentDecryptionModule interface. | 24 // Clear key implementation of the cdm::ContentDecryptionModule interface. |
| 25 class ClearKeyCdm : public cdm::ContentDecryptionModule { | 25 class ClearKeyCdm : public cdm::ContentDecryptionModule { |
| 26 public: | 26 public: |
| 27 ClearKeyCdm(); | 27 explicit ClearKeyCdm(cdm::CdmAllocator* allocator); |
| 28 virtual ~ClearKeyCdm(); | 28 virtual ~ClearKeyCdm(); |
| 29 | 29 |
| 30 // ContentDecryptionModule implementation. | 30 // ContentDecryptionModule implementation. |
| 31 virtual cdm::Status GenerateKeyRequest(const uint8_t* init_data, | 31 virtual cdm::Status GenerateKeyRequest(const uint8_t* init_data, |
| 32 int init_data_size, | 32 int init_data_size, |
| 33 cdm::KeyMessage* key_request) OVERRIDE; | 33 cdm::KeyMessage* key_request) OVERRIDE; |
| 34 virtual cdm::Status AddKey(const char* session_id, | 34 virtual cdm::Status AddKey(const char* session_id, |
| 35 int session_id_size, | 35 int session_id_size, |
| 36 const uint8_t* key, | 36 const uint8_t* key, |
| 37 int key_size, | 37 int key_size, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 int init_data_length) OVERRIDE; | 89 int init_data_length) OVERRIDE; |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 Status status_; | 92 Status status_; |
| 93 std::string session_id_; | 93 std::string session_id_; |
| 94 scoped_array<uint8> key_message_; | 94 scoped_array<uint8> key_message_; |
| 95 int key_message_length_; | 95 int key_message_length_; |
| 96 std::string default_url_; | 96 std::string default_url_; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 ClearKeyCdm(); | |
|
ddorwin
2012/09/07 09:48:48
Remove
Tom Finegan
2012/09/08 01:02:47
Done.
| |
| 100 | |
| 99 Client client_; | 101 Client client_; |
| 100 media::AesDecryptor decryptor_; | 102 media::AesDecryptor decryptor_; |
| 101 // Protects the |client_| from being accessed by the |decryptor_| | 103 // Protects the |client_| from being accessed by the |decryptor_| |
| 102 // simultaneously. | 104 // simultaneously. |
| 103 base::Lock client_lock_; | 105 base::Lock client_lock_; |
| 106 // Allocates buffers using the CDM wrapper. | |
| 107 cdm::CdmAllocator* allocator_; | |
| 104 }; | 108 }; |
| 105 | 109 |
| 106 } // namespace webkit_media | 110 } // namespace webkit_media |
| 107 | 111 |
| 108 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ | 112 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ |
| OLD | NEW |