diff options
author | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-12 20:37:04 +0000 |
---|---|---|
committer | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-12 20:37:04 +0000 |
commit | c77a8dd4b83d07233202f99ce7951e7f002ebec7 (patch) | |
tree | 3f7aa1c79cca700e5f1d96a833c0cb474b8b285c /ppapi/proxy/dispatcher.h | |
parent | 358be972e7edb780004c66be2b8b343beb755b00 (diff) | |
download | chromium_src-c77a8dd4b83d07233202f99ce7951e7f002ebec7.zip chromium_src-c77a8dd4b83d07233202f99ce7951e7f002ebec7.tar.gz chromium_src-c77a8dd4b83d07233202f99ce7951e7f002ebec7.tar.bz2 |
Revert 100748 - This patch tries to remove most of the manual registration for Pepper interfaces, and replaces it with a list of macros. When files want to know which Pepper interface names and structs there are, they define what they want to do with the macros, and then include the relevant files for the classes of interfaces they want (stable, private, dev).
This does not convert all the dev interfaces. I just did a few to keep the patch smaller. So there is still a lot of manual registration.
This fixes the previous design problem where we assumed one *_Proxy object == one interface. We have been hacking around this lately with duplicate GetInfo calls, but this doesn't work for PPP interfaces.
Now, a _Proxy object is just there to help keep things organized. One proxy can handle zero, one, or many interfaces, and this mapping is controlled by just one line in the interfaces file.
So for example, to add a new function to a new version of an interface with backward compatibility, you would add that function to the _api.h file, and write a thunk for the new interface. Then you only need to add one line to the interfaces_ppb_public_stable.h file and that will be hooked up with the proxy and the implementation.
This removes some _proxy objects/files that were used only to declare that the interfaces existed, since they're no longer necessary.
I folded Console into the Instance API which removed a bunch of code.
I removed FileChooser 0.4. I think everybody has converted to the new one, and I think parts of it weren't even hooked up properly anymore.
Review URL: http://codereview.chromium.org/7740038
TBR=brettw@chromium.org
Review URL: http://codereview.chromium.org/7844018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100754 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/dispatcher.h')
-rw-r--r-- | ppapi/proxy/dispatcher.h | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/ppapi/proxy/dispatcher.h b/ppapi/proxy/dispatcher.h index a48cff7..bf3e36f 100644 --- a/ppapi/proxy/dispatcher.h +++ b/ppapi/proxy/dispatcher.h @@ -17,7 +17,6 @@ #include "ppapi/proxy/callback_tracker.h" #include "ppapi/proxy/proxy_channel.h" #include "ppapi/proxy/interface_id.h" -#include "ppapi/proxy/interface_list.h" #include "ppapi/proxy/interface_proxy.h" #include "ppapi/proxy/plugin_var_tracker.h" @@ -58,10 +57,8 @@ class PPAPI_PROXY_EXPORT Dispatcher : public ProxyChannel { return serialization_rules_.get(); } - // Returns a non-owning pointer to the interface proxy for the given ID, or - // NULL if the ID isn't found. This will create the proxy if it hasn't been - // created so far. - InterfaceProxy* GetInterfaceProxy(InterfaceID id); + // Wrapper for calling the local GetInterface function. + const void* GetLocalInterface(const char* interface_name); // Returns the pointer to the IO thread for processing IPC messages. // TODO(brettw) remove this. It's a hack to support the Flash @@ -87,7 +84,14 @@ class PPAPI_PROXY_EXPORT Dispatcher : public ProxyChannel { return callback_tracker_; } - GetInterfaceFunc local_get_interface() const { return local_get_interface_; } + // 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); protected: Dispatcher(base::ProcessHandle remote_process_handle, @@ -97,21 +101,11 @@ class PPAPI_PROXY_EXPORT Dispatcher : public ProxyChannel { // Takes ownership of the given pointer, which must be on the heap. void SetSerializationRules(VarSerializationRules* var_serialization_rules); - // Called when an invalid message is received from the remote site. The - // default implementation does nothing, derived classes can override. - virtual void OnInvalidMessageReceived(); - bool disallow_trusted_interfaces() const { return disallow_trusted_interfaces_; } private: - friend class HostDispatcherTest; - friend class PluginDispatcherTest; - - // Lists all lazily-created interface proxies. - scoped_ptr<InterfaceProxy> proxies_[INTERFACE_ID_COUNT]; - bool disallow_trusted_interfaces_; GetInterfaceFunc local_get_interface_; |