Chromium Code Reviews| 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); |
| }; |