| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/android/renderer_media_player_manager.h" | 5 #include "content/renderer/media/android/renderer_media_player_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "content/common/media/media_player_messages_android.h" | 9 #include "content/common/media/media_player_messages_android.h" |
| 10 #include "content/renderer/media/android/proxy_media_keys.h" | 10 #include "content/renderer/media/android/proxy_media_keys.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 IPC_MESSAGE_HANDLER(MediaPlayerMsg_ConnectedToRemoteDevice, | 50 IPC_MESSAGE_HANDLER(MediaPlayerMsg_ConnectedToRemoteDevice, |
| 51 OnConnectedToRemoteDevice) | 51 OnConnectedToRemoteDevice) |
| 52 IPC_MESSAGE_HANDLER(MediaPlayerMsg_DisconnectedFromRemoteDevice, | 52 IPC_MESSAGE_HANDLER(MediaPlayerMsg_DisconnectedFromRemoteDevice, |
| 53 OnDisconnectedFromRemoteDevice) | 53 OnDisconnectedFromRemoteDevice) |
| 54 IPC_MESSAGE_HANDLER(MediaPlayerMsg_RequestFullscreen, | 54 IPC_MESSAGE_HANDLER(MediaPlayerMsg_RequestFullscreen, |
| 55 OnRequestFullscreen) | 55 OnRequestFullscreen) |
| 56 IPC_MESSAGE_HANDLER(MediaPlayerMsg_DidEnterFullscreen, OnDidEnterFullscreen) | 56 IPC_MESSAGE_HANDLER(MediaPlayerMsg_DidEnterFullscreen, OnDidEnterFullscreen) |
| 57 IPC_MESSAGE_HANDLER(MediaPlayerMsg_DidExitFullscreen, OnDidExitFullscreen) | 57 IPC_MESSAGE_HANDLER(MediaPlayerMsg_DidExitFullscreen, OnDidExitFullscreen) |
| 58 IPC_MESSAGE_HANDLER(MediaPlayerMsg_DidMediaPlayerPlay, OnPlayerPlay) | 58 IPC_MESSAGE_HANDLER(MediaPlayerMsg_DidMediaPlayerPlay, OnPlayerPlay) |
| 59 IPC_MESSAGE_HANDLER(MediaPlayerMsg_DidMediaPlayerPause, OnPlayerPause) | 59 IPC_MESSAGE_HANDLER(MediaPlayerMsg_DidMediaPlayerPause, OnPlayerPause) |
| 60 // TODO(jrummell): Update IPC names for EME WD and add Closed. | 60 IPC_MESSAGE_HANDLER(MediaKeysMsg_SessionCreated, OnSessionCreated) |
| 61 IPC_MESSAGE_HANDLER(MediaKeysMsg_KeyAdded, OnSessionReady) | 61 IPC_MESSAGE_HANDLER(MediaKeysMsg_SessionMessage, OnSessionMessage) |
| 62 IPC_MESSAGE_HANDLER(MediaKeysMsg_KeyError, OnSessionError) | 62 IPC_MESSAGE_HANDLER(MediaKeysMsg_SessionReady, OnSessionReady) |
| 63 IPC_MESSAGE_HANDLER(MediaKeysMsg_KeyMessage, OnSessionMessage) | 63 IPC_MESSAGE_HANDLER(MediaKeysMsg_SessionClosed, OnSessionClosed) |
| 64 IPC_MESSAGE_HANDLER(MediaKeysMsg_SetSessionId, OnSessionCreated) | 64 IPC_MESSAGE_HANDLER(MediaKeysMsg_SessionError, OnSessionError) |
| 65 IPC_MESSAGE_UNHANDLED(handled = false) | 65 IPC_MESSAGE_UNHANDLED(handled = false) |
| 66 IPC_END_MESSAGE_MAP() | 66 IPC_END_MESSAGE_MAP() |
| 67 return handled; | 67 return handled; |
| 68 } | 68 } |
| 69 | 69 |
| 70 void RendererMediaPlayerManager::Initialize( | 70 void RendererMediaPlayerManager::Initialize( |
| 71 MediaPlayerHostMsg_Initialize_Type type, | 71 MediaPlayerHostMsg_Initialize_Type type, |
| 72 int player_id, | 72 int player_id, |
| 73 const GURL& url, | 73 const GURL& url, |
| 74 const GURL& first_party_for_cookies, | 74 const GURL& first_party_for_cookies, |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 226 |
| 227 void RendererMediaPlayerManager::InitializeCDM(int media_keys_id, | 227 void RendererMediaPlayerManager::InitializeCDM(int media_keys_id, |
| 228 ProxyMediaKeys* media_keys, | 228 ProxyMediaKeys* media_keys, |
| 229 const std::vector<uint8>& uuid, | 229 const std::vector<uint8>& uuid, |
| 230 const GURL& frame_url) { | 230 const GURL& frame_url) { |
| 231 RegisterMediaKeys(media_keys_id, media_keys); | 231 RegisterMediaKeys(media_keys_id, media_keys); |
| 232 Send(new MediaKeysHostMsg_InitializeCDM( | 232 Send(new MediaKeysHostMsg_InitializeCDM( |
| 233 routing_id(), media_keys_id, uuid, frame_url)); | 233 routing_id(), media_keys_id, uuid, frame_url)); |
| 234 } | 234 } |
| 235 | 235 |
| 236 void RendererMediaPlayerManager::GenerateKeyRequest( | 236 void RendererMediaPlayerManager::CreateSession( |
| 237 int media_keys_id, | 237 int media_keys_id, |
| 238 uint32 reference_id, | 238 uint32 reference_id, |
| 239 const std::string& type, | 239 const std::string& type, |
| 240 const std::vector<uint8>& init_data) { | 240 const std::vector<uint8>& init_data) { |
| 241 Send(new MediaKeysHostMsg_GenerateKeyRequest( | 241 Send(new MediaKeysHostMsg_CreateSession( |
| 242 routing_id(), media_keys_id, reference_id, type, init_data)); | 242 routing_id(), media_keys_id, reference_id, type, init_data)); |
| 243 } | 243 } |
| 244 | 244 |
| 245 void RendererMediaPlayerManager::AddKey(int media_keys_id, | 245 void RendererMediaPlayerManager::UpdateSession( |
| 246 uint32 reference_id, | 246 int media_keys_id, |
| 247 const std::vector<uint8>& key, | 247 uint32 reference_id, |
| 248 const std::vector<uint8>& init_data) { | 248 const std::vector<uint8>& response) { |
| 249 Send(new MediaKeysHostMsg_AddKey( | 249 Send(new MediaKeysHostMsg_UpdateSession( |
| 250 routing_id(), media_keys_id, reference_id, key, init_data)); | 250 routing_id(), media_keys_id, reference_id, response)); |
| 251 } | 251 } |
| 252 | 252 |
| 253 void RendererMediaPlayerManager::CancelKeyRequest(int media_keys_id, | 253 void RendererMediaPlayerManager::ReleaseSession(int media_keys_id, |
| 254 uint32 reference_id) { | 254 uint32 reference_id) { |
| 255 Send(new MediaKeysHostMsg_CancelKeyRequest( | 255 Send(new MediaKeysHostMsg_ReleaseSession( |
| 256 routing_id(), media_keys_id, reference_id)); | 256 routing_id(), media_keys_id, reference_id)); |
| 257 } | 257 } |
| 258 | 258 |
| 259 void RendererMediaPlayerManager::OnSessionCreated( | 259 void RendererMediaPlayerManager::OnSessionCreated( |
| 260 int media_keys_id, | 260 int media_keys_id, |
| 261 uint32 reference_id, | 261 uint32 reference_id, |
| 262 const std::string& session_id) { | 262 const std::string& web_session_id) { |
| 263 ProxyMediaKeys* media_keys = GetMediaKeys(media_keys_id); | 263 ProxyMediaKeys* media_keys = GetMediaKeys(media_keys_id); |
| 264 if (media_keys) | 264 if (media_keys) |
| 265 media_keys->OnSessionCreated(reference_id, session_id); | 265 media_keys->OnSessionCreated(reference_id, web_session_id); |
| 266 } | 266 } |
| 267 | 267 |
| 268 void RendererMediaPlayerManager::OnSessionMessage( | 268 void RendererMediaPlayerManager::OnSessionMessage( |
| 269 int media_keys_id, | 269 int media_keys_id, |
| 270 uint32 reference_id, | 270 uint32 reference_id, |
| 271 const std::vector<uint8>& message, | 271 const std::vector<uint8>& message, |
| 272 const std::string& destination_url) { | 272 const std::string& destination_url) { |
| 273 ProxyMediaKeys* media_keys = GetMediaKeys(media_keys_id); | 273 ProxyMediaKeys* media_keys = GetMediaKeys(media_keys_id); |
| 274 if (media_keys) | 274 if (media_keys) |
| 275 media_keys->OnSessionMessage(reference_id, message, destination_url); | 275 media_keys->OnSessionMessage(reference_id, message, destination_url); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 gfx::RectF rect; | 398 gfx::RectF rect; |
| 399 if (player->RetrieveGeometryChange(&rect)) { | 399 if (player->RetrieveGeometryChange(&rect)) { |
| 400 (*changes)[player_it->first] = rect; | 400 (*changes)[player_it->first] = rect; |
| 401 } | 401 } |
| 402 } | 402 } |
| 403 } | 403 } |
| 404 } | 404 } |
| 405 #endif | 405 #endif |
| 406 | 406 |
| 407 } // namespace content | 407 } // namespace content |
| OLD | NEW |