Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(812)

Side by Side Diff: webkit/media/crypto/ppapi/clear_key_cdm.h

Issue 10914028: Add CDM allocator interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix double delete, and possible KeyMessage leak. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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::Allocator* 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(
32 int init_data_size, 32 const uint8_t* init_data,
33 cdm::KeyMessage* key_request) OVERRIDE; 33 int init_data_size,
34 cdm::KeyMessage* key_request) OVERRIDE;
xhwang 2012/09/13 14:35:45 why change the format here?
Tom Finegan 2012/09/15 08:03:14 The ';' was in column 81 (unless my guide is set t
34 virtual cdm::Status AddKey(const char* session_id, 35 virtual cdm::Status AddKey(const char* session_id,
35 int session_id_size, 36 int session_id_size,
36 const uint8_t* key, 37 const uint8_t* key,
37 int key_size, 38 int key_size,
38 const uint8_t* key_id, 39 const uint8_t* key_id,
39 int key_id_size) OVERRIDE; 40 int key_id_size) OVERRIDE;
40 virtual cdm::Status CancelKeyRequest(const char* session_id, 41 virtual cdm::Status CancelKeyRequest(const char* session_id,
41 int session_id_size) OVERRIDE; 42 int session_id_size) OVERRIDE;
42 virtual cdm::Status Decrypt(const cdm::InputBuffer& encrypted_buffer, 43 virtual cdm::Status Decrypt(const cdm::InputBuffer& encrypted_buffer,
43 cdm::OutputBuffer* decrypted_buffer) OVERRIDE; 44 cdm::OutputBuffer* decrypted_buffer) OVERRIDE;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 scoped_array<uint8> key_message_; 95 scoped_array<uint8> key_message_;
95 int key_message_length_; 96 int key_message_length_;
96 std::string default_url_; 97 std::string default_url_;
97 }; 98 };
98 99
99 Client client_; 100 Client client_;
100 media::AesDecryptor decryptor_; 101 media::AesDecryptor decryptor_;
101 // Protects the |client_| from being accessed by the |decryptor_| 102 // Protects the |client_| from being accessed by the |decryptor_|
102 // simultaneously. 103 // simultaneously.
103 base::Lock client_lock_; 104 base::Lock client_lock_;
105 // Allocates buffers using the CDM wrapper.
xhwang 2012/09/13 14:35:45 The cdm should know nothing about CDM wrapper?
ddorwin 2012/09/13 19:47:00 Probably self-describing anyway since the type has
Tom Finegan 2012/09/15 08:03:14 Removed comment.
106 cdm::Allocator* allocator_;
ddorwin 2012/09/13 19:47:00 *const
Tom Finegan 2012/09/15 08:03:14 Done.
104 }; 107 };
105 108
106 } // namespace webkit_media 109 } // namespace webkit_media
107 110
108 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ 111 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698