diff options
author | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-07 06:31:41 +0000 |
---|---|---|
committer | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-07 06:31:41 +0000 |
commit | aeab4c7449f26ac71546c1419c524c0870bc155a (patch) | |
tree | ba7549cb86473478921b14e00d5ef8e701f7c7f8 /chrome/browser/plugin_process_host.h | |
parent | ba7f857605d7d088dff38e6ceab868dd90fc108b (diff) | |
download | chromium_src-aeab4c7449f26ac71546c1419c524c0870bc155a.zip chromium_src-aeab4c7449f26ac71546c1419c524c0870bc155a.tar.gz chromium_src-aeab4c7449f26ac71546c1419c524c0870bc155a.tar.bz2 |
Revised r408 such that we no longer sometimes fail MetricsServiceTest.CrashRenderers.
That test showed that we were exiting the browser process without noticing that a child process had crashed. I fixed that by simply adding a check to see if the child process is still around before initiating the normal close of the child process. This corresponds to the case where the browser decides to close a renderer.
As a result, the race for the MessageLoop to receive a Task notifying the RenderProcessHost of a crashed renderer is removed from the picture.
The bulk of this CL is just re-landing r408, which jar reviewed.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@498 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_process_host.h')
-rw-r--r-- | chrome/browser/plugin_process_host.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/plugin_process_host.h b/chrome/browser/plugin_process_host.h index f4cf06b..e9ea4c5 100644 --- a/chrome/browser/plugin_process_host.h +++ b/chrome/browser/plugin_process_host.h @@ -27,14 +27,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef CHROME_BROWSER_PLUGIN_PROCESS_HOST_H__ -#define CHROME_BROWSER_PLUGIN_PROCESS_HOST_H__ +#ifndef CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_ +#define CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_ #include <vector> #include "base/basictypes.h" #include "base/id_map.h" -#include "base/message_loop.h" +#include "base/object_watcher.h" #include "base/process.h" #include "base/scoped_ptr.h" #include "base/task.h" @@ -59,7 +59,7 @@ class GURL; // the renderer and plugin processes. class PluginProcessHost : public IPC::Channel::Listener, public IPC::Message::Sender, - public MessageLoop::Watcher { + public base::ObjectWatcher::Delegate { public: PluginProcessHost(PluginService* plugin_service); ~PluginProcessHost(); @@ -75,7 +75,7 @@ class PluginProcessHost : public IPC::Channel::Listener, // IPC::Message::Sender implementation: virtual bool Send(IPC::Message* msg); - // MessageLoop watcher callback + // ObjectWatcher::Delegate implementation: virtual void OnObjectSignaled(HANDLE object); // IPC::Channel::Listener implementation: @@ -159,6 +159,9 @@ class PluginProcessHost : public IPC::Channel::Listener, // The handle to our plugin process. Process process_; + // Used to watch the plugin process handle. + base::ObjectWatcher watcher_; + // true while we're waiting the channel to be opened. In the meantime, // plugin instance requests will be buffered. bool opening_channel_; @@ -179,4 +182,4 @@ class PluginProcessHost : public IPC::Channel::Listener, DISALLOW_EVIL_CONSTRUCTORS(PluginProcessHost); }; -#endif // CHROME_BROWSER_PLUGIN_PROCESS_HOST_H__ +#endif // CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_ |