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 class CdmAllocatorInterface; | |
| 25 | |
| 24 // Clear key implementation of the cdm::ContentDecryptionModule interface. | 26 // Clear key implementation of the cdm::ContentDecryptionModule interface. |
| 25 class ClearKeyCdm : public cdm::ContentDecryptionModule { | 27 class ClearKeyCdm : public cdm::ContentDecryptionModule { |
| 26 public: | 28 public: |
| 27 ClearKeyCdm(); | 29 ClearKeyCdm(); |
| 28 virtual ~ClearKeyCdm(); | 30 virtual ~ClearKeyCdm(); |
| 29 | 31 |
| 30 // ContentDecryptionModule implementation. | 32 // ContentDecryptionModule implementation. |
| 33 virtual bool Initialize(CdmAllocatorInterface* allocator) OVERRIDE; | |
| 34 | |
| 31 virtual cdm::Status GenerateKeyRequest(const uint8_t* init_data, | 35 virtual cdm::Status GenerateKeyRequest(const uint8_t* init_data, |
| 32 int init_data_size, | 36 int init_data_size, |
| 33 cdm::KeyMessage* key_request) OVERRIDE; | 37 cdm::KeyMessage* key_request) OVERRIDE; |
| 34 | 38 |
| 35 virtual cdm::Status AddKey(const char* session_id, | 39 virtual cdm::Status AddKey(const char* session_id, |
| 36 int session_id_size, | 40 int session_id_size, |
| 37 const uint8_t* key, | 41 const uint8_t* key, |
| 38 int key_size, | 42 int key_size, |
| 39 const uint8_t* key_id, | 43 const uint8_t* key_id, |
| 40 int key_id_size) OVERRIDE; | 44 int key_id_size) OVERRIDE; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 scoped_array<uint8> key_message_; | 94 scoped_array<uint8> key_message_; |
| 91 int key_message_length_; | 95 int key_message_length_; |
| 92 std::string default_url_; | 96 std::string default_url_; |
| 93 }; | 97 }; |
| 94 | 98 |
| 95 Client client_; | 99 Client client_; |
| 96 media::AesDecryptor decryptor_; | 100 media::AesDecryptor decryptor_; |
| 97 // Protects the |client_| from being accessed by the |decryptor_| | 101 // Protects the |client_| from being accessed by the |decryptor_| |
| 98 // simultaneously. | 102 // simultaneously. |
| 99 base::Lock client_lock_; | 103 base::Lock client_lock_; |
| 104 // Allocates shared memory buffers using the CDM wrapper. | |
|
xhwang
2012/09/01 13:49:09
Again, the CDM doesn't care what the allocator imp
Tom Finegan
2012/09/01 21:32:49
My reasoning for this comment is that allocation o
ddorwin
2012/09/04 09:53:15
If alignment is the information you want to provid
| |
| 105 CdmAllocatorInterface* allocator_iface_; | |
| 100 }; | 106 }; |
| 101 | 107 |
| 102 } // namespace webkit_media | 108 } // namespace webkit_media |
| 103 | 109 |
| 104 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ | 110 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ |
| OLD | NEW |