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

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: Address 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
« no previous file with comments | « webkit/media/crypto/ppapi/clear_key_cdm.h ('k') | webkit/media/crypto/ppapi/content_decryption_module.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..729d07295adf0b007606531d74f756a18198a795 100644
--- a/webkit/media/crypto/ppapi/clear_key_cdm.cc
+++ b/webkit/media/crypto/ppapi/clear_key_cdm.cc
@@ -55,6 +55,7 @@ static bool g_cdm_module_initialized = InitializeFFmpegLibraries();
#endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER
static const char kClearKeyCdmVersion[] = "0.1.0.0";
+static const char kExternalClearKey[] = "org.chromium.externalclearkey";
// Copies |input_buffer| into a media::DecoderBuffer. If the |input_buffer| is
// empty, an empty (end-of-stream) media::DecoderBuffer is returned.
@@ -110,9 +111,16 @@ static Type* AllocateAndCopy(const Type* data, int size) {
return copy;
}
-cdm::ContentDecryptionModule* CreateCdmInstance(
- cdm::Allocator* allocator, cdm::CdmHost* host) {
+cdm::ContentDecryptionModule* CreateCdmInstance(const char* key_system_arg,
+ int key_system_size,
+ cdm::Allocator* allocator,
+ cdm::CdmHost* host) {
DVLOG(1) << "CreateCdmInstance()";
+
+ const std::string key_system(key_system_arg, key_system_size);
+ const std::string kExternalClearKeyString = kExternalClearKey;
xhwang 2012/10/26 23:39:15 does this work at all? DCHECK_EQ(key_system, kExt
ddorwin 2012/10/26 23:47:46 Whatever the case, we shouldn't create a std::stri
Tom Finegan 2012/10/26 23:52:25 Didn't even try... compiles/works fine, done.
+ DCHECK_EQ(key_system, kExternalClearKeyString);
ddorwin 2012/10/26 23:47:46 As discussed offline.
+
return new webkit_media::ClearKeyCdm(allocator, host);
}
@@ -189,13 +197,18 @@ ClearKeyCdm::ClearKeyCdm(cdm::Allocator* allocator, cdm::CdmHost*)
ClearKeyCdm::~ClearKeyCdm() {}
-cdm::Status ClearKeyCdm::GenerateKeyRequest(const uint8_t* init_data,
+cdm::Status ClearKeyCdm::GenerateKeyRequest(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 = kExternalClearKey;
+ decryptor_.GenerateKeyRequest(key_system, init_data, init_data_size);
xhwang 2012/10/26 23:39:15 nit: pass in kExternalClearKey directly?
Tom Finegan 2012/10/26 23:52:25 Done.
if (client_.status() != Client::kKeyMessage)
return cdm::kSessionError;
« no previous file with comments | « webkit/media/crypto/ppapi/clear_key_cdm.h ('k') | webkit/media/crypto/ppapi/content_decryption_module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698