OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_MEDIA_CDM_REGISTRY_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_CDM_REGISTRY_IMPL_H_ |
6 #define CONTENT_BROWSER_MEDIA_CDM_REGISTRY_IMPL_H_ | 6 #define CONTENT_BROWSER_MEDIA_CDM_REGISTRY_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "content/public/browser/cdm_registry.h" | 13 #include "content/public/browser/cdm_registry.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 struct CdmInfo; | 17 struct CdmInfo; |
18 | 18 |
19 class CONTENT_EXPORT CdmRegistryImpl : NON_EXPORTED_BASE(public CdmRegistry) { | 19 class CONTENT_EXPORT CdmRegistryImpl : NON_EXPORTED_BASE(public CdmRegistry) { |
20 public: | 20 public: |
21 // Returns the CdmRegistryImpl singleton. | 21 // Returns the CdmRegistryImpl singleton. |
22 static CdmRegistryImpl* GetInstance(); | 22 static CdmRegistryImpl* GetInstance(); |
23 | 23 |
24 // CdmRegistry implementation. | 24 // CdmRegistry implementation. |
25 void Init() override; | 25 void Init() override; |
26 void RegisterCdm(const CdmInfo& info) override; | 26 void RegisterCdm(const CdmInfo& info) override; |
27 const std::vector<CdmInfo>& GetAllRegisteredCdms() override; | 27 const std::vector<CdmInfo>& GetAllRegisteredCdms() override; |
28 | 28 |
29 private: | 29 private: |
30 friend struct base::DefaultLazyInstanceTraits<CdmRegistryImpl>; | |
31 friend class CdmRegistryImplTest; | 30 friend class CdmRegistryImplTest; |
32 | 31 |
33 CdmRegistryImpl(); | 32 CdmRegistryImpl(); |
34 ~CdmRegistryImpl() override; | 33 ~CdmRegistryImpl() override; |
35 | 34 |
36 std::vector<CdmInfo> cdms_; | 35 std::vector<CdmInfo> cdms_; |
37 | 36 |
38 DISALLOW_COPY_AND_ASSIGN(CdmRegistryImpl); | 37 DISALLOW_COPY_AND_ASSIGN(CdmRegistryImpl); |
39 }; | 38 }; |
40 | 39 |
41 } // namespace content | 40 } // namespace content |
42 | 41 |
43 #endif // CONTENT_BROWSER_MEDIA_CDM_REGISTRY_IMPL_H_ | 42 #endif // CONTENT_BROWSER_MEDIA_CDM_REGISTRY_IMPL_H_ |
OLD | NEW |