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

Unified Diff: content/renderer/media/crypto/ppapi_decryptor.cc

Issue 1407933010: media: Make MediaKeys ref-counted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 5 years, 1 month 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
« no previous file with comments | « content/renderer/media/crypto/ppapi_decryptor.h ('k') | content/renderer/media/crypto/proxy_media_keys.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/crypto/ppapi_decryptor.cc
diff --git a/content/renderer/media/crypto/ppapi_decryptor.cc b/content/renderer/media/crypto/ppapi_decryptor.cc
index 4b35c9975e834fa33cc0ab79952838d76e3ea9a5..3e132691eec36dfbabad698688e71f15ed59b2ef 100644
--- a/content/renderer/media/crypto/ppapi_decryptor.cc
+++ b/content/renderer/media/crypto/ppapi_decryptor.cc
@@ -55,18 +55,17 @@ void PpapiDecryptor::Create(
return;
}
- scoped_ptr<PpapiDecryptor> ppapi_decryptor(
+ scoped_refptr<PpapiDecryptor> ppapi_decryptor(
new PpapiDecryptor(pepper_cdm_wrapper.Pass(), session_message_cb,
session_closed_cb, legacy_session_error_cb,
session_keys_change_cb, session_expiration_update_cb));
- // PpapiDecryptor ownership passed to the promise, but keep a copy in order
- // to call InitializeCdm().
- PpapiDecryptor* ppapi_decryptor_copy = ppapi_decryptor.get();
+ // |ppapi_decryptor| ownership is passed to the promise.
scoped_ptr<media::CdmInitializedPromise> promise(
- new media::CdmInitializedPromise(cdm_created_cb, ppapi_decryptor.Pass()));
- ppapi_decryptor_copy->InitializeCdm(key_system, allow_distinctive_identifier,
- allow_persistent_state, promise.Pass());
+ new media::CdmInitializedPromise(cdm_created_cb, ppapi_decryptor));
+
+ ppapi_decryptor->InitializeCdm(key_system, allow_distinctive_identifier,
+ allow_persistent_state, promise.Pass());
}
PpapiDecryptor::PpapiDecryptor(
« no previous file with comments | « content/renderer/media/crypto/ppapi_decryptor.h ('k') | content/renderer/media/crypto/proxy_media_keys.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698