Chromium Code Reviews| Index: content/browser/media/cdm/browser_cdm_manager.cc |
| diff --git a/content/browser/media/cdm/browser_cdm_manager.cc b/content/browser/media/cdm/browser_cdm_manager.cc |
| index 0bd8a78e68d3a8c6a1d57b9104e7afa973426cd7..e3c2d61d4d36792fa9c44127496b9a8f8cef6d1f 100644 |
| --- a/content/browser/media/cdm/browser_cdm_manager.cc |
| +++ b/content/browser/media/cdm/browser_cdm_manager.cc |
| @@ -36,6 +36,11 @@ using media::MediaKeys; |
| namespace { |
| +#if defined(OS_ANDROID) |
| +// Android only supports 128-bit key IDs. |
| +const size_t kAndroidKeyIdBytes = 128 / 8; |
| +#endif |
| + |
| // The ID used in this class is a concatenation of |render_frame_id| and |
| // |cdm_id|, i.e. (render_frame_id << 32) + cdm_id. |
| @@ -345,6 +350,15 @@ void BrowserCdmManager::OnCreateSessionAndGenerateRequest( |
| promise->reject(MediaKeys::INVALID_ACCESS_ERROR, 0, "Init data too long."); |
| return; |
| } |
| +#if defined(OS_ANDROID) |
| + // On Android 'webm' initData should contain exactly 1 key. |
|
ddorwin
2015/05/15 16:54:35
Remove "On Android ". This is always true for WebM
jrummell
2015/05/15 17:52:21
Done.
|
| + if (init_data_type == INIT_DATA_TYPE_WEBM && |
| + init_data.size() != kAndroidKeyIdBytes) { |
| + promise->reject(MediaKeys::INVALID_ACCESS_ERROR, 0, |
| + "'webm' initData does not contain a single key."); |
|
ddorwin
2015/05/15 16:54:35
By definition, it is a single key ID. The problem
jrummell
2015/05/15 17:52:21
Done.
|
| + return; |
| + } |
| +#endif |
| media::EmeInitDataType eme_init_data_type; |
| switch (init_data_type) { |