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

Unified Diff: media/crypto/aes_decryptor.cc

Issue 10539150: Add Decryptor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move decryptor.* and decryptor_client.h to src/media/base/ Created 8 years, 6 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
Index: media/crypto/aes_decryptor.cc
diff --git a/media/crypto/aes_decryptor.cc b/media/crypto/aes_decryptor.cc
index 49275fb7f031db0c45b46da9d61bffbe179f493c..1807b85501de1966d279ebad8c99ca5715888063 100644
--- a/media/crypto/aes_decryptor.cc
+++ b/media/crypto/aes_decryptor.cc
@@ -12,7 +12,7 @@
#include "crypto/symmetric_key.h"
#include "media/base/decoder_buffer.h"
#include "media/base/decrypt_config.h"
-#include "media/crypto/decryptor_client.h"
+#include "media/base/decryptor_client.h"
namespace media {
@@ -53,7 +53,7 @@ static scoped_refptr<DecoderBuffer> DecryptData(const DecoderBuffer& input,
}
AesDecryptor::AesDecryptor(DecryptorClient* client)
- : client_(client) {
+ : Decryptor(client) {
}
AesDecryptor::~AesDecryptor() {
@@ -70,8 +70,8 @@ void AesDecryptor::GenerateKeyRequest(const std::string& key_system,
scoped_array<uint8> message(new uint8[message_length]);
memcpy(message.get(), init_data, message_length);
- client_->KeyMessage(key_system, session_id_string,
- message.Pass(), message_length, "");
+ client()->KeyMessage(key_system, session_id_string,
+ message.Pass(), message_length, "");
}
void AesDecryptor::AddKey(const std::string& key_system,
@@ -89,7 +89,7 @@ void AesDecryptor::AddKey(const std::string& key_system,
const int kSupportedKeyLength = 16; // 128-bit key.
if (key_length != kSupportedKeyLength) {
DVLOG(1) << "Invalid key length: " << key_length;
- client_->KeyError(key_system, session_id, kUnknownError, 0);
+ client()->KeyError(key_system, session_id, Decryptor::kUnknownError, 0);
return;
}
@@ -110,7 +110,7 @@ void AesDecryptor::AddKey(const std::string& key_system,
crypto::SymmetricKey::AES, key_string);
if (!symmetric_key) {
DVLOG(1) << "Could not import key.";
- client_->KeyError(key_system, session_id, kUnknownError, 0);
+ client()->KeyError(key_system, session_id, Decryptor::kUnknownError, 0);
return;
}
@@ -124,7 +124,7 @@ void AesDecryptor::AddKey(const std::string& key_system,
key_map_[key_id_string] = symmetric_key;
}
- client_->KeyAdded(key_system, session_id);
+ client()->KeyAdded(key_system, session_id);
}
void AesDecryptor::CancelKeyRequest(const std::string& key_system,

Powered by Google App Engine
This is Rietveld 408576698