Chromium Code Reviews| Index: media/base/android/media_drm_bridge.cc |
| diff --git a/media/base/android/media_drm_bridge.cc b/media/base/android/media_drm_bridge.cc |
| index fc0288ab77381376ccbce06caf3035d0f1fe86ca..34e639d376af968bb358a526a3a5f192eb0eaf85 100644 |
| --- a/media/base/android/media_drm_bridge.cc |
| +++ b/media/base/android/media_drm_bridge.cc |
| @@ -73,6 +73,7 @@ class KeySystemUuidManager { |
| KeySystemUuidManager(); |
| UUID GetUUID(const std::string& key_system); |
| void AddMapping(const std::string& key_system, const UUID& uuid); |
| + std::vector<std::string> GetPlatformKeySystemNames(); |
| private: |
| typedef base::hash_map<std::string, UUID> KeySystemUuidMap; |
| @@ -105,6 +106,17 @@ void KeySystemUuidManager::AddMapping(const std::string& key_system, |
| key_system_uuid_map_[key_system] = uuid; |
| } |
| +std::vector<std::string> KeySystemUuidManager::GetPlatformKeySystemNames() { |
| + std::vector<std::string> key_systems; |
| + for (KeySystemUuidMap::iterator it = key_system_uuid_map_.begin(); |
| + it != key_system_uuid_map_.end(); ++it) { |
| + // Rule out the key system handled by Chrome explicitly. |
| + if (it->first.compare(kWidevineKeySystem) != 0) |
|
xhwang
2014/06/11 23:12:28
Can you just do
it->first != kWidevineKeySystem ?
ycheo (away)
2014/06/12 02:02:45
Done.
|
| + key_systems.push_back(it->first); |
| + } |
| + return key_systems; |
| +} |
| + |
| base::LazyInstance<KeySystemUuidManager>::Leaky g_key_system_uuid_manager = |
| LAZY_INSTANCE_INITIALIZER; |
| @@ -264,13 +276,18 @@ bool MediaDrmBridge::IsSecurityLevelSupported(const std::string& key_system, |
| return media_drm_bridge->SetSecurityLevel(security_level); |
| } |
| -//static |
| +// static |
| void MediaDrmBridge::AddKeySystemUuidMapping(const std::string& key_system, |
| const std::vector<uint8>& uuid) { |
| g_key_system_uuid_manager.Get().AddMapping(key_system, uuid); |
| } |
| // static |
| +std::vector<std::string> MediaDrmBridge::GetPlatformKeySystemNames() { |
| + return g_key_system_uuid_manager.Get().GetPlatformKeySystemNames(); |
| +} |
| + |
| +// static |
| bool MediaDrmBridge::IsKeySystemSupported(const std::string& key_system) { |
| DCHECK(!key_system.empty()); |
| return IsKeySystemSupportedWithTypeImpl(key_system, ""); |