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

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

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