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

Unified Diff: ppapi/proxy/plugin_dispatcher.h

Issue 6400007: Implement proxy for 3d-related interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: separate ParamTraits<gpu::CommandBuffer::State> into own library Created 9 years, 11 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: ppapi/proxy/plugin_dispatcher.h
diff --git a/ppapi/proxy/plugin_dispatcher.h b/ppapi/proxy/plugin_dispatcher.h
index 6ce5c14359b5a43f24ad5c378d2c028592bb1e61..9206ed80758c028a8d13fbce3242d5045e04a887 100644
--- a/ppapi/proxy/plugin_dispatcher.h
+++ b/ppapi/proxy/plugin_dispatcher.h
@@ -7,8 +7,10 @@
#include <string>
+#include "base/hash_tables.h"
#include "base/process.h"
#include "base/scoped_ptr.h"
+#include "ppapi/c/pp_rect.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/proxy/dispatcher.h"
@@ -21,6 +23,11 @@ class WaitableEvent;
namespace pp {
namespace proxy {
+// Used to keep track of per-instance data.
+struct InstanceData {
+ PP_Rect position;
+};
+
class PluginDispatcher : public Dispatcher {
public:
// Constructor for the plugin side. The init and shutdown functions will be
@@ -58,6 +65,12 @@ class PluginDispatcher : public Dispatcher {
// IPC::Channel::Listener implementation.
virtual bool OnMessageReceived(const IPC::Message& msg);
+ // Keep track of all active instances to associate data with it, like the
+ // current size.
+ void DidCreateInstance(PP_Instance);
brettw 2011/01/31 18:51:29 Normally we would name the parameter here, I think
piman 2011/01/31 19:34:29 Done.
+ void DidDestroyInstance(PP_Instance);
+ InstanceData* GetInstanceData(PP_Instance);
brettw 2011/01/31 18:51:29 Can you document that this will return NULL for in
piman 2011/01/31 19:34:29 Done.
+
private:
// IPC message handlers.
void OnMsgInitializeModule(PP_Module pp_module, bool* result);
@@ -66,6 +79,9 @@ class PluginDispatcher : public Dispatcher {
InitModuleFunc init_module_;
ShutdownModuleFunc shutdown_module_;
+ typedef base::hash_map<PP_Instance, InstanceData> InstanceDataMap;
+ InstanceDataMap instance_map_;
+
DISALLOW_COPY_AND_ASSIGN(PluginDispatcher);
};

Powered by Google App Engine
This is Rietveld 408576698