Chromium Code Reviews| Index: content/public/common/key_system_service.h |
| diff --git a/content/public/common/key_system_service.h b/content/public/common/key_system_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d8aebf87e0d499e07d78402c977a938b19623511 |
| --- /dev/null |
| +++ b/content/public/common/key_system_service.h |
| @@ -0,0 +1,62 @@ |
| +// 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_KEY_SYSTEM_SERVICE_H_ |
|
xhwang
2016/01/29 07:43:07
Is there any reason we do't put this in content/pu
|
| +#define CONTENT_PUBLIC_COMMON_KEY_SYSTEM_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" |
| +#include "base/version.h" |
| +#include "content/common/content_export.h" |
| +#include "content/public/common/key_system_registration.h" |
| + |
| +namespace content { |
| + |
| +class CONTENT_EXPORT KeySystemService { |
| + public: |
| + // Returns the KeySystemService singleton. |
| + static KeySystemService* GetInstance(); |
| + |
| + // Register |key_system|, replacing any entry that may exist for it. |path| |
|
xhwang
2016/01/29 07:43:07
Register_s_; same below.
jrummell
2016/03/04 01:19:41
Done.
|
| + // is the path to the actual CDM, and |codecs| is the list of codecs |
| + // supported by this CDM. |
| + void Register(const std::string& key_system, |
| + const base::FilePath& path, |
| + const base::string16& codecs); |
|
xhwang
2016/01/29 07:43:07
How should the list of codecs be formatted in this
jrummell
2016/03/04 01:19:41
Converted to a std::vector<>.
|
| + |
| + // Determine the path set for |key_system|. If |key_system| has been |
| + // registered, true is returned and |path| is updated. Otherwise false |
| + // is returned and |path| is unchanged. |
| + bool Path(const std::string& key_system, base::FilePath* path); |
|
xhwang
2016/01/29 07:43:07
Path() is a bit vague. How about GetCdmLibraryPath
jrummell
2016/03/04 01:19:41
Done.
|
| + |
| + // Determine the codecs set for |key_system|. If |key_system| has been |
| + // registered, true is returned and |codecs| is updated. Otherwise false |
|
xhwang
2016/01/29 07:43:07
Is it possible "true" is returned and "codecs" is
jrummell
2016/03/04 01:19:41
Updated.
|
| + // is returned and |codecs| is unchanged. |
| + bool Codecs(const std::string& key_system, base::string16* codecs); |
|
xhwang
2016/01/29 07:43:07
ditto about name too general. How about GetSupport
jrummell
2016/03/04 01:19:41
Done.
|
| + |
| + // Return the list of all registered key systems and the path to the |
| + // library. Note that multiple key systems may use the same library, |
| + // so some of the entries in |paths| may be duplicated. |
| + void GetAllRegisteredKeySystems(std::vector<std::string>* key_systems, |
| + std::vector<base::FilePath>* paths); |
|
xhwang
2016/01/29 07:43:07
What's the purpose of this API? It's a bit odd tha
jrummell
2016/03/04 01:19:41
Combined using std::pair.
|
| + |
| + private: |
| + friend struct base::DefaultLazyInstanceTraits<KeySystemService>; |
| + |
| + KeySystemService(); |
| + ~KeySystemService(); |
| + |
| + std::vector<KeySystemRegistration> registered_key_systems_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(KeySystemService); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_COMMON_KEY_SYSTEM_SERVICE_H_ |