| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/media/cdm_service_impl.h" |
| 6 |
| 7 #include <stddef.h> |
| 8 |
| 9 #include "content/public/common/content_client.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 static base::LazyInstance<CdmServiceImpl>::Leaky g_cdm_service = |
| 14 LAZY_INSTANCE_INITIALIZER; |
| 15 |
| 16 // static |
| 17 CdmService* CdmService::GetInstance() { |
| 18 return CdmServiceImpl::GetInstance(); |
| 19 } |
| 20 |
| 21 // static |
| 22 CdmServiceImpl* CdmServiceImpl::GetInstance() { |
| 23 return g_cdm_service.Pointer(); |
| 24 } |
| 25 |
| 26 CdmServiceImpl::CdmServiceImpl() { |
| 27 } |
| 28 |
| 29 CdmServiceImpl::~CdmServiceImpl() {} |
| 30 |
| 31 void CdmServiceImpl::RegisterAllAvailableCdms() { |
| 32 GetContentClient()->AddContentDecryptionModules(&cdms_); |
| 33 } |
| 34 |
| 35 void CdmServiceImpl::RegisterCdm(const CdmInfo& info, bool add_at_beginning) { |
| 36 if (add_at_beginning) { |
| 37 cdms_.insert(cdms_.begin(), info); |
| 38 } else { |
| 39 cdms_.push_back(info); |
| 40 } |
| 41 } |
| 42 |
| 43 const std::vector<CdmInfo>& CdmServiceImpl::GetAllRegisteredCdms() { |
| 44 return cdms_; |
| 45 } |
| 46 |
| 47 } // namespace media |
| OLD | NEW |