diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-15 17:36:33 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-15 17:36:33 +0000 |
commit | 4f15d284466def720aa90d4f745edfa9af378094 (patch) | |
tree | e30ce116b0c05d4adacf9fa5aae6188178b4a3a7 /ppapi/proxy/dispatcher.h | |
parent | 351856ef135301f705435a8feecbc66ecfafbf77 (diff) | |
download | chromium_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/dispatcher.h')
-rw-r--r-- | ppapi/proxy/dispatcher.h | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/ppapi/proxy/dispatcher.h b/ppapi/proxy/dispatcher.h index b3b520d..82c0f31 100644 --- a/ppapi/proxy/dispatcher.h +++ b/ppapi/proxy/dispatcher.h @@ -59,7 +59,7 @@ class Dispatcher : public IPC::Channel::Listener, typedef int32_t (*InitModuleFunc)(PP_Module, GetInterfaceFunc); typedef void (*ShutdownModuleFunc)(); - ~Dispatcher(); + virtual ~Dispatcher(); // You must call this function before anything else. Returns true on success. bool InitWithChannel(MessageLoop* ipc_message_loop, @@ -79,9 +79,6 @@ class Dispatcher : public IPC::Channel::Listener, VarSerializationRules* serialization_rules() const { return serialization_rules_.get(); } - PP_Module pp_module() const { - return pp_module_; - } // Wrapper for calling the local GetInterface function. const void* GetLocalInterface(const char* interface); @@ -103,8 +100,9 @@ class Dispatcher : public IPC::Channel::Listener, // IPC::Channel::Listener implementation. virtual bool OnMessageReceived(const IPC::Message& msg); + virtual void OnChannelError(); - // Will be NULL in some unit tests. + // Will be NULL in some unit tests and if the remote side has crashed. IPC::SyncChannel* channel() const { return channel_.get(); } @@ -132,19 +130,11 @@ class Dispatcher : public IPC::Channel::Listener, // Takes ownership of the given pointer, which must be on the heap. void SetSerializationRules(VarSerializationRules* var_serialization_rules); - void set_pp_module(PP_Module module) { - pp_module_ = module; - } - bool disallow_trusted_interfaces() const { return disallow_trusted_interfaces_; } private: - // Set by the derived classed to indicate the module ID corresponding to - // this dispatcher. - PP_Module pp_module_; - base::ProcessHandle remote_process_handle_; // See getter above. // When we're unit testing, this will indicate the sink for the messages to @@ -152,7 +142,8 @@ class Dispatcher : public IPC::Channel::Listener, // indicates that the channel should not be used. IPC::TestSink* test_sink_; - // Will be null for some tests when there is a test_sink_. + // Will be null for some tests when there is a test_sink_, and if the + // remote side has crashed. scoped_ptr<IPC::SyncChannel> channel_; bool disallow_trusted_interfaces_; |