summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/dispatcher.h
Commit message (Collapse)AuthorAgeFilesLines
* Hook up PpapiPermissions in more places.brettw@chromium.org2012-10-021-5/+6
| | | | | | | | This doesn't actually do much more checking of the permissions, but it should wire it up everywhere we'll need it. It will also at least only return public interfaces via GetInterface in the proxy now unless other bits are supplied. Review URL: https://codereview.chromium.org/10984094 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159729 0039d316-1c4b-4281-b951-d872f2087c98
* Create a PPAPI host for new resource message routing.brettw@chromium.org2012-06-301-0/+5
| | | | | | | | | | | | | This infrastructure will be used in the renderer and in the browser as the backing for new resources. The PpapiHost object doues the routing for the resource messages, and also has hooks for the embedder (the renderer or the browser) to create resources. This adds a content_renderer factory which currently does nothing (we'll add most of the resources here). BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10572040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145059 0039d316-1c4b-4281-b951-d872f2087c98
* Rename IPC Sender and Listener in ppapi, content/public, and content/rendererbrettw@chromium.org2012-06-201-2/+3
| | | | | | | | | | | This is the new name in preparation for deleting the backwards-compatible typedef. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10532162 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143282 0039d316-1c4b-4281-b951-d872f2087c98
* Broker out PPAPI handle duplicationjschuh@chromium.org2012-05-111-2/+1
| | | | | | | BUG=127449 Review URL: https://chromiumcodereview.appspot.com/10378057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136686 0039d316-1c4b-4281-b951-d872f2087c98
* Add a way to implement GetInterface in the broker.brettw@chromium.org2012-04-131-6/+6
| | | | | | | | | | | This also adds some cleanup in the Pepper API to provide typedefs for the three PPP_* functions. I removed some ad-hoc typedefes we had floating around and replaced them with these more "official" ones. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10069035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132285 0039d316-1c4b-4281-b951-d872f2087c98
* This adds a hang monitor for Pepper plugins. It monitors sync messages on ↵brettw@chromium.org2012-04-131-3/+0
| | | | | | | | | | | | the I/O thread of the renderer and sends a message to the browser if it's blocked for too long. The browser will show an infobar allowing you to terminate the plugin. BUG=122795 Review URL: https://chromiumcodereview.appspot.com/10014013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132245 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a crash related to PPAPI scripting.yzshen@chromium.org2012-03-101-3/+4
| | | | | | | | | | | | SerializedVar and MessageChannel didn't properly handle the case that the dispatcher goes away while waiting for the reply to a sync message. BUG=110095 TEST=When click the Test button on ppapi/example/example.html, the plugin is removed but the renderer doesn't crash. Review URL: http://codereview.chromium.org/9655019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126014 0039d316-1c4b-4281-b951-d872f2087c98
* Use callback_forward.h instead of callback.h where possible.erikwright@chromium.org2011-11-291-1/+1
| | | | | | | | | | | | | | | callback_forward.h will be committed separately, before this commit, and is included here only to assist in running try jobs. It will be removed before the final commit. You are asked to review this as you have OWNERS for these files. BUG=None TEST=Compiles R=piman@chromium.org Review URL: http://codereview.chromium.org/8658011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111934 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Remove unneeded forward declarations in ppapi.thestig@chromium.org2011-11-111-2/+0
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/8527020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109595 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 106717 - Revert 106677 (caused several PPAPI test timeouts, see ↵brettw@chromium.org2011-10-211-7/+0
| | | | | | | | | | | | | | | | | | | | | | http://crbug.com/101154) - Remove the proxy callback tracker. This doesn't properly delete callbacks when the corresponding resource goes away. This can lead to leaks or crashes in the plugin when the callback is triggered unexpectedly. BUG=http://crbug.com/86279 Review URL: http://codereview.chromium.org/8226009 TBR=brettw@chromium.org Review URL: http://codereview.chromium.org/8364040 TBR=thakis@chromium.org Review URL: http://codereview.chromium.org/8371008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106764 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 106677 (caused several PPAPI test timeouts, see http://crbug.com/101154)thakis@chromium.org2011-10-211-0/+7
| | | | | | | | | | | | | | | | | - Remove the proxy callback tracker. This doesn't properly delete callbacks when the corresponding resource goes away. This can lead to leaks or crashes in the plugin when the callback is triggered unexpectedly. BUG=http://crbug.com/86279 Review URL: http://codereview.chromium.org/8226009 TBR=brettw@chromium.org Review URL: http://codereview.chromium.org/8364040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106717 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the proxy callback tracker.brettw@chromium.org2011-10-211-7/+0
| | | | | | | | | | | | This doesn't properly delete callbacks when the corresponding resource goes away. This can lead to leaks or crashes in the plugin when the callback is triggered unexpectedly. BUG=http://crbug.com/86279 Review URL: http://codereview.chromium.org/8226009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106677 0039d316-1c4b-4281-b951-d872f2087c98
* Rename InterfaceID to ApiID and move the file.brettw@chromium.org2011-10-201-3/+3
| | | | | | | | | | | | | | | | | | | This was originally in the proxy and had a 1:1 correspondence with an interface. Then we reused this for other stuff and then merged some interfaces into larger APIs (ppapi/thunk/*_api.h) so the name was no longer accurate. It was wrong to be in the proxy directory since directories at a "lower level" than the proxy (ppapi/shared_impl and webkit/plugins/ppapi) depended on it. This renames to ApiID (I avoided APIID since it looks like a define) which is the proper description of the class, and moved it to shared_impl. This fixes the deps since there are no longer any bad dependencies on the proxy directory. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/8333004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106619 0039d316-1c4b-4281-b951-d872f2087c98
* s patch tries to remove most of the manual registration for Pepper ↵brettw@chromium.org2011-09-131-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | 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 re-lands my previous change. Original Review URL: http://codereview.chromium.org/7874002 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/7887001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100936 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r100853, 100851. Win_shared build is broken.brettw@chromium.org2011-09-131-16/+10
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100854 0039d316-1c4b-4281-b951-d872f2087c98
* This patch tries to remove most of the manual registration for Pepper ↵brettw@chromium.org2011-09-131-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | 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 re-lands my previous change. Original Review URL: http://codereview.chromium.org/7740038 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/7874002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100851 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 100748 - This patch tries to remove most of the manual registration ↵dmazzoni@chromium.org2011-09-121-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* This patch tries to remove most of the manual registration for Pepper ↵brettw@chromium.org2011-09-121-10/+16
| | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100748 0039d316-1c4b-4281-b951-d872f2087c98
* Create ppapi_proxy.dll and ppapi_shared.dll.darin@chromium.org2011-08-261-1/+1
| | | | | | | | | | | | | | | | This involves introducing the following macros: PPAPI_PROXY_EXPORT - for symbols exported from ppapi/proxy PPAPI_SHARED_EXPORT - for symbols exported from ppapi/shared_impl PPAPI_THUNK_EXPORT - for symbols exported from ppapi/thunk NOTE: shared_impl and thunk are still linked together, but I thought it was cleaner to give thunk its own macro. R=brettw@chromium.org Review URL: http://codereview.chromium.org/7687005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98508 0039d316-1c4b-4281-b951-d872f2087c98
* Convert the pp::proxy namespace to the ppapi::proxy namespace.brettw@chromium.org2011-08-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is more consistent with the stuff in shared_impl, and removes a lot of namespace using goop. Add a unified resource tracker shared between the proxy and the impl. This renames the old ResourceObjectBase to Resource and removes the old PluginResource. It moves the resource tracker from the impl to the shared_impl, and makes the proxy use it. Some things become a little less neat because there's no proxy resource base class. In particular GetDispatcher() is now gone. I considered whether to add a helper base class that provides this function, but decided against it and had individual resource classes implement this when their implementation would find it useful. This is because ultimately I want more of this functionality to move into the shared_impl, and it's easier to do that if there are fewer proxy-specific things in the resources. This changes the way that plugins are added to the tracker. Previously they would only be in the tracker if the plugin had a reference to them, although they could be alive if the impl had a scoped_ptr referencing an object. This actually has the bug that if we then give the resource back to the plugin, it wouldn't be refcounted properly and everything would get confused. Now the tracker tracks all live resource objects whether or not the plugin has a ref. This works basically like the var tracker (it would be nice if the var and resource trackers shared more code, but that would further complicate this already overcomplicated patch). The resource tracker takes an extra ref whenever the plugin has one or more, and otherwise just tracks live resources. BUG= TEST= Review URL: http://codereview.chromium.org/7655002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97367 0039d316-1c4b-4281-b951-d872f2087c98
* Make o.o.p. proxy handle PPP_Instance versions 0.4 and 0.5.dmichael@chromium.org2011-06-291-2/+0
| | | | | | | | | | | Move & tweak PPP_Instance_Combined to ppapi_shared so the proxy can use it. Use versioned PPP_Instance types only. BUG=82606 TEST=run tests o.o.p. Review URL: http://codereview.chromium.org/7189045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90984 0039d316-1c4b-4281-b951-d872f2087c98
* Support getting the font list in Pepper. This currently only works out ofbrettw@chromium.org2011-05-181-25/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | process. This adds a function to the font interface to get the font list. Since we don't have arrays or dictionaries in Pepper yet, I used a string with nulls separating the names. A previous attempt to make a "font list resource" proved excessively complicated and not actually much easier for clients to deal with. This refactors the existing font list getting that used to be in the options for the browser. I moved it to content and split it into two pieces, the synchronous version, and then an asynchronous wrapper around that which both the prefs code and the pepper code use. This cleaned up some of the preferences code, and also fixes the leak of the entire font list in the code. I used the new callback/bind system for the async font loading. I had to add BrowserThread support for the new system. This uses the PepperMessageFilter to listen for font load requests from the plugin in the browser process. This is nice because we can add stuff here and have messages serviced for both in-process and out-of-process plugins. This proved to be complicated due to the HostResolver used in some of the existing code, and thread restrictions for how to deal with it. This is why there are two modes for the filter object. I changed the delegates around for the Dispatcher. Now the PluginDispatcher has the delegate interface since the HostDispatcher didn't actually need any of them and we were accumulating a lot of empty functions in the PepperPluginRegistry. It's possible for the fonts to be loaded on Windows and Mac without IPC, since enumerating fonts should be possible inside the sandbox. I didn't implement this since it adds extra complexity and probably doesn't give that much benefit. TEST=manual BUG=none Review URL: http://codereview.chromium.org/7044012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85827 0039d316-1c4b-4281-b951-d872f2087c98
* Convert audio-related messages to the new thunk/API system for Pepper.brettw@chromium.org2011-05-131-4/+3
| | | | | | | | | | | | | | | | | | | This has a bit of a change from the previous couple of resources that were converted in that the ResourceCreationProxy now calls a static proxy function for actually doing the work. It became too complicated and required that the ResourceCreationProxy know a lot about the internals of the objects. Did a little namespace cleanup. This renames "pp::shared_impl" to just use the "ppapi" namespace. The "shared_impl" was ugly and didn't help anything. Some files in that directory used "ppapi::shared_impl" instead which was even more confusing. Do a little build cleanup. The old ppapi_shared_proxy.gypi is now split into two sub-files, one for ppapi_shared, and one for ppapi_proxy. It's hopefully easier to find stuff now. Review URL: http://codereview.chromium.org/7014024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85303 0039d316-1c4b-4281-b951-d872f2087c98
* Make the Pepper proxy support in-process font rendering.brettw@chromium.org2011-05-101-0/+22
| | | | | | | | | | | | | This implements a WebKit thread in the PPAPI plugin process so we can do the font calls without IPC. The existing font support was refactored into a virtual class (to prevent PPAPI from depending on WebKit and creating a circular GYP dependency). This moves the renderer sandbox support into content/common so that it can be used by the PPAPI process. Review URL: http://codereview.chromium.org/6981001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84856 0039d316-1c4b-4281-b951-d872f2087c98
* Switch IPC::ChannelProxy to use MessageLoopProxy instead of MessageLoop. ↵jam@chromium.org2011-05-021-1/+1
| | | | | | | | This allows us to remove usage of the IOThread object, and generally makes IPC::ChannelProxy more robust for future uses. Review URL: http://codereview.chromium.org/6901146 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83741 0039d316-1c4b-4281-b951-d872f2087c98
* Refactored ppapi Dispatcher to share common code between the plugin and ↵ddorwin@chromium.org2011-04-161-78/+4
| | | | | | | | | | | | | broker dispatchers. Common code is in DispatcherBase. The base of the dispatcher for plugins remains Dispatcher. The base of the dispatcher for Brokers is BrokerDispatcher. BUG=none TEST=ppapi out-of-process plugins Review URL: http://codereview.chromium.org/6859003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81883 0039d316-1c4b-4281-b951-d872f2087c98
* Support PPB_Flash_ModileLocal blocking calls from background threads. This isbrettw@chromium.org2011-04-151-0/+13
| | | | | | | | | | | | | | | | | | | | | a temporary stopgap to allow these specific functions to be used until the entire proxy can support threading. There are two functions that set up and clean up the routing information in the interface. These are necessary because the global dispatcher routing information is not threadsafe. When used from the main thread, the code works the same as before. When used from a background thread, we create a sync message, send it to the I/O thread, and block the sending thread until the reply is received. There is no handling of other incoming blocking messages (which are impossible), and no other Pepper functions are supported from the background thread. TEST=manual BUG=none Review URL: http://codereview.chromium.org/6875009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81814 0039d316-1c4b-4281-b951-d872f2087c98
* Wire up the extension API for registering NaCl modules to an actual registry ↵abarth@chromium.org2011-04-141-1/+1
| | | | | | | | of NaCl modules. Review URL: http://codereview.chromium.org/6821038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81545 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw_scoped_refptr_mismatch_checker.h ref_counted.cc ref_counted.h ref_counted_memory.cc ref_counted_memory.h ref_counted_unittest.cc scoped_callback_factory.h scoped_comptr_win.h scoped_handle.h scoped_native_library.cc scoped_native_library.h scoped_native_library_unittest.cc scoped_nsobject.h scoped_open_process.h scoped_ptr.h scoped_ptr_unittest.cc scoped_temp_dir.cc scoped_temp_dir.h scoped_temp_dir_unittest.cc scoped_vector.h singleton.h singleton_objc.h singleton_unittest.cc linked_ptr.h linked_ptr_unittest.cc weak_ptr.cc weak_ptr.h weak_ptr_unittest.cc BUG=None TEST=Compile Review URL: http://codereview.chromium.org/6714032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79524 0039d316-1c4b-4281-b951-d872f2087c98
* Ensure that PP_Instance values are unique within a plugin process in additionbrettw@chromium.org2011-03-101-4/+29
| | | | | | | | | | | | | | | | | | | | | | | | | to within the renderer. This works by having the renderer check with the plugin that a PP_Instance is available before using it. If it's already seen, the renderer will generate a new PP_Instance and retry. For performance, this message is handled on the I/O thread of the plugin so it will not be blocked by the actual plugin code. This requires an unfortunate amount of plumbing. Since the renderer can't depend directly on the proxy, we have a new PPB_Proxy function to set the verification function used to perform this check. There is also a new plugin dispatcher delegate where I moved some of the global state to that used to go into the init function. Adding yet another parameter there seemed unfortunate. TEST=manual BUG=74961 Review URL: http://codereview.chromium.org/6628019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77693 0039d316-1c4b-4281-b951-d872f2087c98
* Factor fd sharing code in proxy and fix fd issues once and for all.piman@google.com2011-02-251-7/+10
| | | | | | | | | BUG=none TEST=use flapper, go to youtube, make plugin crash and check no warning about close() failing. Review URL: http://codereview.chromium.org/6580050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76026 0039d316-1c4b-4281-b951-d872f2087c98
* Implement basic crash detection and shutdown handling for out of process PPAPIbrettw@chromium.org2011-02-151-14/+5
| | | | | | | | | | | | | | | | | | plugins. Currently when a crash is detected we just delete as much stuff as is convenient, clear the plugin's backing store, and continue running. It does not hook up a sad plugin page yet. This adds a "proxy" interface for the proxy to tell the PPAPI backend implementation in the renderer about proxy-related stuff (like the plugin crashing). This also implements keeping the process alive for a period of time so we can re-use the same process. Review URL: http://codereview.chromium.org/6493004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74965 0039d316-1c4b-4281-b951-d872f2087c98
* Rent syncemove all uses of the global Dispatcher Get function.brettw@chromium.org2011-02-081-55/+15
| | | | | | | | | | | | | | | | | | | This reqired reworking how plugin->host GetInterface works. Previously, interface requests were symmetric where each side would first do a SupportsInterface to see if the remote side supports the interface, then create the proxy. Since the plugin may talk to multiple renderers, we don't know where to send these requests. The solution is to make the assumption that the renderer always supports all PPB interfaces (which is possible since the proxy is compiled with the executable). This also adds some better lookup for interfaces to avoid having multiple lists of interfaces. We now have a list of interfaces and factory functions in dispatcher.cc. Add some additional testing infrastructure for the dispatchers with simple tests. Review URL: http://codereview.chromium.org/6286070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74121 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor PPAPI proxy resource handling to maintain which host they came from,brettw@chromium.org2011-01-271-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and to map back to that host when calling functions on them. Adds a mapping between resources generated by the hosts to a new list inside the plugin so there can't be overlaps. This means there are now two meanings for a PP_Resource, one in the plugin process and one in the host process. This is potentially very confusing. I introduced a new object called a HostResource that always represents a "host" PP_Resource to try to prevent errors. In the plugin side of the proxy, it only deals with PP_Resources valid in the plugin, and SerializedResources valid in the host. It also encapsulates the associated instance, which simplifies some code. Each PluginResource object maintains its SerializedResource which the proxy uses to send to the host for requests. This requires getting the PluginResource object in more proxy calls. This fixes a bug in var sending introduced in my previous patch. The var releasing from EndSendPassRef used the host var rather than the plugin var. I had to add more plumbing to get the dispatcher at this location and convert to a plugin var. I removed the separate file for ImageData and put it in ppb_image_data_proxy like for the other resource types. TEST=some unit tests included BUG=none Review URL: http://codereview.chromium.org/6334016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72879 0039d316-1c4b-4281-b951-d872f2087c98
* First pass at making the proxy handle multiple renderers. This associates thebrettw@chromium.org2011-01-211-1/+0
| | | | | | | | | | | | | | | | | | | | instance with resources and has most callers retrieve the dispatcher according to the appropriate instance. This isn't hooked up to anything yet. This changes some PPB_Flash interface methods to use PP_Bool. The most challenging part of the change is in the plugin_var_tracker which now needs to track which dispatcher each var object came from, and remap var IDs since each renderer will be generating var IDs in its own space, which will likely overlap. A similar system will need to be done for resources which is not implemented yet. I added some null checks in audio_impl because audio_ can be NULL in some cases when using the trusted API. I discovered this when testing NaCl for this patch. Review URL: http://codereview.chromium.org/6282007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72053 0039d316-1c4b-4281-b951-d872f2087c98
* Make IPC::Channel::Listener:OnMessageReceived have a return value indicating ↵jam@chromium.org2010-12-241-1/+1
| | | | | | | | | whether a message was processed or not. TBR=brettw Review URL: http://codereview.chromium.org/5978003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70139 0039d316-1c4b-4281-b951-d872f2087c98
* Convert over to channel handlesdmaclach@chromium.org2010-12-081-1/+1
| | | | | | | | | | | | This hides some of the internals of the posix channels from users, and gets rid of several #ifdef POSIX blocks. Generally simplifies usage of channels xplatform. BUG=none TEST=build Review URL: http://codereview.chromium.org/5598010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68621 0039d316-1c4b-4281-b951-d872f2087c98
* Implement audio proxy for Pepper.brettw@chromium.org2010-12-021-1/+12
| | | | | | | | | | | | | In addition to the basic proxying, this required some changes to the dispatcher and process infrastructure to get the handles of the processes available when I need them so I can duplicate the shared memory handles properly into the different processes. TEST=none BUG=none Review URL: http://codereview.chromium.org/4985001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68026 0039d316-1c4b-4281-b951-d872f2087c98
* Fix clang build by removing redundant "const"brettw@chromium.org2010-11-101-2/+2
| | | | | | | | TEST=none BUG=none Review URL: http://codereview.chromium.org/4729002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65632 0039d316-1c4b-4281-b951-d872f2087c98
* Core PPAPI proxy files. This includes the dispatcher which is the control pointbrettw@chromium.org2010-11-031-0/+187
| | | | | | | | | | | | on each end of the IPC channel. It includes the IPC message definitions. It also includes the base class for the interface proxying, and the core resource and var tracking. BUG=none TEST=none Review=http://codereview.chromium.org/4229002/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64874 0039d316-1c4b-4281-b951-d872f2087c98
* Revert PPAPI proxy change with too many files in it.brettw@chromium.org2010-11-031-187/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64870 0039d316-1c4b-4281-b951-d872f2087c98
* Core PPAPI proxy files. This includes the dispatcher which is the control pointbrettw@chromium.org2010-11-031-0/+187
on each end of the IPC channel. It includes the IPC message definitions. It also includes the base class for the interface proxying, and the core resource and var tracking. BUG=none TEST=none Review URL: http://codereview.chromium.org/4229002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64869 0039d316-1c4b-4281-b951-d872f2087c98