summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/host_dispatcher.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-15 17:36:33 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-15 17:36:33 +0000
commit4f15d284466def720aa90d4f745edfa9af378094 (patch)
treee30ce116b0c05d4adacf9fa5aae6188178b4a3a7 /ppapi/proxy/host_dispatcher.h
parent351856ef135301f705435a8feecbc66ecfafbf77 (diff)
downloadchromium_src-4f15d284466def720aa90d4f745edfa9af378094.zip
chromium_src-4f15d284466def720aa90d4f745edfa9af378094.tar.gz
chromium_src-4f15d284466def720aa90d4f745edfa9af378094.tar.bz2
Implement basic crash detection and shutdown handling for out of process PPAPI
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
Diffstat (limited to 'ppapi/proxy/host_dispatcher.h')
-rw-r--r--ppapi/proxy/host_dispatcher.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/ppapi/proxy/host_dispatcher.h b/ppapi/proxy/host_dispatcher.h
index e38fca6..5153f19 100644
--- a/ppapi/proxy/host_dispatcher.h
+++ b/ppapi/proxy/host_dispatcher.h
@@ -15,6 +15,7 @@
#include "ppapi/proxy/dispatcher.h"
#include "ppapi/proxy/plugin_var_tracker.h"
+struct PPB_Proxy_Private;
struct PPB_Var_Deprecated;
namespace base {
@@ -48,6 +49,14 @@ class HostDispatcher : public Dispatcher {
HostDispatcher* dispatcher);
static void RemoveForInstance(PP_Instance instance);
+ // Returns the host's notion of our PP_Module. This will be different than
+ // the plugin's notion of its PP_Module because the plugin process may be
+ // used by multiple renderer processes.
+ //
+ // Use this value instead of a value from the plugin whenever talking to the
+ // host.
+ PP_Module pp_module() const { return pp_module_; }
+
// Dispatcher overrides.
virtual bool IsPlugin() const;
@@ -61,9 +70,14 @@ class HostDispatcher : public Dispatcher {
// 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* GetPPBProxy();
+
private:
friend class HostDispatcherTest;
+ PP_Module pp_module_;
+
enum PluginInterfaceSupport {
INTERFACE_UNQUERIED = 0, // Must be 0 so memset(0) will clear the list.
INTERFACE_SUPPORTED,
@@ -75,6 +89,9 @@ class HostDispatcher : public Dispatcher {
// messages. They are created on demand when we receive messages.
scoped_ptr<InterfaceProxy> target_proxies_[INTERFACE_ID_COUNT];
+ // Lazily initialized, may be NULL. Use GetPPBProxy().
+ const PPB_Proxy_Private* ppb_proxy_;
+
DISALLOW_COPY_AND_ASSIGN(HostDispatcher);
};