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

Side by Side Diff: media/cdm/aes_decryptor.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
« no previous file with comments | « media/blink/cdm_session_adapter.cc ('k') | media/cdm/aes_decryptor_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "media/cdm/aes_decryptor.h" 5 #include "media/cdm/aes_decryptor.h"
6 6
7 #include <list> 7 #include <list>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 // For now, the AesDecryptor does not care about |init_data_type| or 258 // For now, the AesDecryptor does not care about |init_data_type| or
259 // |session_type|; just resolve the promise and then fire a message event 259 // |session_type|; just resolve the promise and then fire a message event
260 // using the |init_data| as the key ID in the license request. 260 // using the |init_data| as the key ID in the license request.
261 // TODO(jrummell): Validate |init_data_type| and |session_type|. 261 // TODO(jrummell): Validate |init_data_type| and |session_type|.
262 std::vector<uint8> message; 262 std::vector<uint8> message;
263 if (init_data && init_data_length) 263 if (init_data && init_data_length)
264 CreateLicenseRequest(init_data, init_data_length, session_type, &message); 264 CreateLicenseRequest(init_data, init_data_length, session_type, &message);
265 265
266 promise->resolve(web_session_id); 266 promise->resolve(web_session_id);
267 267
268 session_message_cb_.Run(web_session_id, LICENSE_REQUEST, message); 268 // No URL needed for license requests.
269 session_message_cb_.Run(web_session_id, LICENSE_REQUEST, message,
270 GURL::EmptyGURL());
269 } 271 }
270 272
271 void AesDecryptor::LoadSession(SessionType session_type, 273 void AesDecryptor::LoadSession(SessionType session_type,
272 const std::string& web_session_id, 274 const std::string& web_session_id,
273 scoped_ptr<NewSessionCdmPromise> promise) { 275 scoped_ptr<NewSessionCdmPromise> promise) {
274 // TODO(xhwang): Change this to NOTREACHED() when blink checks for key systems 276 // TODO(xhwang): Change this to NOTREACHED() when blink checks for key systems
275 // that do not support loadSession. See http://crbug.com/342481 277 // that do not support loadSession. See http://crbug.com/342481
276 promise->reject(NOT_SUPPORTED_ERROR, 0, "LoadSession() is not supported."); 278 promise->reject(NOT_SUPPORTED_ERROR, 0, "LoadSession() is not supported.");
277 } 279 }
278 280
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 bool AesDecryptor::DecryptionKey::Init() { 549 bool AesDecryptor::DecryptionKey::Init() {
548 CHECK(!secret_.empty()); 550 CHECK(!secret_.empty());
549 decryption_key_.reset(crypto::SymmetricKey::Import( 551 decryption_key_.reset(crypto::SymmetricKey::Import(
550 crypto::SymmetricKey::AES, secret_)); 552 crypto::SymmetricKey::AES, secret_));
551 if (!decryption_key_) 553 if (!decryption_key_)
552 return false; 554 return false;
553 return true; 555 return true;
554 } 556 }
555 557
556 } // namespace media 558 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/cdm_session_adapter.cc ('k') | media/cdm/aes_decryptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698