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

Unified Diff: ppapi/proxy/host_dispatcher.h

Issue 7740038: Use macros to define pepper interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review Created 9 years, 3 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
Index: ppapi/proxy/host_dispatcher.h
diff --git a/ppapi/proxy/host_dispatcher.h b/ppapi/proxy/host_dispatcher.h
index 57ba120f4fd18ce09f9ad80518957b3f6fae0b92..5709ceb0e26fa3f5ae9621e41ac518b8cf209741 100644
--- a/ppapi/proxy/host_dispatcher.h
+++ b/ppapi/proxy/host_dispatcher.h
@@ -32,7 +32,6 @@ struct Preferences;
namespace proxy {
-class InterfaceProxy;
class VarSerialization;
class PPAPI_PROXY_EXPORT HostDispatcher : public Dispatcher {
@@ -76,51 +75,32 @@ class PPAPI_PROXY_EXPORT HostDispatcher : public Dispatcher {
virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelError();
- // 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);
-
- // Returns the proxy object associated with the given interface ID, creating
- // it if necessary. This is used in cases where a proxy needs to access code
- // in the proxy for another interface. It's assumed that the interface always
- // exists, so this is only used for browser proxies.
- //
- // Will return NULL if an interface isn't supported.
- InterfaceProxy* GetOrCreatePPBInterfaceProxy(InterfaceID id);
-
// See the value below. Call this when processing a scripting message from
// the plugin that can be reentered.
void set_allow_plugin_reentrancy() {
noelallen_use_chromium 2011/09/07 21:16:57 I understand this is just a moved block, but isn't
brettw 2011/09/08 05:34:29 I added an additional sentence here and moved it b
allow_plugin_reentrancy_ = true;
}
+ // 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);
+
// Returns the proxy interface for talking to the implementation.
const PPB_Proxy_Private* ppb_proxy() const { return ppb_proxy_; }
- private:
- friend class HostDispatcherTest;
-
- // Makes an instance of the given PPB interface proxy, storing it in the
- // target_proxies_ array. An proxy for this interface must not exist yet.
- InterfaceProxy* CreatePPBInterfaceProxy(const InterfaceProxy::Info* info);
+ protected:
+ // Overridden from Dispatcher.
+ virtual void OnInvalidMessageReceived();
+ private:
PP_Module pp_module_;
- typedef std::map<std::string, bool> PluginIFSupportedMap;
// Maps interface name to whether that interface is supported. If an interface
// name is not in the map, that implies that we haven't queried for it yet.
- std::map<std::string, bool> plugin_if_supported_;
-
- // 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];
-
- // Function proxies created for "new-style" FunctionGroups.
- // TODO(brettw) this is in progress. It should be merged with the target
- // proxies so there is one list to consult.
- scoped_ptr<FunctionGroupBase> function_proxies_[INTERFACE_ID_COUNT];
+ typedef base::hash_map<std::string, bool> PluginSupportedMap;
+ PluginSupportedMap plugin_supported_;
// Guaranteed non-NULL.
const PPB_Proxy_Private* ppb_proxy_;

Powered by Google App Engine
This is Rietveld 408576698