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

Unified Diff: ppapi/proxy/host_dispatcher.h

Issue 7844018: Revert 100748 - This patch tries to remove most of the manual registration for Pepper interfaces,... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
« no previous file with comments | « ppapi/proxy/enter_proxy.h ('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 100753)
+++ ppapi/proxy/host_dispatcher.h (working copy)
@@ -32,6 +32,7 @@
namespace proxy {
+class InterfaceProxy;
class VarSerialization;
class PPAPI_PROXY_EXPORT HostDispatcher : public Dispatcher {
@@ -79,11 +80,18 @@
// 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& iface_name);
+ const void* GetProxiedInterface(const std::string& proxied_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. This is set to false at the beginning
- // of processing of each message from the plugin.
+ // the plugin that can be reentered.
void set_allow_plugin_reentrancy() {
allow_plugin_reentrancy_ = true;
}
@@ -91,18 +99,29 @@
// Returns the proxy interface for talking to the implementation.
const PPB_Proxy_Private* ppb_proxy() const { return ppb_proxy_; }
- protected:
- // Overridden from Dispatcher.
- virtual void OnInvalidMessageReceived();
+ private:
+ friend class HostDispatcherTest;
- private:
+ // 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);
+
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.
- typedef base::hash_map<std::string, bool> PluginSupportedMap;
- PluginSupportedMap plugin_supported_;
+ 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];
+
// Guaranteed non-NULL.
const PPB_Proxy_Private* ppb_proxy_;
« no previous file with comments | « ppapi/proxy/enter_proxy.h ('k') | ppapi/proxy/host_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698