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

Side by Side Diff: media/cdm/aes_decryptor.cc

Issue 2568463003: media: Rename MediaKeys to ContentDecryptionModule (Closed)
Patch Set: comments addressed Created 4 years 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/cdm/aes_decryptor.h ('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 <stddef.h> 7 #include <stddef.h>
8 #include <list> 8 #include <list>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 // TODO(jrummell): Convert back to a DCHECK once prefixed EME is removed. 332 // TODO(jrummell): Convert back to a DCHECK once prefixed EME is removed.
333 if (valid_sessions_.find(session_id) == valid_sessions_.end()) { 333 if (valid_sessions_.find(session_id) == valid_sessions_.end()) {
334 promise->reject(CdmPromise::INVALID_ACCESS_ERROR, 0, 334 promise->reject(CdmPromise::INVALID_ACCESS_ERROR, 0,
335 "Session does not exist."); 335 "Session does not exist.");
336 return; 336 return;
337 } 337 }
338 338
339 std::string key_string(response.begin(), response.end()); 339 std::string key_string(response.begin(), response.end());
340 340
341 KeyIdAndKeyPairs keys; 341 KeyIdAndKeyPairs keys;
342 SessionType session_type = MediaKeys::TEMPORARY_SESSION; 342 SessionType session_type = ContentDecryptionModule::TEMPORARY_SESSION;
343 if (!ExtractKeysFromJWKSet(key_string, &keys, &session_type)) { 343 if (!ExtractKeysFromJWKSet(key_string, &keys, &session_type)) {
344 promise->reject(CdmPromise::INVALID_ACCESS_ERROR, 0, 344 promise->reject(CdmPromise::INVALID_ACCESS_ERROR, 0,
345 "Response is not a valid JSON Web Key Set."); 345 "Response is not a valid JSON Web Key Set.");
346 return; 346 return;
347 } 347 }
348 348
349 // Make sure that at least one key was extracted. 349 // Make sure that at least one key was extracted.
350 if (keys.empty()) { 350 if (keys.empty()) {
351 promise->reject(CdmPromise::INVALID_ACCESS_ERROR, 0, 351 promise->reject(CdmPromise::INVALID_ACCESS_ERROR, 0,
352 "Response does not contain any keys."); 352 "Response does not contain any keys.");
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 bool AesDecryptor::DecryptionKey::Init() { 602 bool AesDecryptor::DecryptionKey::Init() {
603 CHECK(!secret_.empty()); 603 CHECK(!secret_.empty());
604 decryption_key_ = 604 decryption_key_ =
605 crypto::SymmetricKey::Import(crypto::SymmetricKey::AES, secret_); 605 crypto::SymmetricKey::Import(crypto::SymmetricKey::AES, secret_);
606 if (!decryption_key_) 606 if (!decryption_key_)
607 return false; 607 return false;
608 return true; 608 return true;
609 } 609 }
610 610
611 } // namespace media 611 } // namespace media
OLDNEW
« no previous file with comments | « media/cdm/aes_decryptor.h ('k') | media/cdm/aes_decryptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698