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

Unified Diff: media/mojo/services/mojo_cdm_service.cc

Issue 1603413004: media: Only unregister a CDM when it has been registered. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_cdm_service.cc
diff --git a/media/mojo/services/mojo_cdm_service.cc b/media/mojo/services/mojo_cdm_service.cc
index 31781b11e5fc5ec183dcd62c50f86ee04c0d3d5f..b2529bf22a67561c366bda31ee1d7b8e58d87c18 100644
--- a/media/mojo/services/mojo_cdm_service.cc
+++ b/media/mojo/services/mojo_cdm_service.cc
@@ -93,9 +93,12 @@ MojoCdmService::MojoCdmService(
}
MojoCdmService::~MojoCdmService() {
+ if (cdm_id_ == CdmContext::kInvalidCdmId)
+ return;
+
g_cdm_manager.Get().UnregisterCdm(cdm_id_);
- if (cdm_id_ != CdmContext::kInvalidCdmId && context_)
+ if (context_)
context_->UnregisterCdm(cdm_id_);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698