diff options
author | tomfinegan@chromium.org <tomfinegan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-22 04:06:22 +0000 |
---|---|---|
committer | tomfinegan@chromium.org <tomfinegan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-22 04:06:22 +0000 |
commit | 98ad978a19cde1e63c666502db6e4986a82e476b (patch) | |
tree | 8a6e21b078d73a7f8083d3d4e0d4e3256bfc2f12 /webkit/plugins | |
parent | 26f4694825ed31bd0e01856d2c3654d935d1a1fc (diff) | |
download | chromium_src-98ad978a19cde1e63c666502db6e4986a82e476b.zip chromium_src-98ad978a19cde1e63c666502db6e4986a82e476b.tar.gz chromium_src-98ad978a19cde1e63c666502db6e4986a82e476b.tar.bz2 |
Modify the PPAPI CDM interface to pass more info.
Builds on interface work done by xhwang in issue 10857027.
Add init_data argument to AddKey.
Change the PPP Decrypt methods to take PP_EncryptedBlockInfo structs
instead of simple integer identifiers.
Change the PPB delivery methods to take PP_DecryptedBlockInfo structs
instead of simple integer identifiers.
Update the proxy code accordingly.
BUG=138139
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10854209
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152724 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.cc | 26 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.h | 10 |
2 files changed, 25 insertions, 11 deletions
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc index 0af8dc1..1137890 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc @@ -27,6 +27,7 @@ #include "ppapi/c/ppp_instance.h" #include "ppapi/c/ppp_messaging.h" #include "ppapi/c/ppp_mouse_lock.h" +#include "ppapi/c/private/pp_content_decryptor.h" #include "ppapi/c/private/ppp_instance_private.h" #include "ppapi/shared_impl/ppb_input_event_shared.h" #include "ppapi/shared_impl/ppb_url_util_shared.h" @@ -1334,17 +1335,23 @@ bool PluginInstance::GenerateKeyRequest(const std::string& key_system, } bool PluginInstance::AddKey(const std::string& session_id, - const std::string& key) { + const std::string& key, + const std::string& init_data) { if (!LoadContentDecryptorInterface()) return false; PP_Var key_array = PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar(key.size(), key.data()); + PP_Var init_data_array = + PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar( + init_data.size(), + init_data.data()); return PP_ToBool(plugin_decryption_interface_->AddKey( pp_instance(), StringVar::StringToPPVar(session_id), - key_array)); + key_array, + init_data_array)); } bool PluginInstance::CancelKeyRequest(const std::string& session_id) { @@ -1365,10 +1372,12 @@ bool PluginInstance::Decrypt(const base::StringPiece& encrypted_block, if (!encrypted_resource.get()) return false; + PP_EncryptedBlockInfo block_info; + // TODO(tomfinegan): Store callback and ID in a map, and pass ID to decryptor. return PP_ToBool(plugin_decryption_interface_->Decrypt(pp_instance(), encrypted_resource, - 0)); + &block_info)); } bool PluginInstance::DecryptAndDecode(const base::StringPiece& encrypted_block, @@ -1379,11 +1388,14 @@ bool PluginInstance::DecryptAndDecode(const base::StringPiece& encrypted_block, encrypted_block)); if (!encrypted_resource.get()) return false; + + PP_EncryptedBlockInfo block_info; + // TODO(tomfinegan): Store callback and ID in a map, and pass ID to decryptor. return PP_ToBool(plugin_decryption_interface_->DecryptAndDecode( pp_instance(), encrypted_resource, - 0)); + &block_info)); } bool PluginInstance::FlashIsFullscreenOrPending() { @@ -2025,20 +2037,20 @@ void PluginInstance::KeyError(PP_Instance instance, void PluginInstance::DeliverBlock(PP_Instance instance, PP_Resource decrypted_block, - int32_t request_id) { + const PP_DecryptedBlockInfo* block_info) { // TODO(xhwang): Pass the decrypted block back to media stack. } void PluginInstance::DeliverFrame(PP_Instance instance, PP_Resource decrypted_frame, - int32_t request_id) { + const PP_DecryptedBlockInfo* block_info) { // TODO(tomfinegan): To be implemented after completion of v0.1 of the // EME/CDM work. } void PluginInstance::DeliverSamples(PP_Instance instance, PP_Resource decrypted_samples, - int32_t request_id) { + const PP_DecryptedBlockInfo* block_info) { // TODO(tomfinegan): To be implemented after completion of v0.1 of the // EME/CDM work. } diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.h b/webkit/plugins/ppapi/ppapi_plugin_instance.h index 1d00b3c..89c5be1 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.h +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h @@ -53,6 +53,7 @@ #include "webkit/plugins/ppapi/ppp_pdf.h" #include "webkit/plugins/webkit_plugins_export.h" +struct PP_DecryptedBlockInfo; struct PP_Point; class SkBitmap; @@ -245,7 +246,8 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance : bool GenerateKeyRequest(const std::string& key_system, const std::string& init_data); bool AddKey(const std::string& session_id, - const std::string& key); + const std::string& key, + const std::string& init_data); bool CancelKeyRequest(const std::string& session_id); bool Decrypt(const base::StringPiece& encypted_block, const DecryptedDataCB& callback); @@ -445,13 +447,13 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance : int32_t system_code) OVERRIDE; virtual void DeliverBlock(PP_Instance instance, PP_Resource decrypted_block, - int32_t request_id) OVERRIDE; + const PP_DecryptedBlockInfo* block_info) OVERRIDE; virtual void DeliverFrame(PP_Instance instance, PP_Resource decrypted_frame, - int32_t request_id) OVERRIDE; + const PP_DecryptedBlockInfo* block_info) OVERRIDE; virtual void DeliverSamples(PP_Instance instance, PP_Resource decrypted_samples, - int32_t request_id) OVERRIDE; + const PP_DecryptedBlockInfo* block_info) OVERRIDE; // Reset this instance as proxied. Resets cached interfaces to point to the // proxy and re-sends DidCreate, DidChangeView, and HandleDocumentLoad (if |