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

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 and addressed TODOs related to integration of this CL. 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 7a7be26511abdccbc9d782e228f9787eb4b0ce5e..93d19d5e8d0be78c1e9771c0d37034dc4f40fff6 100644
--- a/webkit/media/crypto/ppapi/clear_key_cdm.cc
+++ b/webkit/media/crypto/ppapi/clear_key_cdm.cc
@@ -54,6 +54,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.
@@ -116,9 +117,12 @@ void INITIALIZE_CDM_MODULE() {
void DeInitializeCdmModule() {
}
-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()";
+ DCHECK_EQ(std::string(key_system_arg, key_system_size), kExternalClearKey);
return new webkit_media::ClearKeyCdm(allocator, host);
}
@@ -196,14 +200,16 @@ 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_);
- // TODO(tomfinegan): Pass "type" here once ContentDecryptionModule is updated.
- decryptor_.GenerateKeyRequest("", "", init_data, init_data_size);
+ decryptor_.GenerateKeyRequest(kExternalClearKey,
+ std::string(type, type_size),
+ init_data, init_data_size);
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