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

Unified Diff: ppapi/proxy/plugin_dispatcher.h

Issue 6286070: Remove all uses of the global Dispatcher Get function. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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
===================================================================
--- ppapi/proxy/plugin_dispatcher.h (revision 74021)
+++ ppapi/proxy/plugin_dispatcher.h (working copy)
@@ -41,23 +41,11 @@
ShutdownModuleFunc shutdown_module);
~PluginDispatcher();
- // Sets/gets the global dispatcher pointer. New code should use the
- // GetForInstance version below, this is currently here as a stopgap while
- // the transition is being made.
- //
- // TODO(brettw) remove this.
- static PluginDispatcher* Get();
- static void SetGlobal(PluginDispatcher* dispatcher);
-
// The plugin side maintains a mapping from PP_Instance to Dispatcher so
// that we can send the messages to the right channel if there are multiple
- // renderers sharing the same plugin.
+ // renderers sharing the same plugin. This mapping is maintained by
+ // DidCreateInstance/DidDestroyInstance.
static PluginDispatcher* GetForInstance(PP_Instance instance);
- /* TODO(brettw) enable this when Get() is removed.
- static void SetForInstance(PP_Instance instance,
- PluginDispatcher* dispatcher);
- static void RemoveForInstance(PP_Instance instance);
- */
// Dispatcher overrides.
virtual bool IsPlugin() const;
@@ -65,8 +53,8 @@
// 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.
+ // Keeps track of which dispatcher to use for each instance, active instances
+ // and tracks associated data like the current size.
void DidCreateInstance(PP_Instance instance);
void DidDestroyInstance(PP_Instance instance);
@@ -75,13 +63,20 @@
InstanceData* GetInstanceData(PP_Instance instance);
private:
+ friend class PluginDispatcherTest;
+
// IPC message handlers.
void OnMsgInitializeModule(PP_Module pp_module, bool* result);
void OnMsgShutdown();
+ void OnMsgSupportsInterface(const std::string& interface_name, bool* result);
InitModuleFunc init_module_;
ShutdownModuleFunc shutdown_module_;
+ // All target proxies currently created. These are ones that receive
+ // messages.
+ scoped_ptr<InterfaceProxy> target_proxies_[INTERFACE_ID_COUNT];
+
typedef base::hash_map<PP_Instance, InstanceData> InstanceDataMap;
InstanceDataMap instance_map_;
« 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