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..15d40d4bd20c71a7eecbaed8cd257b74993b4e3c 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; |
| namespace content { |
| @@ -573,16 +573,19 @@ 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 name: " << key_system; |
| return; |
| } |
| - AddDrmBridge(cdm_id, uuid, frame_url); |
| + // IsKeySystemSupported() should have already been checked at the render side. |
| + DCHECK(MediaDrmBridge::IsKeySystemSupported(key_system, "")); |
|
ddorwin
2014/03/05 22:11:29
If this is for security, we should probably return
xhwang
2014/03/06 18:09:57
Done.
|
| + |
| + 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 +754,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. |