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

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: Use ScopedPPResource in PluginInstance::DeliverBlock 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..16dcd43d157f7272ec6e3c22a3fd20e6d3c30e81 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -20,6 +20,7 @@
#include "ppapi/c/dev/ppb_zoom_dev.h"
#include "ppapi/c/dev/ppp_find_dev.h"
#include "ppapi/c/dev/ppp_selection_dev.h"
+#include "ppapi/c/dev/ppb_testing_dev.h"
ddorwin 2012/09/05 16:17:51 This doesn't seem right.
Tom Finegan 2012/09/05 16:41:56 Done.
#include "ppapi/c/dev/ppp_text_input_dev.h"
#include "ppapi/c/dev/ppp_zoom_dev.h"
#include "ppapi/c/pp_rect.h"
@@ -2175,7 +2176,7 @@ void PluginInstance::KeyError(PP_Instance instance,
}
void PluginInstance::DeliverBlock(PP_Instance instance,
- PP_Resource decrypted_block,
+ PP_Resource decrypted_block_arg,
ddorwin 2012/09/05 16:17:51 Prefer to keep parameter names nice (and consisten
Tom Finegan 2012/09/05 16:41:56 Done.
const PP_DecryptedBlockInfo* block_info) {
DCHECK(block_info);
@@ -2191,16 +2192,20 @@ void PluginInstance::DeliverBlock(PP_Instance instance,
decrypt_cb.Run(media::Decryptor::kNoKey, NULL);
ddorwin 2012/09/05 16:17:51 PP_DCHECK that the decrypted_block is not valid si
Tom Finegan 2012/09/05 16:41:56 Done.
return;
}
+
if (block_info->result != PP_DECRYPTRESULT_SUCCESS) {
decrypt_cb.Run(media::Decryptor::kError, NULL);
return;
}
- EnterResourceNoLock<PPB_Buffer_API> enter(decrypted_block, true);
+ ScopedPPResource decrypted_block(ScopedPPResource::PassRef(),
+ decrypted_block_arg);
+ EnterResourceNoLock<PPB_Buffer_API> enter(decrypted_block, true);
if (!enter.succeeded()) {
decrypt_cb.Run(media::Decryptor::kError, NULL);
return;
}
+
BufferAutoMapper mapper(enter.object());
if (!mapper.data() || !mapper.size()) {
decrypt_cb.Run(media::Decryptor::kError, NULL);
« 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