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

Side by Side Diff: webkit/plugins/ppapi/content_decryptor_delegate.h

Issue 17289006: Separate CDM initialization from GenerateKeyRequest & remove key_system parameters. (Closed) Base URL: master
Patch Set: minor changes Created 7 years, 6 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
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_PLUGINS_PPAPI_CONTENT_DECRYPTOR_DELEGATE_H_ 5 #ifndef WEBKIT_PLUGINS_PPAPI_CONTENT_DECRYPTOR_DELEGATE_H_
6 #define WEBKIT_PLUGINS_PPAPI_CONTENT_DECRYPTOR_DELEGATE_H_ 6 #define WEBKIT_PLUGINS_PPAPI_CONTENT_DECRYPTOR_DELEGATE_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 10
(...skipping 21 matching lines...) Expand all
32 32
33 class WEBKIT_PLUGINS_EXPORT ContentDecryptorDelegate { 33 class WEBKIT_PLUGINS_EXPORT ContentDecryptorDelegate {
34 public: 34 public:
35 // ContentDecryptorDelegate does not take ownership of 35 // ContentDecryptorDelegate does not take ownership of
36 // |plugin_decryption_interface|. Therefore |plugin_decryption_interface| 36 // |plugin_decryption_interface|. Therefore |plugin_decryption_interface|
37 // must outlive this object. 37 // must outlive this object.
38 ContentDecryptorDelegate( 38 ContentDecryptorDelegate(
39 PP_Instance pp_instance, 39 PP_Instance pp_instance,
40 const PPP_ContentDecryptor_Private* plugin_decryption_interface); 40 const PPP_ContentDecryptor_Private* plugin_decryption_interface);
41 41
42 void Initialize(const std::string& key_system);
43
42 void SetKeyEventCallbacks(const media::KeyAddedCB& key_added_cb, 44 void SetKeyEventCallbacks(const media::KeyAddedCB& key_added_cb,
43 const media::KeyErrorCB& key_error_cb, 45 const media::KeyErrorCB& key_error_cb,
44 const media::KeyMessageCB& key_message_cb, 46 const media::KeyMessageCB& key_message_cb,
45 const media::NeedKeyCB& need_key_cb); 47 const media::NeedKeyCB& need_key_cb);
46 48
47 // Provides access to PPP_ContentDecryptor_Private. 49 // Provides access to PPP_ContentDecryptor_Private.
48 bool GenerateKeyRequest(const std::string& key_system, 50 bool GenerateKeyRequest(const std::string& type,
49 const std::string& type,
50 const uint8* init_data, 51 const uint8* init_data,
51 int init_data_length); 52 int init_data_length);
52 bool AddKey(const std::string& session_id, 53 bool AddKey(const std::string& session_id,
53 const uint8* key, 54 const uint8* key,
54 int key_length, 55 int key_length,
55 const uint8* init_data, 56 const uint8* init_data,
56 int init_data_length); 57 int init_data_length);
57 bool CancelKeyRequest(const std::string& session_id); 58 bool CancelKeyRequest(const std::string& session_id);
58 bool Decrypt(media::Decryptor::StreamType stream_type, 59 bool Decrypt(media::Decryptor::StreamType stream_type,
59 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, 60 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, 122 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer,
122 scoped_refptr<PPB_Buffer_Impl>* resource); 123 scoped_refptr<PPB_Buffer_Impl>* resource);
123 124
124 void FreeBuffer(uint32_t buffer_id); 125 void FreeBuffer(uint32_t buffer_id);
125 126
126 void SetBufferToFreeInTrackingInfo(PP_DecryptTrackingInfo* tracking_info); 127 void SetBufferToFreeInTrackingInfo(PP_DecryptTrackingInfo* tracking_info);
127 128
128 const PP_Instance pp_instance_; 129 const PP_Instance pp_instance_;
129 const PPP_ContentDecryptor_Private* const plugin_decryption_interface_; 130 const PPP_ContentDecryptor_Private* const plugin_decryption_interface_;
130 131
132 // TODO(ddorwin): Remove after updating the Pepper API to not use key system.
133 std::string key_system_;
134
131 // Callbacks for firing key events. 135 // Callbacks for firing key events.
132 media::KeyAddedCB key_added_cb_; 136 media::KeyAddedCB key_added_cb_;
133 media::KeyErrorCB key_error_cb_; 137 media::KeyErrorCB key_error_cb_;
134 media::KeyMessageCB key_message_cb_; 138 media::KeyMessageCB key_message_cb_;
135 media::NeedKeyCB need_key_cb_; 139 media::NeedKeyCB need_key_cb_;
136 140
137 gfx::Size natural_size_; 141 gfx::Size natural_size_;
138 142
139 // Request ID for tracking pending content decryption callbacks. 143 // Request ID for tracking pending content decryption callbacks.
140 // Note that zero indicates an invalid request ID. 144 // Note that zero indicates an invalid request ID.
(...skipping 28 matching lines...) Expand all
169 base::WeakPtrFactory<ContentDecryptorDelegate> weak_ptr_factory_; 173 base::WeakPtrFactory<ContentDecryptorDelegate> weak_ptr_factory_;
170 base::WeakPtr<ContentDecryptorDelegate> weak_this_; 174 base::WeakPtr<ContentDecryptorDelegate> weak_this_;
171 175
172 DISALLOW_COPY_AND_ASSIGN(ContentDecryptorDelegate); 176 DISALLOW_COPY_AND_ASSIGN(ContentDecryptorDelegate);
173 }; 177 };
174 178
175 } // namespace ppapi 179 } // namespace ppapi
176 } // namespace webkit 180 } // namespace webkit
177 181
178 #endif // WEBKIT_PLUGINS_PPAPI_CONTENT_DECRYPTOR_DELEGATE_H_ 182 #endif // WEBKIT_PLUGINS_PPAPI_CONTENT_DECRYPTOR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698