Index: ppapi/proxy/dispatcher.h |
=================================================================== |
--- ppapi/proxy/dispatcher.h (revision 74021) |
+++ ppapi/proxy/dispatcher.h (working copy) |
@@ -18,6 +18,7 @@ |
#include "ppapi/c/pp_module.h" |
#include "ppapi/proxy/callback_tracker.h" |
#include "ppapi/proxy/interface_id.h" |
+#include "ppapi/proxy/interface_proxy.h" |
#include "ppapi/proxy/plugin_var_tracker.h" |
class MessageLoop; |
@@ -35,7 +36,6 @@ |
namespace pp { |
namespace proxy { |
-class InterfaceProxy; |
class VarSerializationRules; |
// An interface proxy can represent either end of a cross-process interface |
@@ -86,13 +86,6 @@ |
// Wrapper for calling the local GetInterface function. |
const void* GetLocalInterface(const char* interface); |
- // Implements PPP_GetInterface and PPB_GetInterface on the "source" side. It |
- // will check if the remote side supports this interface as a target, and |
- // create a proxy if it does. A local implementation of that interface backed |
- // by the proxy will be returned on success. If the interface is unproxyable |
- // or not supported by the remote side, returns NULL. |
- const void* GetProxiedInterface(const std::string& interface); |
- |
// Returns the remote process' handle. For the host dispatcher, this will be |
// the plugin process, and for the plugin dispatcher, this will be the |
// renderer process. This is used for sharing memory and such and is |
@@ -120,6 +113,17 @@ |
return callback_tracker_; |
} |
+ // Retrieves the information associated with the given interface, identified |
+ // either by name or ID. Each function searches either PPP or PPB interfaces. |
+ static const InterfaceProxy::Info* GetPPBInterfaceInfo( |
+ const std::string& name); |
+ static const InterfaceProxy::Info* GetPPBInterfaceInfo( |
+ InterfaceID id); |
+ static const InterfaceProxy::Info* GetPPPInterfaceInfo( |
+ const std::string& name); |
+ static const InterfaceProxy::Info* GetPPPInterfaceInfo( |
+ InterfaceID id); |
+ |
protected: |
Dispatcher(base::ProcessHandle remote_process_handle, |
GetInterfaceFunc local_get_interface); |
@@ -132,41 +136,11 @@ |
pp_module_ = module; |
} |
- // Allows the PluginDispatcher to add a magic proxy for PPP_Class, bypassing |
- // the normal "do you support this proxy" stuff and the big lookup of |
- // name to proxy object. Takes ownership of the pointer. |
- void InjectProxy(InterfaceID id, |
- const std::string& name, |
- InterfaceProxy* proxy); |
+ bool disallow_trusted_interfaces() const { |
+ return disallow_trusted_interfaces_; |
+ } |
private: |
- typedef std::map< std::string, linked_ptr<InterfaceProxy> > ProxyMap; |
- |
- // Message handlers |
- void OnMsgSupportsInterface(const std::string& interface_name, bool* result); |
- void OnMsgDeclareInterfaces(const std::vector<std::string>& interfaces); |
- |
- // Allocates a new proxy on the heap corresponding to the given interface |
- // name, or returns NULL if that interface name isn't known proxyable. The |
- // caller owns the returned pointer. |
- // |
- // The interface_functions gives the pointer to the local interfece when this |
- // is a target proxy. When creating a source proxy, set this to NULL. |
- InterfaceProxy* CreateProxyForInterface( |
- const std::string& interface_name, |
- const void* interface_functions); |
- |
- // Returns true if the remote side supports the given interface as the |
- // target of an IPC call. |
- bool RemoteSupportsTargetInterface(const std::string& interface); |
- |
- // Sets up a proxy as the target for the given interface, if it is supported. |
- // Returns true if this process implements the given interface and it is |
- // proxyable. |
- bool SetupProxyForTargetInterface(const std::string& interface); |
- |
- bool IsInterfaceTrusted(const std::string& interface); |
- |
// Set by the derived classed to indicate the module ID corresponding to |
// this dispatcher. |
PP_Module pp_module_; |
@@ -185,20 +159,6 @@ |
GetInterfaceFunc local_get_interface_; |
- ProxyMap proxies_; |
- InterfaceProxy* id_to_proxy_[INTERFACE_ID_COUNT]; |
- |
- // True if the remote side has declared which interfaces it supports in |
- // advance. When set, it means if we don't already have a source proxy for |
- // the requested interface, that the remote side doesn't support it and |
- // we don't need to query. |
- // |
- // This is just an optimization. The browser has a fixed set of interfaces |
- // it supports, and the many plugins will end up querying many of them. By |
- // having the browser just send all of those interfaces in one message, we |
- // can avoid a bunch of IPC chatter to set up each interface. |
- bool declared_supported_remote_interfaces_; |
- |
CallbackTracker callback_tracker_; |
scoped_ptr<VarSerializationRules> serialization_rules_; |