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

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: 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..0e4ca73e88dc785b2c73b727cbe7a697d65c7e8a 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.h
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h
@@ -16,6 +16,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/string16.h"
+#include "media/base/decryptor.h"
ddorwin 2012/08/22 01:26:26 After 20
xhwang 2012/08/24 00:51:51 Done.
#include "googleurl/src/gurl.h"
#include "ppapi/c/dev/pp_cursor_type_dev.h"
#include "ppapi/c/dev/ppp_printing_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 SetDecryptClient(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_;
+ uint64_t next_decryption_request_id_;
ddorwin 2012/08/22 04:09:21 Does this need to be unsigned? Does it really need
xhwang 2012/08/24 00:51:51 Done.
+ typedef std::map<uint64, media::Decryptor::DecryptCB> DecryptionCBMap;
+ DecryptionCBMap pending_decryption_cbs_;
+
DISALLOW_COPY_AND_ASSIGN(PluginInstance);
};

Powered by Google App Engine
This is Rietveld 408576698