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

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 10909068: Fix resource leaks in CDM implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Same patchset as number 8, hopefully this one is viewable... 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 side-by-side diff with in-line comments
Download patch
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index 66940e831b73866c0cdccee620dd2e5427b20599..eb8c25aa5c79aa4c5a21e7a398aaebe1600458e7 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -1449,6 +1449,7 @@ bool PluginInstance::Decrypt(
return false;
ScopedPPResource encrypted_resource(
+ ScopedPPResource::PassRef(),
MakeBufferResource(pp_instance(),
encrypted_buffer->GetData(),
encrypted_buffer->GetDataSize()));
@@ -2178,10 +2179,8 @@ void PluginInstance::DeliverBlock(PP_Instance instance,
PP_Resource decrypted_block,
const PP_DecryptedBlockInfo* block_info) {
DCHECK(block_info);
-
DecryptionCBMap::iterator found = pending_decryption_cbs_.find(
block_info->tracking_info.request_id);
-
if (found == pending_decryption_cbs_.end())
return;
media::Decryptor::DecryptCB decrypt_cb = found->second;
@@ -2195,8 +2194,8 @@ void PluginInstance::DeliverBlock(PP_Instance instance,
decrypt_cb.Run(media::Decryptor::kError, NULL);
return;
}
- EnterResourceNoLock<PPB_Buffer_API> enter(decrypted_block, true);
+ EnterResourceNoLock<PPB_Buffer_API> enter(decrypted_block, true);
if (!enter.succeeded()) {
decrypt_cb.Run(media::Decryptor::kError, NULL);
return;
@@ -2207,6 +2206,8 @@ void PluginInstance::DeliverBlock(PP_Instance instance,
return;
}
+ // TODO(tomfinegan): Find a way to take ownership of the shared memory
+ // managed by the PPB_Buffer_Dev, and avoid the extra copy.
scoped_refptr<media::DecoderBuffer> decrypted_buffer(
media::DecoderBuffer::CopyFrom(
reinterpret_cast<const uint8*>(mapper.data()), mapper.size()));
« webkit/media/crypto/ppapi/cdm_wrapper.cc ('K') | « webkit/media/crypto/ppapi/cdm_wrapper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698