Chromium Code Reviews| Index: content/browser/media/android/browser_media_player_manager.cc |
| diff --git a/content/browser/media/android/browser_media_player_manager.cc b/content/browser/media/android/browser_media_player_manager.cc |
| index a8ffa3a5f2467f1c560fc89ff133b247a0c2c7f8..77ad07564c8be200b81a544f437adad9dfde81c4 100644 |
| --- a/content/browser/media/android/browser_media_player_manager.cc |
| +++ b/content/browser/media/android/browser_media_player_manager.cc |
| @@ -40,9 +40,9 @@ static const int kMediaPlayerThreshold = 1; |
| // Maximum sizes for various EME message parameters. These are checks to |
| // prevent unnecessarily large messages from being passed around, and the sizes |
| // are somewhat arbitrary as the EME specification doesn't specify any limits. |
| -static const size_t kEmeUuidSize = 16; |
| -static const size_t kEmeInitDataMaximum = 64 * 1024; // 64 KB |
| -static const size_t kEmeResponseMaximum = 64 * 1024; // 64 KB |
| +const size_t kEmeInitDataMaximum = 64 * 1024; // 64 KB |
| +const size_t kEmeResponseMaximum = 64 * 1024; // 64 KB |
| +const size_t kEmeMaxKeySystemLength = 256; |
|
ddorwin
2014/03/06 18:28:48
ditto
xhwang
2014/03/06 18:53:49
Done.
|
| namespace content { |
| @@ -573,16 +573,21 @@ void BrowserMediaPlayerManager::OnDestroyPlayer(int player_id) { |
| } |
| void BrowserMediaPlayerManager::OnInitializeCdm(int cdm_id, |
| - const std::vector<uint8>& uuid, |
| + const std::string& key_system, |
| const GURL& frame_url) { |
| - if (uuid.size() != kEmeUuidSize) { |
| + if (key_system.size() > kEmeMaxKeySystemLength) { |
| // This failure will be discovered and reported by OnCreateSession() |
| // as GetDrmBridge() will return null. |
| - NOTREACHED() << "Invalid UUID for ID: " << cdm_id; |
| + NOTREACHED() << "Invalid key system: " << key_system; |
| return; |
| } |
| - AddDrmBridge(cdm_id, uuid, frame_url); |
| + if (!MediaDrmBridge::IsKeySystemSupportedWithType(key_system, "")) { |
| + NOTREACHED() << "Unsupported key system: " << key_system; |
| + return; |
| + } |
| + |
| + AddDrmBridge(cdm_id, key_system, frame_url); |
| // In EME v0.1b MediaKeys lives in the media element. So the |cdm_id| |
| // is the same as the |player_id|. |
| OnSetMediaKeys(cdm_id, cdm_id); |
| @@ -751,12 +756,12 @@ scoped_ptr<media::MediaPlayerAndroid> BrowserMediaPlayerManager::SwapPlayer( |
| } |
| void BrowserMediaPlayerManager::AddDrmBridge(int cdm_id, |
| - const std::vector<uint8>& uuid, |
| + const std::string& key_system, |
| const GURL& frame_url) { |
| DCHECK(!GetDrmBridge(cdm_id)); |
| scoped_ptr<MediaDrmBridge> drm_bridge( |
| - MediaDrmBridge::Create(cdm_id, uuid, frame_url, this)); |
| + MediaDrmBridge::Create(cdm_id, key_system, frame_url, this)); |
| if (!drm_bridge) { |
| // This failure will be discovered and reported by OnCreateSession() |
| // as GetDrmBridge() will return null. |