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

Unified Diff: webkit/media/crypto/ppapi/content_decryption_module.h

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
Index: webkit/media/crypto/ppapi/content_decryption_module.h
diff --git a/webkit/media/crypto/ppapi/content_decryption_module.h b/webkit/media/crypto/ppapi/content_decryption_module.h
index 7785dae1d3db3358fb1c73eb9568918dbeb29ef9..d1c277199537ae6b30f9e11d508175cb3f7ea670 100644
--- a/webkit/media/crypto/ppapi/content_decryption_module.h
+++ b/webkit/media/crypto/ppapi/content_decryption_module.h
@@ -26,7 +26,10 @@ extern "C" {
// Caller retains ownership of arguments, which must outlive the call to
// DestroyCdmInstance below.
CDM_EXPORT cdm::ContentDecryptionModule* CreateCdmInstance(
- cdm::Allocator* allocator, cdm::CdmHost* host);
+ const char* key_system,
+ int key_system_size,
+ cdm::Allocator* allocator,
+ cdm::CdmHost* host);
CDM_EXPORT void DestroyCdmInstance(cdm::ContentDecryptionModule* instance);
CDM_EXPORT const char* GetCdmVersion();
}
@@ -204,7 +207,7 @@ enum StreamType {
// when a Buffer is created that will never be returned to the caller.
class ContentDecryptionModule {
public:
- // Generates a |key_request| given the |init_data|.
+ // Generates a |key_request| given |type| and |init_data|.
//
// Returns kSuccess if the key request was successfully generated,
// in which case the callee should have allocated memory for the output
@@ -212,32 +215,26 @@ class ContentDecryptionModule {
// to the caller.
// Returns kSessionError if any error happened, in which case the
// |key_request| should not be used by the caller.
- //
- // TODO(xhwang): It's not safe to pass the ownership of the dynamically
- // allocated memory over library boundaries. Fix it after related PPAPI change
- // and sample CDM are landed.
- virtual Status GenerateKeyRequest(const uint8_t* init_data,
- int init_data_size,
- KeyMessage* key_request) = 0;
+ virtual Status GenerateKeyRequest(
+ const char* type, int type_size,
+ const uint8_t* init_data, int init_data_size,
+ KeyMessage* key_request) = 0;
// Adds the |key| to the CDM to be associated with |key_id|.
//
// Returns kSuccess if the key was successfully added, kSessionError
// otherwise.
- virtual Status AddKey(const char* session_id,
- int session_id_size,
- const uint8_t* key,
- int key_size,
- const uint8_t* key_id,
- int key_id_size) = 0;
+ virtual Status AddKey(const char* session_id, int session_id_size,
+ const uint8_t* key, int key_size,
+ const uint8_t* key_id, int key_id_size) = 0;
// Cancels any pending key request made to the CDM for |session_id|.
//
// Returns kSuccess if all pending key requests for |session_id| were
// successfully canceled or there was no key request to be canceled,
// kSessionError otherwise.
- virtual Status CancelKeyRequest(const char* session_id,
- int session_id_size) = 0;
+ virtual Status CancelKeyRequest(
+ const char* session_id, int session_id_size) = 0;
// Optionally populates |*msg| and indicates so in |*populated|.
virtual void TimerExpired(KeyMessage* msg, bool* populated) = 0;

Powered by Google App Engine
This is Rietveld 408576698