| 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_secure_codecs) { |
| 56 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered."; | 57 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered."; |
| 58 InitializeCdmParameters parameters; |
| 59 parameters.key_system = key_system; |
| 60 parameters.security_origin = security_origin; |
| 61 parameters.use_secure_codecs = use_secure_codecs; |
| 57 Send(new CdmHostMsg_InitializeCdm(routing_id(), cdm_id, promise_id, | 62 Send(new CdmHostMsg_InitializeCdm(routing_id(), cdm_id, promise_id, |
| 58 key_system, security_origin)); | 63 parameters)); |
| 59 } | 64 } |
| 60 | 65 |
| 61 void RendererCdmManager::SetServerCertificate( | 66 void RendererCdmManager::SetServerCertificate( |
| 62 int cdm_id, | 67 int cdm_id, |
| 63 uint32_t promise_id, | 68 uint32_t promise_id, |
| 64 const std::vector<uint8_t>& certificate) { | 69 const std::vector<uint8_t>& certificate) { |
| 65 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered."; | 70 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered."; |
| 66 Send(new CdmHostMsg_SetServerCertificate(routing_id(), cdm_id, promise_id, | 71 Send(new CdmHostMsg_SetServerCertificate(routing_id(), cdm_id, promise_id, |
| 67 certificate)); | 72 certificate)); |
| 68 } | 73 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 proxy_media_keys_map_.erase(cdm_id); | 214 proxy_media_keys_map_.erase(cdm_id); |
| 210 } | 215 } |
| 211 | 216 |
| 212 ProxyMediaKeys* RendererCdmManager::GetMediaKeys(int cdm_id) { | 217 ProxyMediaKeys* RendererCdmManager::GetMediaKeys(int cdm_id) { |
| 213 std::map<int, ProxyMediaKeys*>::iterator iter = | 218 std::map<int, ProxyMediaKeys*>::iterator iter = |
| 214 proxy_media_keys_map_.find(cdm_id); | 219 proxy_media_keys_map_.find(cdm_id); |
| 215 return (iter != proxy_media_keys_map_.end()) ? iter->second : NULL; | 220 return (iter != proxy_media_keys_map_.end()) ? iter->second : NULL; |
| 216 } | 221 } |
| 217 | 222 |
| 218 } // namespace content | 223 } // namespace content |
| OLD | NEW |