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

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

Issue 2895573002: Reland of Remove ScopedVector from all other codes in media/ (Closed)
Patch Set: Fix the compile fails in build target "jpeg_decode_accelerator_unittest" Created 3 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 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>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/ptr_util.h"
14 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
15 #include "crypto/encryptor.h" 16 #include "crypto/encryptor.h"
16 #include "crypto/symmetric_key.h" 17 #include "crypto/symmetric_key.h"
17 #include "media/base/audio_decoder_config.h" 18 #include "media/base/audio_decoder_config.h"
18 #include "media/base/cdm_promise.h" 19 #include "media/base/cdm_promise.h"
19 #include "media/base/decoder_buffer.h" 20 #include "media/base/decoder_buffer.h"
20 #include "media/base/decrypt_config.h" 21 #include "media/base/decrypt_config.h"
21 #include "media/base/limits.h" 22 #include "media/base/limits.h"
22 #include "media/base/video_decoder_config.h" 23 #include "media/base/video_decoder_config.h"
23 #include "media/base/video_frame.h" 24 #include "media/base/video_frame.h"
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 649
649 CdmKeysInfo AesDecryptor::GenerateKeysInfoList( 650 CdmKeysInfo AesDecryptor::GenerateKeysInfoList(
650 const std::string& session_id, 651 const std::string& session_id,
651 CdmKeyInformation::KeyStatus status) { 652 CdmKeyInformation::KeyStatus status) {
652 // Create the list of all available keys for this session. 653 // Create the list of all available keys for this session.
653 CdmKeysInfo keys_info; 654 CdmKeysInfo keys_info;
654 { 655 {
655 base::AutoLock auto_lock(key_map_lock_); 656 base::AutoLock auto_lock(key_map_lock_);
656 for (const auto& item : key_map_) { 657 for (const auto& item : key_map_) {
657 if (item.second->Contains(session_id)) { 658 if (item.second->Contains(session_id)) {
658 keys_info.push_back(new CdmKeyInformation(item.first, status, 0)); 659 keys_info.push_back(
660 base::MakeUnique<CdmKeyInformation>(item.first, status, 0));
659 } 661 }
660 } 662 }
661 } 663 }
662 return keys_info; 664 return keys_info;
663 } 665 }
664 666
665 AesDecryptor::DecryptionKey::DecryptionKey(const std::string& secret) 667 AesDecryptor::DecryptionKey::DecryptionKey(const std::string& secret)
666 : secret_(secret) { 668 : secret_(secret) {
667 } 669 }
668 670
669 AesDecryptor::DecryptionKey::~DecryptionKey() {} 671 AesDecryptor::DecryptionKey::~DecryptionKey() {}
670 672
671 bool AesDecryptor::DecryptionKey::Init() { 673 bool AesDecryptor::DecryptionKey::Init() {
672 CHECK(!secret_.empty()); 674 CHECK(!secret_.empty());
673 decryption_key_ = 675 decryption_key_ =
674 crypto::SymmetricKey::Import(crypto::SymmetricKey::AES, secret_); 676 crypto::SymmetricKey::Import(crypto::SymmetricKey::AES, secret_);
675 if (!decryption_key_) 677 if (!decryption_key_)
676 return false; 678 return false;
677 return true; 679 return true;
678 } 680 }
679 681
680 } // namespace media 682 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/webcontentdecryptionmodulesession_impl.cc ('k') | media/cdm/aes_decryptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698