diff options
author | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-02 18:12:31 +0000 |
---|---|---|
committer | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-02 18:12:31 +0000 |
commit | f56279ca6fb81d883f77c6501c2f54dd95d4933d (patch) | |
tree | 8a69dcd6fb2c1ae6abe2985a00320f74ab2b8ab5 /ppapi/proxy/plugin_dispatcher.h | |
parent | ed355815b599eecfeda838ef8e7fa7adcbb5a9a9 (diff) | |
download | chromium_src-f56279ca6fb81d883f77c6501c2f54dd95d4933d.zip chromium_src-f56279ca6fb81d883f77c6501c2f54dd95d4933d.tar.gz chromium_src-f56279ca6fb81d883f77c6501c2f54dd95d4933d.tar.bz2 |
Implement proxy for 3d-related interfaces
BUG=none
TEST=Pepper Flash
Review URL: http://codereview.chromium.org/6400007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73472 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/plugin_dispatcher.h')
-rw-r--r-- | ppapi/proxy/plugin_dispatcher.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ppapi/proxy/plugin_dispatcher.h b/ppapi/proxy/plugin_dispatcher.h index 6ce5c14..d2ab30a 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,15 @@ 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 instance); + void DidDestroyInstance(PP_Instance instance); + + // Gets the data for an existing instance, or NULL if the instance id doesn't + // correspond to a known instance. + InstanceData* GetInstanceData(PP_Instance instance); + private: // IPC message handlers. void OnMsgInitializeModule(PP_Module pp_module, bool* result); @@ -66,6 +82,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); }; |