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 071cb02d74d0af55c7ce826b246f93bb337a8e35..d695ce13c9d7b9336b8de2dbe8300a725b5c2b90 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 kEmeMaxKeySystemSize = 1024; |
|
ddorwin
2014/03/04 20:00:56
Too long. "Length" would probably be better.
xhwang
2014/03/05 21:52:33
Done.
|
| namespace content { |
| @@ -601,16 +601,16 @@ 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() > kEmeMaxKeySystemSize) { |
| // 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); |
| + 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); |
| @@ -779,12 +779,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. |