| Index: content/browser/media/cdm_service_impl.cc
|
| diff --git a/content/browser/media/cdm_service_impl.cc b/content/browser/media/cdm_service_impl.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1cfb19c5d9c8c26191b7773a67d0df90898c1823
|
| --- /dev/null
|
| +++ b/content/browser/media/cdm_service_impl.cc
|
| @@ -0,0 +1,47 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "content/browser/media/cdm_service_impl.h"
|
| +
|
| +#include <stddef.h>
|
| +
|
| +#include "content/public/common/content_client.h"
|
| +
|
| +namespace content {
|
| +
|
| +static base::LazyInstance<CdmServiceImpl>::Leaky g_cdm_service =
|
| + LAZY_INSTANCE_INITIALIZER;
|
| +
|
| +// static
|
| +CdmService* CdmService::GetInstance() {
|
| + return CdmServiceImpl::GetInstance();
|
| +}
|
| +
|
| +// static
|
| +CdmServiceImpl* CdmServiceImpl::GetInstance() {
|
| + return g_cdm_service.Pointer();
|
| +}
|
| +
|
| +CdmServiceImpl::CdmServiceImpl() {
|
| +}
|
| +
|
| +CdmServiceImpl::~CdmServiceImpl() {}
|
| +
|
| +void CdmServiceImpl::RegisterAllAvailableCdms() {
|
| + GetContentClient()->AddContentDecryptionModules(&cdms_);
|
| +}
|
| +
|
| +void CdmServiceImpl::RegisterCdm(const CdmInfo& info, bool add_at_beginning) {
|
| + if (add_at_beginning) {
|
| + cdms_.insert(cdms_.begin(), info);
|
| + } else {
|
| + cdms_.push_back(info);
|
| + }
|
| +}
|
| +
|
| +const std::vector<CdmInfo>& CdmServiceImpl::GetAllRegisteredCdms() {
|
| + return cdms_;
|
| +}
|
| +
|
| +} // namespace media
|
|
|