| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/crypto/renderer_cdm_manager.h" | 5 #include "content/renderer/media/crypto/renderer_cdm_manager.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "content/common/media/cdm_messages.h" | 8 #include "content/common/media/cdm_messages.h" |
| 9 #include "content/renderer/media/crypto/proxy_media_keys.h" | 9 #include "content/renderer/media/crypto/proxy_media_keys.h" |
| 10 #include "media/base/cdm_context.h" | 10 #include "media/base/cdm_context.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 IPC_MESSAGE_HANDLER(CdmMsg_RejectPromise, OnPromiseRejected) | 45 IPC_MESSAGE_HANDLER(CdmMsg_RejectPromise, OnPromiseRejected) |
| 46 IPC_MESSAGE_UNHANDLED(handled = false) | 46 IPC_MESSAGE_UNHANDLED(handled = false) |
| 47 IPC_END_MESSAGE_MAP() | 47 IPC_END_MESSAGE_MAP() |
| 48 return handled; | 48 return handled; |
| 49 } | 49 } |
| 50 | 50 |
| 51 void RendererCdmManager::InitializeCdm(int cdm_id, | 51 void RendererCdmManager::InitializeCdm(int cdm_id, |
| 52 uint32_t promise_id, | 52 uint32_t promise_id, |
| 53 ProxyMediaKeys* media_keys, | 53 ProxyMediaKeys* media_keys, |
| 54 const std::string& key_system, | 54 const std::string& key_system, |
| 55 const GURL& security_origin, | 55 const GURL& security_origin) { |
| 56 bool use_hw_secure_codecs) { | |
| 57 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered."; | 56 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered."; |
| 58 CdmHostMsg_InitializeCdm_Params params; | 57 Send(new CdmHostMsg_InitializeCdm(routing_id(), cdm_id, promise_id, |
| 59 params.key_system = key_system; | 58 key_system, security_origin)); |
| 60 params.security_origin = security_origin; | |
| 61 params.use_hw_secure_codecs = use_hw_secure_codecs; | |
| 62 Send(new CdmHostMsg_InitializeCdm(routing_id(), cdm_id, promise_id, params)); | |
| 63 } | 59 } |
| 64 | 60 |
| 65 void RendererCdmManager::SetServerCertificate( | 61 void RendererCdmManager::SetServerCertificate( |
| 66 int cdm_id, | 62 int cdm_id, |
| 67 uint32_t promise_id, | 63 uint32_t promise_id, |
| 68 const std::vector<uint8_t>& certificate) { | 64 const std::vector<uint8_t>& certificate) { |
| 69 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered."; | 65 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered."; |
| 70 Send(new CdmHostMsg_SetServerCertificate(routing_id(), cdm_id, promise_id, | 66 Send(new CdmHostMsg_SetServerCertificate(routing_id(), cdm_id, promise_id, |
| 71 certificate)); | 67 certificate)); |
| 72 } | 68 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 proxy_media_keys_map_.erase(cdm_id); | 209 proxy_media_keys_map_.erase(cdm_id); |
| 214 } | 210 } |
| 215 | 211 |
| 216 ProxyMediaKeys* RendererCdmManager::GetMediaKeys(int cdm_id) { | 212 ProxyMediaKeys* RendererCdmManager::GetMediaKeys(int cdm_id) { |
| 217 std::map<int, ProxyMediaKeys*>::iterator iter = | 213 std::map<int, ProxyMediaKeys*>::iterator iter = |
| 218 proxy_media_keys_map_.find(cdm_id); | 214 proxy_media_keys_map_.find(cdm_id); |
| 219 return (iter != proxy_media_keys_map_.end()) ? iter->second : NULL; | 215 return (iter != proxy_media_keys_map_.end()) ? iter->second : NULL; |
| 220 } | 216 } |
| 221 | 217 |
| 222 } // namespace content | 218 } // namespace content |
| OLD | NEW |