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( |