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

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

Issue 2255943002: EME: Remove obsolete legacy APIs related to versions of prefixed EME (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build and add bug reference for obsoletes Created 4 years, 4 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/cdm/renderer_cdm_manager.h" 5 #include "content/renderer/media/cdm/renderer_cdm_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 19 matching lines...) Expand all
30 DCHECK(proxy_media_keys_map_.empty()) 30 DCHECK(proxy_media_keys_map_.empty())
31 << "RendererCdmManager is owned by RenderFrameImpl and is destroyed only " 31 << "RendererCdmManager is owned by RenderFrameImpl and is destroyed only "
32 "after all ProxyMediaKeys are destroyed and unregistered."; 32 "after all ProxyMediaKeys are destroyed and unregistered.";
33 } 33 }
34 34
35 bool RendererCdmManager::OnMessageReceived(const IPC::Message& msg) { 35 bool RendererCdmManager::OnMessageReceived(const IPC::Message& msg) {
36 bool handled = true; 36 bool handled = true;
37 IPC_BEGIN_MESSAGE_MAP(RendererCdmManager, msg) 37 IPC_BEGIN_MESSAGE_MAP(RendererCdmManager, msg)
38 IPC_MESSAGE_HANDLER(CdmMsg_SessionMessage, OnSessionMessage) 38 IPC_MESSAGE_HANDLER(CdmMsg_SessionMessage, OnSessionMessage)
39 IPC_MESSAGE_HANDLER(CdmMsg_SessionClosed, OnSessionClosed) 39 IPC_MESSAGE_HANDLER(CdmMsg_SessionClosed, OnSessionClosed)
40 IPC_MESSAGE_HANDLER(CdmMsg_LegacySessionError, OnLegacySessionError)
41 IPC_MESSAGE_HANDLER(CdmMsg_SessionKeysChange, OnSessionKeysChange) 40 IPC_MESSAGE_HANDLER(CdmMsg_SessionKeysChange, OnSessionKeysChange)
42 IPC_MESSAGE_HANDLER(CdmMsg_SessionExpirationUpdate, 41 IPC_MESSAGE_HANDLER(CdmMsg_SessionExpirationUpdate,
43 OnSessionExpirationUpdate) 42 OnSessionExpirationUpdate)
44 IPC_MESSAGE_HANDLER(CdmMsg_ResolvePromise, OnPromiseResolved) 43 IPC_MESSAGE_HANDLER(CdmMsg_ResolvePromise, OnPromiseResolved)
45 IPC_MESSAGE_HANDLER(CdmMsg_ResolvePromiseWithSession, 44 IPC_MESSAGE_HANDLER(CdmMsg_ResolvePromiseWithSession,
46 OnPromiseResolvedWithSession) 45 OnPromiseResolvedWithSession)
47 IPC_MESSAGE_HANDLER(CdmMsg_RejectPromise, OnPromiseRejected) 46 IPC_MESSAGE_HANDLER(CdmMsg_RejectPromise, OnPromiseRejected)
48 IPC_MESSAGE_UNHANDLED(handled = false) 47 IPC_MESSAGE_UNHANDLED(handled = false)
49 IPC_END_MESSAGE_MAP() 48 IPC_END_MESSAGE_MAP()
50 return handled; 49 return handled;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 129
131 void RendererCdmManager::DestroyCdm(int cdm_id) { 130 void RendererCdmManager::DestroyCdm(int cdm_id) {
132 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered."; 131 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered.";
133 Send(new CdmHostMsg_DestroyCdm(routing_id(), cdm_id)); 132 Send(new CdmHostMsg_DestroyCdm(routing_id(), cdm_id));
134 } 133 }
135 134
136 void RendererCdmManager::OnSessionMessage( 135 void RendererCdmManager::OnSessionMessage(
137 int cdm_id, 136 int cdm_id,
138 const std::string& session_id, 137 const std::string& session_id,
139 media::MediaKeys::MessageType message_type, 138 media::MediaKeys::MessageType message_type,
140 const std::vector<uint8_t>& message, 139 const std::vector<uint8_t>& message) {
141 const GURL& legacy_destination_url) {
142 if (message.size() > kMaxSessionMessageLength) { 140 if (message.size() > kMaxSessionMessageLength) {
143 NOTREACHED(); 141 NOTREACHED();
144 LOG(ERROR) << "Message is too long and dropped."; 142 LOG(ERROR) << "Message is too long and dropped.";
145 return; 143 return;
146 } 144 }
147 145
148 ProxyMediaKeys* media_keys = GetMediaKeys(cdm_id); 146 ProxyMediaKeys* media_keys = GetMediaKeys(cdm_id);
149 if (media_keys) 147 if (media_keys)
150 media_keys->OnSessionMessage(session_id, message_type, message, 148 media_keys->OnSessionMessage(session_id, message_type, message);
151 legacy_destination_url);
152 } 149 }
153 150
154 void RendererCdmManager::OnSessionClosed(int cdm_id, 151 void RendererCdmManager::OnSessionClosed(int cdm_id,
155 const std::string& session_id) { 152 const std::string& session_id) {
156 ProxyMediaKeys* media_keys = GetMediaKeys(cdm_id); 153 ProxyMediaKeys* media_keys = GetMediaKeys(cdm_id);
157 if (media_keys) 154 if (media_keys)
158 media_keys->OnSessionClosed(session_id); 155 media_keys->OnSessionClosed(session_id);
159 } 156 }
160 157
161 void RendererCdmManager::OnLegacySessionError(
162 int cdm_id,
163 const std::string& session_id,
164 MediaKeys::Exception exception,
165 uint32_t system_code,
166 const std::string& error_message) {
167 ProxyMediaKeys* media_keys = GetMediaKeys(cdm_id);
168 if (media_keys)
169 media_keys->OnLegacySessionError(session_id, exception, system_code,
170 error_message);
171 }
172
173 void RendererCdmManager::OnSessionKeysChange( 158 void RendererCdmManager::OnSessionKeysChange(
174 int cdm_id, 159 int cdm_id,
175 const std::string& session_id, 160 const std::string& session_id,
176 bool has_additional_usable_key, 161 bool has_additional_usable_key,
177 const std::vector<media::CdmKeyInformation>& key_info_vector) { 162 const std::vector<media::CdmKeyInformation>& key_info_vector) {
178 ProxyMediaKeys* media_keys = GetMediaKeys(cdm_id); 163 ProxyMediaKeys* media_keys = GetMediaKeys(cdm_id);
179 if (!media_keys) 164 if (!media_keys)
180 return; 165 return;
181 166
182 media::CdmKeysInfo keys_info; 167 media::CdmKeysInfo keys_info;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 proxy_media_keys_map_.erase(cdm_id); 228 proxy_media_keys_map_.erase(cdm_id);
244 } 229 }
245 230
246 ProxyMediaKeys* RendererCdmManager::GetMediaKeys(int cdm_id) { 231 ProxyMediaKeys* RendererCdmManager::GetMediaKeys(int cdm_id) {
247 std::map<int, ProxyMediaKeys*>::iterator iter = 232 std::map<int, ProxyMediaKeys*>::iterator iter =
248 proxy_media_keys_map_.find(cdm_id); 233 proxy_media_keys_map_.find(cdm_id);
249 return (iter != proxy_media_keys_map_.end()) ? iter->second : NULL; 234 return (iter != proxy_media_keys_map_.end()) ? iter->second : NULL;
250 } 235 }
251 236
252 } // namespace content 237 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698