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..c5536b18cbe123e1a6632f86e79225b0900f4df8 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,16 @@ 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) { |
| + if (it->first.compare(kWidevineKeySystem) != 0) |
|
ddorwin
2014/06/11 01:54:02
This should be commented.
ycheo (away)
2014/06/11 07:43:43
Done.
|
| + key_systems.push_back(it->first); |
| + } |
| + return key_systems; |
| +} |
| + |
| base::LazyInstance<KeySystemUuidManager>::Leaky g_key_system_uuid_manager = |
| LAZY_INSTANCE_INITIALIZER; |
| @@ -264,13 +275,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(); |
|
ddorwin
2014/06/11 01:54:01
This indirection makes an extra copy. :(
ycheo (away)
2014/06/11 07:43:43
As I tested, GCC does the return value optimizatio
|
| +} |
| + |
| +// static |
| bool MediaDrmBridge::IsKeySystemSupported(const std::string& key_system) { |
| DCHECK(!key_system.empty()); |
| return IsKeySystemSupportedWithTypeImpl(key_system, ""); |