Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc |
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
index 429dd03d4c65297cf1180a606232516017f62711..8e80568437fba7cbe3209fbceacae646d4e24d96 100644 |
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
@@ -323,6 +323,7 @@ PluginInstance::PluginInstance( |
has_content_area_focus_(false), |
find_identifier_(-1), |
resource_creation_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
+ plugin_decryption_interface_(NULL), |
plugin_find_interface_(NULL), |
plugin_messaging_interface_(NULL), |
plugin_mouse_lock_interface_(NULL), |
@@ -954,6 +955,16 @@ void PluginInstance::StopFind() { |
plugin_find_interface_->StopFind(pp_instance()); |
} |
+bool PluginInstance::LoadContentDecryptionModuleInterface() { |
+ if (!plugin_decryption_interface_) { |
+ plugin_decryption_interface_ = |
+ static_cast<const PPP_ContentDecryptionModule_Dev*>( |
+ module_->GetPluginInterface( |
+ PPP_CONTENTDECRYPTIONMODULE_DEV_INTERFACE)); |
+ } |
+ return !!plugin_decryption_interface_; |
+} |
+ |
bool PluginInstance::LoadFindInterface() { |
if (!plugin_find_interface_) { |
plugin_find_interface_ = |
@@ -1252,6 +1263,34 @@ void PluginInstance::RotateView(WebPlugin::RotationType type) { |
// NOTE: plugin instance may have been deleted. |
} |
+bool PluginInstance::AddKey(PP_Resource key) { |
+ if (!LoadContentDecryptionModuleInterface()) |
+ return false; |
+ return (plugin_decryption_interface_->AddKey(pp_instance(), key) == PP_TRUE); |
+} |
+ |
+bool PluginInstance::Decrypt(PP_Resource encrypted_block, |
+ PP_Resource decrypted_block, |
+ PP_CompletionCallback callback) { |
+ if (!LoadContentDecryptionModuleInterface()) |
+ return false; |
+ return (plugin_decryption_interface_->Decrypt(pp_instance(), |
+ encrypted_block, |
+ decrypted_block, |
+ callback) == PP_TRUE); |
+} |
+ |
+bool PluginInstance::DecryptAndDecode(PP_Resource encrypted_block, |
+ PP_Resource decoded_frame, |
+ PP_CompletionCallback callback) { |
+ if (!LoadContentDecryptionModuleInterface()) |
+ return false; |
+ return (plugin_decryption_interface_->DecryptAndDecode(pp_instance(), |
+ encrypted_block, |
+ decoded_frame, |
+ callback) == PP_TRUE); |
+} |
+ |
bool PluginInstance::FlashIsFullscreenOrPending() { |
return fullscreen_container_ != NULL; |
} |