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

Unified Diff: ppapi/proxy/host_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/dispatcher.cc ('k') | ppapi/proxy/host_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/host_dispatcher.h
===================================================================
--- ppapi/proxy/host_dispatcher.h (revision 74021)
+++ ppapi/proxy/host_dispatcher.h (working copy)
@@ -41,10 +41,6 @@
GetInterfaceFunc local_get_interface);
~HostDispatcher();
- // Calls the plugin's PPP_InitializeModule function and returns true if
- // the call succeeded.
- bool InitializeModule();
-
// The host side maintains a mapping from PP_Instance to Dispatcher so
// that we can send the messages to the right channel.
static HostDispatcher* GetForInstance(PP_Instance instance);
@@ -52,10 +48,36 @@
HostDispatcher* dispatcher);
static void RemoveForInstance(PP_Instance instance);
+ // Calls the plugin's PPP_InitializeModule function and returns true if
+ // the call succeeded.
+ bool InitializeModule();
+
// Dispatcher overrides.
virtual bool IsPlugin() const;
+ // IPC::Channel::Listener.
+ virtual bool OnMessageReceived(const IPC::Message& msg);
+
+ // Proxied version of calling GetInterface on the plugin. This will check
+ // if the plugin supports the given interface (with caching) and returns the
+ // pointer to the proxied interface if it is supported. Returns NULL if the
+ // given interface isn't supported by the plugin or the proxy.
+ const void* GetProxiedInterface(const std::string& interface);
+
private:
+ friend class HostDispatcherTest;
+
+ enum PluginInterfaceSupport {
+ INTERFACE_UNQUERIED = 0, // Must be 0 so memset(0) will clear the list.
+ INTERFACE_SUPPORTED,
+ INTERFACE_UNSUPPORTED
+ };
+ PluginInterfaceSupport plugin_interface_support_[INTERFACE_ID_COUNT];
+
+ // All target proxies currently created. These are ones that receive
+ // messages. They are created on demand when we receive messages.
+ scoped_ptr<InterfaceProxy> target_proxies_[INTERFACE_ID_COUNT];
+
DISALLOW_COPY_AND_ASSIGN(HostDispatcher);
};
« no previous file with comments | « ppapi/proxy/dispatcher.cc ('k') | ppapi/proxy/host_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698