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

Unified Diff: media/crypto/aes_decryptor.h

Issue 10822013: Code clean-up in AesDecryptor and test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/crypto/aes_decryptor.cc » ('j') | media/crypto/aes_decryptor.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/crypto/aes_decryptor.h
diff --git a/media/crypto/aes_decryptor.h b/media/crypto/aes_decryptor.h
index 86b258d71bc0b75165a7df31de60a5d6ffb6d1b2..8c666ac7eb8111bad52efc569fca328babe93888 100644
--- a/media/crypto/aes_decryptor.h
+++ b/media/crypto/aes_decryptor.h
@@ -89,6 +89,13 @@ class MEDIA_EXPORT AesDecryptor : public Decryptor {
DISALLOW_COPY_AND_ASSIGN(DecryptionKey);
};
+ // Sets |key| for |key_id|. The AesDecryptor takes the ownership of the |key|.
+ void SetKey(const std::string& key_id, scoped_ptr<DecryptionKey> key);
+
+ // Gets a DecryptionKey associated with |key_id|. The AesDecryptor still owns
+ // the key. Returns NULL if no key is associated with |key_id|.
+ DecryptionKey* GetKey(const std::string& key_id) const;
+
// KeyMap owns the DecryptionKey* and must delete them when they are
// not needed any more.
typedef base::hash_map<std::string, DecryptionKey*> KeyMap;
@@ -97,7 +104,7 @@ class MEDIA_EXPORT AesDecryptor : public Decryptor {
// protect |key_map_|, the only member variable that is shared between
// Decrypt() and other methods.
KeyMap key_map_; // Protected by the |key_map_lock_|.
- base::Lock key_map_lock_; // Protects the |key_map_|.
+ mutable base::Lock key_map_lock_; // Protects the |key_map_|.
// Make session ID unique per renderer by making it static.
// TODO(xhwang): Make session ID more strictly defined if needed:
« no previous file with comments | « no previous file | media/crypto/aes_decryptor.cc » ('j') | media/crypto/aes_decryptor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698