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

Unified Diff: media/cdm/proxy_decryptor.cc

Issue 1407933010: media: Make MediaKeys ref-counted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address timav@'s comments. Created 5 years, 2 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: media/cdm/proxy_decryptor.cc
diff --git a/media/cdm/proxy_decryptor.cc b/media/cdm/proxy_decryptor.cc
index 321a4a2c63e94beab75fed29df6d5f6e7ddd4021..b42666a481f07a322fad4ede6b908ea6b71608b5 100644
--- a/media/cdm/proxy_decryptor.cc
+++ b/media/cdm/proxy_decryptor.cc
@@ -60,7 +60,7 @@ ProxyDecryptor::ProxyDecryptor(MediaPermission* media_permission,
ProxyDecryptor::~ProxyDecryptor() {
// Destroy the decryptor explicitly before destroying the plugin.
- media_keys_.reset();
+ media_keys_ = nullptr;
}
void ProxyDecryptor::CreateCdm(CdmFactory* cdm_factory,
@@ -96,7 +96,7 @@ void ProxyDecryptor::CreateCdm(CdmFactory* cdm_factory,
void ProxyDecryptor::OnCdmCreated(const std::string& key_system,
const GURL& security_origin,
const CdmContextReadyCB& cdm_context_ready_cb,
- scoped_ptr<MediaKeys> cdm,
+ const scoped_refptr<MediaKeys>& cdm,
const std::string& /* error_message */) {
is_creating_cdm_ = false;
@@ -106,7 +106,7 @@ void ProxyDecryptor::OnCdmCreated(const std::string& key_system,
key_system_ = key_system;
security_origin_ = security_origin;
is_clear_key_ = IsClearKey(key_system) || IsExternalClearKey(key_system);
- media_keys_ = cdm.Pass();
+ media_keys_ = cdm;
cdm_context_ready_cb.Run(media_keys_->GetCdmContext());
}

Powered by Google App Engine
This is Rietveld 408576698