OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/renderer/media/crypto/key_systems.h" | 5 #include "content/renderer/media/crypto/key_systems.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 KeySystems& KeySystems::GetInstance() { | 108 KeySystems& KeySystems::GetInstance() { |
109 return g_key_systems.Get(); | 109 return g_key_systems.Get(); |
110 } | 110 } |
111 | 111 |
112 // Because we use a LazyInstance, the key systems info must be populated when | 112 // Because we use a LazyInstance, the key systems info must be populated when |
113 // the instance is lazily initiated. | 113 // the instance is lazily initiated. |
114 KeySystems::KeySystems() { | 114 KeySystems::KeySystems() { |
115 std::vector<KeySystemInfo> key_systems_info; | 115 std::vector<KeySystemInfo> key_systems_info; |
116 GetContentClient()->renderer()->AddKeySystems(&key_systems_info); | 116 GetContentClient()->renderer()->AddKeySystems(&key_systems_info); |
117 // TODO(ddorwin): Remove in next CL after moving info to | |
118 // ChromeContentRendererClient. | |
119 AddKeySystems(&key_systems_info); | |
120 AddConcreteSupportedKeySystems(key_systems_info); | 117 AddConcreteSupportedKeySystems(key_systems_info); |
121 } | 118 } |
122 | 119 |
123 void KeySystems::AddConcreteSupportedKeySystems( | 120 void KeySystems::AddConcreteSupportedKeySystems( |
124 const std::vector<KeySystemInfo>& concrete_key_systems) { | 121 const std::vector<KeySystemInfo>& concrete_key_systems) { |
125 for (size_t i = 0; i < concrete_key_systems.size(); ++i) { | 122 for (size_t i = 0; i < concrete_key_systems.size(); ++i) { |
126 const KeySystemInfo& key_system_info = concrete_key_systems[i]; | 123 const KeySystemInfo& key_system_info = concrete_key_systems[i]; |
127 AddConcreteSupportedKeySystem(key_system_info.key_system, | 124 AddConcreteSupportedKeySystem(key_system_info.key_system, |
128 key_system_info.use_aes_decryptor, | 125 key_system_info.use_aes_decryptor, |
129 #if defined(ENABLE_PEPPER_CDMS) | 126 #if defined(ENABLE_PEPPER_CDMS) |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 std::string GetPepperType(const std::string& concrete_key_system) { | 316 std::string GetPepperType(const std::string& concrete_key_system) { |
320 return KeySystems::GetInstance().GetPepperType(concrete_key_system); | 317 return KeySystems::GetInstance().GetPepperType(concrete_key_system); |
321 } | 318 } |
322 #elif defined(OS_ANDROID) | 319 #elif defined(OS_ANDROID) |
323 std::vector<uint8> GetUUID(const std::string& concrete_key_system) { | 320 std::vector<uint8> GetUUID(const std::string& concrete_key_system) { |
324 return KeySystems::GetInstance().GetUUID(concrete_key_system); | 321 return KeySystems::GetInstance().GetUUID(concrete_key_system); |
325 } | 322 } |
326 #endif | 323 #endif |
327 | 324 |
328 } // namespace content | 325 } // namespace content |
OLD | NEW |