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

Unified Diff: webkit/media/crypto/ppapi/clear_key_cdm.cc

Issue 11270057: Add type argument to pepper content decryptor method GenerateKeyRequest(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on 11274065, and addressed comments. Created 8 years, 2 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: webkit/media/crypto/ppapi/clear_key_cdm.cc
diff --git a/webkit/media/crypto/ppapi/clear_key_cdm.cc b/webkit/media/crypto/ppapi/clear_key_cdm.cc
index dd6a3dc3427cb8d5d342454749d7d7e84c3e7710..3ac3e63db65e8d84bd5517d5e42d1b2c65a250f5 100644
--- a/webkit/media/crypto/ppapi/clear_key_cdm.cc
+++ b/webkit/media/crypto/ppapi/clear_key_cdm.cc
@@ -110,9 +110,16 @@ static Type* AllocateAndCopy(const Type* data, int size) {
return copy;
}
-cdm::ContentDecryptionModule* CreateCdmInstance(
- cdm::Allocator* allocator, cdm::CdmHost* host) {
+cdm::ContentDecryptionModule* CreateCdmInstance(cdm::Allocator* allocator,
+ cdm::CdmHost* host,
+ const char* key_system_arg,
+ int key_system_size) {
DVLOG(1) << "CreateCdmInstance()";
+
+ const std::string key_system(key_system_arg, key_system_size);
+ const std::string kExternalClearKey = "org.chromium.externalclearkey";
xhwang 2012/10/26 23:08:09 how about defining this as file scoped static cons
Tom Finegan 2012/10/26 23:30:18 Done.
+ DCHECK_EQ(key_system, kExternalClearKey);
+
return new webkit_media::ClearKeyCdm(allocator, host);
}
@@ -189,13 +196,20 @@ ClearKeyCdm::ClearKeyCdm(cdm::Allocator* allocator, cdm::CdmHost*)
ClearKeyCdm::~ClearKeyCdm() {}
-cdm::Status ClearKeyCdm::GenerateKeyRequest(const uint8_t* init_data,
+cdm::Status ClearKeyCdm::GenerateKeyRequest(const char* key_system_arg,
+ int key_system_size,
+ const char* /* type */,
+ int /* type_size */,
+ const uint8_t* init_data,
int init_data_size,
cdm::KeyMessage* key_request) {
DVLOG(1) << "GenerateKeyRequest()";
base::AutoLock auto_lock(client_lock_);
ScopedResetter<Client> auto_resetter(&client_);
- decryptor_.GenerateKeyRequest("", init_data, init_data_size);
+
+ // TODO(tomfinegan): Extend the Decryptor interface for passing |type|.
+ const std::string key_system(key_system_arg, key_system_size);
+ decryptor_.GenerateKeyRequest(key_system, init_data, init_data_size);
if (client_.status() != Client::kKeyMessage)
return cdm::kSessionError;

Powered by Google App Engine
This is Rietveld 408576698