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

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 10545036: Add PPAPI decryptor interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add Decrypt/DecryptAndDecode Created 8 years, 6 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/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;
}
« webkit/plugins/ppapi/ppapi_plugin_instance.h ('K') | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698