Chromium Code Reviews| Index: content/public/common/cdm_service.h |
| diff --git a/content/public/common/cdm_service.h b/content/public/common/cdm_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..162f72212f7556dc26fed03c46b8438fedd5a8e6 |
| --- /dev/null |
| +++ b/content/public/common/cdm_service.h |
| @@ -0,0 +1,56 @@ |
| +// 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. |
| + |
| +#ifndef CONTENT_PUBLIC_COMMON_CDM_SERVICE_H_ |
| +#define CONTENT_PUBLIC_COMMON_CDM_SERVICE_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/files/file_path.h" |
| +#include "base/lazy_instance.h" |
| +#include "base/macros.h" |
| +#include "base/strings/string16.h" |
|
ddorwin
2016/03/18 19:24:19
no
jrummell
2016/03/23 21:38:10
Done.
|
| +#include "base/version.h" |
| +#include "content/common/content_export.h" |
| +#include "content/public/common/cdm_info.h" |
| + |
| +namespace content { |
| + |
| +class CONTENT_EXPORT CdmService { |
|
ddorwin
2016/03/18 22:22:11
Is this really a service or just a registry?
xhwang
2016/03/18 23:16:02
Either works for me :) I guess we were following t
|
| + public: |
| + // Returns the CdmService singleton. |
| + static CdmService* GetInstance(); |
| + |
| + // Registers |cdm_id|, replacing any entry that may exist for it (with |
|
xhwang
2016/03/18 19:35:38
ditto about cdm_id
jrummell
2016/03/23 21:38:10
Done.
|
| + // same |version|). |module_library_path| is the path to the actual CDM |
|
ddorwin
2016/03/18 19:24:19
Do we expect this to be called multiple times with
jrummell
2016/03/23 21:38:10
Done.
|
| + // (may be empty if the CDM is already included as part of the system), |
|
ddorwin
2016/03/18 19:24:19
ditto on the ifdef.
jrummell
2016/03/23 21:38:10
No longer an issue here.
|
| + // and |supported_codecs| and |supported_init_data_types| are the list |
| + // of codecs, and the list of init_data_types, respectively, supported |
| + // by this CDM (which may be none). |
| + void Register(const std::string& cdm_id, |
|
ddorwin
2016/03/18 19:24:19
nit: RegisterCdm seems better. WDYT?
jrummell
2016/03/23 21:38:10
Done.
|
| + const std::string& version, |
| + const base::FilePath& module_library_path, |
| + const std::vector<base::string16>& supported_codecs, |
| + const std::vector<base::string16>& supported_init_data_types); |
|
xhwang
2016/03/18 19:35:38
It seems content APIs should be pure abstract:
ht
jrummell
2016/03/23 21:38:10
Done (by moving this file and matching what is don
|
| + |
| + // Returns the list of all registered CDMs and the associated data. |
| + // Paths in |key_systems| may be empty if the CDM is already included as |
|
ddorwin
2016/03/18 19:24:19
Seems unnecessary. This is already covered in the
jrummell
2016/03/23 21:38:10
Done.
|
| + // part of the system. |
| + const std::vector<CdmInfo>& GetAllRegisteredCdms() const; |
|
xhwang
2016/03/18 19:35:38
For interfaces we don't use "const":
https://www.
jrummell
2016/03/23 21:38:10
Done.
|
| + |
| + private: |
| + friend struct base::DefaultLazyInstanceTraits<CdmService>; |
| + |
| + CdmService(); |
| + ~CdmService(); |
| + |
| + std::vector<CdmInfo> registered_modules_; |
|
ddorwin
2016/03/18 19:24:18
"modules" is first used alone here. "cdms" seems b
jrummell
2016/03/23 21:38:10
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(CdmService); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_COMMON_CDM_SERVICE_H_ |