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

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

Issue 813683005: Add |legacy_destination_url| back to SessionMessage for EME (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes Created 5 years, 11 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/proxy_media_keys.h" 5 #include "content/renderer/media/crypto/proxy_media_keys.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 scoped_ptr<media::CdmPromise> promise = TakePromise(session_id); 154 scoped_ptr<media::CdmPromise> promise = TakePromise(session_id);
155 if (promise) { 155 if (promise) {
156 media::NewSessionCdmPromise* session_promise( 156 media::NewSessionCdmPromise* session_promise(
157 static_cast<media::NewSessionCdmPromise*>(promise.get())); 157 static_cast<media::NewSessionCdmPromise*>(promise.get()));
158 session_promise->resolve(web_session_id); 158 session_promise->resolve(web_session_id);
159 } 159 }
160 } 160 }
161 161
162 void ProxyMediaKeys::OnSessionMessage(uint32 session_id, 162 void ProxyMediaKeys::OnSessionMessage(uint32 session_id,
163 const std::vector<uint8>& message, 163 const std::vector<uint8>& message,
164 const GURL& destination_url) { 164 const GURL& legacy_destination_url) {
165 // TODO(jrummell): Once |message_type| is passed, use it rather than 165 // TODO(jrummell): Once |message_type| is passed, use it rather than
166 // guessing from the URL. 166 // guessing from the URL.
167 media::MediaKeys::MessageType message_type = 167 media::MediaKeys::MessageType message_type =
168 destination_url.is_empty() ? media::MediaKeys::LICENSE_REQUEST 168 legacy_destination_url.is_empty() ? media::MediaKeys::LICENSE_REQUEST
169 : media::MediaKeys::LICENSE_RENEWAL; 169 : media::MediaKeys::LICENSE_RENEWAL;
170 session_message_cb_.Run(LookupWebSessionId(session_id), message_type, 170 session_message_cb_.Run(LookupWebSessionId(session_id), message_type, message,
171 message); 171 legacy_destination_url);
172 } 172 }
173 173
174 void ProxyMediaKeys::OnSessionReady(uint32 session_id) { 174 void ProxyMediaKeys::OnSessionReady(uint32 session_id) {
175 scoped_ptr<media::CdmPromise> promise = TakePromise(session_id); 175 scoped_ptr<media::CdmPromise> promise = TakePromise(session_id);
176 if (promise) { 176 if (promise) {
177 media::SimpleCdmPromise* simple_promise( 177 media::SimpleCdmPromise* simple_promise(
178 static_cast<media::SimpleCdmPromise*>(promise.get())); 178 static_cast<media::SimpleCdmPromise*>(promise.get()));
179 simple_promise->resolve(); 179 simple_promise->resolve();
180 } 180 }
181 } 181 }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 287
288 scoped_ptr<media::CdmPromise> ProxyMediaKeys::TakePromise(uint32_t session_id) { 288 scoped_ptr<media::CdmPromise> ProxyMediaKeys::TakePromise(uint32_t session_id) {
289 PromiseMap::iterator it = session_id_to_promise_map_.find(session_id); 289 PromiseMap::iterator it = session_id_to_promise_map_.find(session_id);
290 // May not be a promise associated with this session for asynchronous events. 290 // May not be a promise associated with this session for asynchronous events.
291 if (it == session_id_to_promise_map_.end()) 291 if (it == session_id_to_promise_map_.end())
292 return scoped_ptr<media::CdmPromise>(); 292 return scoped_ptr<media::CdmPromise>();
293 return session_id_to_promise_map_.take_and_erase(it); 293 return session_id_to_promise_map_.take_and_erase(it);
294 } 294 }
295 295
296 } // namespace content 296 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/crypto/proxy_media_keys.h ('k') | content/renderer/pepper/content_decryptor_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698