Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: content/renderer/media/crypto/renderer_cdm_manager.cc

Issue 1131753003: Plumb |use_secure_codecs| through to BrowserCdmFactoryAndroid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update unittest. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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) {
56 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered."; 57 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered.";
57 Send(new CdmHostMsg_InitializeCdm(routing_id(), cdm_id, promise_id, 58 CdmHostMsg_InitializeCdm_Params params;
58 key_system, security_origin)); 59 params.key_system = key_system;
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));
59 } 63 }
60 64
61 void RendererCdmManager::SetServerCertificate( 65 void RendererCdmManager::SetServerCertificate(
62 int cdm_id, 66 int cdm_id,
63 uint32_t promise_id, 67 uint32_t promise_id,
64 const std::vector<uint8_t>& certificate) { 68 const std::vector<uint8_t>& certificate) {
65 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered."; 69 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered.";
66 Send(new CdmHostMsg_SetServerCertificate(routing_id(), cdm_id, promise_id, 70 Send(new CdmHostMsg_SetServerCertificate(routing_id(), cdm_id, promise_id,
67 certificate)); 71 certificate));
68 } 72 }
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 proxy_media_keys_map_.erase(cdm_id); 213 proxy_media_keys_map_.erase(cdm_id);
210 } 214 }
211 215
212 ProxyMediaKeys* RendererCdmManager::GetMediaKeys(int cdm_id) { 216 ProxyMediaKeys* RendererCdmManager::GetMediaKeys(int cdm_id) {
213 std::map<int, ProxyMediaKeys*>::iterator iter = 217 std::map<int, ProxyMediaKeys*>::iterator iter =
214 proxy_media_keys_map_.find(cdm_id); 218 proxy_media_keys_map_.find(cdm_id);
215 return (iter != proxy_media_keys_map_.end()) ? iter->second : NULL; 219 return (iter != proxy_media_keys_map_.end()) ? iter->second : NULL;
216 } 220 }
217 221
218 } // namespace content 222 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698