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

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

Issue 10871006: Connect PpapiDecryptor and PluginInstance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolve comments. Created 8 years, 4 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.h
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.h b/webkit/plugins/ppapi/ppapi_plugin_instance.h
index 89c5be1b2175dd52b6f6b48549a2ea746a8b618f..5755f1637586257c4359878f5aaa7d6245cb5547 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.h
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h
@@ -17,6 +17,7 @@
#include "base/memory/weak_ptr.h"
#include "base/string16.h"
#include "googleurl/src/gurl.h"
+#include "media/base/decryptor.h"
#include "ppapi/c/dev/pp_cursor_type_dev.h"
#include "ppapi/c/dev/ppp_printing_dev.h"
#include "ppapi/c/dev/ppp_find_dev.h"
@@ -68,6 +69,11 @@ struct WebCursorInfo;
struct WebPrintParams;
}
+namespace media {
+class DecoderBuffer;
+class DecryptorClient;
+}
+
namespace ppapi {
struct InputEventData;
struct PPP_Instance_Combined;
@@ -242,17 +248,19 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
// Provides access to PPP_ContentDecryptor_Private.
// TODO(tomfinegan): Move decryptor methods to delegate class.
- typedef base::Callback<void(void*, int)> DecryptedDataCB;
+ void set_decrypt_client(media::DecryptorClient* client);
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& init_data);
bool CancelKeyRequest(const std::string& session_id);
- bool Decrypt(const base::StringPiece& encypted_block,
- const DecryptedDataCB& callback);
- bool DecryptAndDecode(const base::StringPiece& encypted_block,
- const DecryptedDataCB& callback);
+ bool Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted_buffer,
+ const media::Decryptor::DecryptCB& decrypt_cb);
+ // TODO(xhwang): Update this when we need to support decrypt and decode.
+ bool DecryptAndDecode(
+ const scoped_refptr<media::DecoderBuffer>& encrypted_buffer,
+ const media::Decryptor::DecryptCB& decrypt_cb);
// There are 2 implementations of the fullscreen interface
// PPB_FlashFullscreen is used by Pepper Flash.
@@ -728,6 +736,11 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
// the pointer so we can re-send it later if we are reset to talk to NaCl.
scoped_refptr<PPB_URLLoader_Impl> document_loader_;
+ media::DecryptorClient* decryptor_client_;
+ int next_decryption_request_id_;
+ typedef std::map<int, media::Decryptor::DecryptCB> DecryptionCBMap;
+ DecryptionCBMap pending_decryption_cbs_;
+
DISALLOW_COPY_AND_ASSIGN(PluginInstance);
};

Powered by Google App Engine
This is Rietveld 408576698