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

Side by Side Diff: webkit/media/crypto/ppapi/cdm_wrapper.cc

Issue 10909068: Fix resource leaks in CDM implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove includes from my debug runs... 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 #include <cstring> // For memcpy. 5 #include <cstring> // For memcpy.
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/compiler_specific.h" // For OVERRIDE. 8 #include "base/compiler_specific.h" // For OVERRIDE.
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/pp_stdint.h" 10 #include "ppapi/c/pp_stdint.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 cdm::OutputBuffer output_buffer; 228 cdm::OutputBuffer output_buffer;
229 cdm::Status status = cdm_->Decrypt(input_buffer, &output_buffer); 229 cdm::Status status = cdm_->Decrypt(input_buffer, &output_buffer);
230 230
231 CallOnMain(callback_factory_.NewCallback( 231 CallOnMain(callback_factory_.NewCallback(
232 &CdmWrapper::DeliverBlock, 232 &CdmWrapper::DeliverBlock,
233 status, 233 status,
234 output_buffer, 234 output_buffer,
235 encrypted_block_info.tracking_info)); 235 encrypted_block_info.tracking_info));
236 236
237 pp::Module::Get()->core()->ReleaseResource(encrypted_buffer.pp_resource());
xhwang 2012/09/05 09:26:55 Is this ReleaseResource called because we are pass
Tom Finegan 2012/09/05 16:04:41 ReleaseResource must be called in some manner. The
237 return true; 238 return true;
238 } 239 }
239 240
240 bool CdmWrapper::DecryptAndDecode( 241 bool CdmWrapper::DecryptAndDecode(
241 pp::Buffer_Dev encrypted_buffer, 242 pp::Buffer_Dev encrypted_buffer,
242 const PP_EncryptedBlockInfo& encrypted_block_info) { 243 const PP_EncryptedBlockInfo& encrypted_block_info) {
243 return false; 244 return false;
244 } 245 }
245 246
246 PP_Resource CdmWrapper::MakeBufferResource(const uint8_t* data, 247 PP_Resource CdmWrapper::MakeBufferResource(const uint8_t* data,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 } // namespace webkit_media 337 } // namespace webkit_media
337 338
338 namespace pp { 339 namespace pp {
339 340
340 // Factory function for your specialization of the Module object. 341 // Factory function for your specialization of the Module object.
341 Module* CreateModule() { 342 Module* CreateModule() {
342 return new webkit_media::MyModule(); 343 return new webkit_media::MyModule();
343 } 344 }
344 345
345 } // namespace pp 346 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698