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

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

Issue 2234753002: media: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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/cast/test/end2end_unittest.cc ('k') | media/cdm/player_tracker_impl.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 23 matching lines...) Expand all
34 // insertion time (last insertion is first). It takes ownership of the 34 // insertion time (last insertion is first). It takes ownership of the
35 // DecryptionKeys. 35 // DecryptionKeys.
36 class AesDecryptor::SessionIdDecryptionKeyMap { 36 class AesDecryptor::SessionIdDecryptionKeyMap {
37 // Use a std::list to actually hold the data. Insertion is always done 37 // Use a std::list to actually hold the data. Insertion is always done
38 // at the front, so the "latest" decryption key is always the first one 38 // at the front, so the "latest" decryption key is always the first one
39 // in the list. 39 // in the list.
40 typedef std::list<std::pair<std::string, DecryptionKey*> > KeyList; 40 typedef std::list<std::pair<std::string, DecryptionKey*> > KeyList;
41 41
42 public: 42 public:
43 SessionIdDecryptionKeyMap() {} 43 SessionIdDecryptionKeyMap() {}
44 ~SessionIdDecryptionKeyMap() { STLDeleteValues(&key_list_); } 44 ~SessionIdDecryptionKeyMap() { base::STLDeleteValues(&key_list_); }
45 45
46 // Replaces value if |session_id| is already present, or adds it if not. 46 // Replaces value if |session_id| is already present, or adds it if not.
47 // This |decryption_key| becomes the latest until another insertion or 47 // This |decryption_key| becomes the latest until another insertion or
48 // |session_id| is erased. 48 // |session_id| is erased.
49 void Insert(const std::string& session_id, 49 void Insert(const std::string& session_id,
50 std::unique_ptr<DecryptionKey> decryption_key); 50 std::unique_ptr<DecryptionKey> decryption_key);
51 51
52 // Deletes the entry for |session_id| if present. 52 // Deletes the entry for |session_id| if present.
53 void Erase(const std::string& session_id); 53 void Erase(const std::string& session_id);
54 54
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 bool AesDecryptor::DecryptionKey::Init() { 614 bool AesDecryptor::DecryptionKey::Init() {
615 CHECK(!secret_.empty()); 615 CHECK(!secret_.empty());
616 decryption_key_ = 616 decryption_key_ =
617 crypto::SymmetricKey::Import(crypto::SymmetricKey::AES, secret_); 617 crypto::SymmetricKey::Import(crypto::SymmetricKey::AES, secret_);
618 if (!decryption_key_) 618 if (!decryption_key_)
619 return false; 619 return false;
620 return true; 620 return true;
621 } 621 }
622 622
623 } // namespace media 623 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/test/end2end_unittest.cc ('k') | media/cdm/player_tracker_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698