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: 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: rebase 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
« no previous file with comments | « ppapi/proxy/interface_proxy.h ('k') | ppapi/proxy/plugin_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_dispatcher.h
diff --git a/ppapi/proxy/plugin_dispatcher.h b/ppapi/proxy/plugin_dispatcher.h
index 6ce5c14359b5a43f24ad5c378d2c028592bb1e61..d2ab30a20984854160008353dc456cbf7405dcec 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);
};
« no previous file with comments | « ppapi/proxy/interface_proxy.h ('k') | ppapi/proxy/plugin_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698