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

Side by Side Diff: content/browser/media/cdm_service_impl.cc

Issue 1637083002: Add CdmService to keep track of CDMs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes + file move Created 4 years, 9 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698