summaryrefslogtreecommitdiffstats
path: root/chrome/browser/render_process_host.h
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-07 06:31:41 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-07 06:31:41 +0000
commitaeab4c7449f26ac71546c1419c524c0870bc155a (patch)
treeba7549cb86473478921b14e00d5ef8e701f7c7f8 /chrome/browser/render_process_host.h
parentba7f857605d7d088dff38e6ceab868dd90fc108b (diff)
downloadchromium_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/render_process_host.h')
-rw-r--r--chrome/browser/render_process_host.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/chrome/browser/render_process_host.h b/chrome/browser/render_process_host.h
index 117ad55..e64b8fe 100644
--- a/chrome/browser/render_process_host.h
+++ b/chrome/browser/render_process_host.h
@@ -27,14 +27,15 @@
// (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_RENDER_PROCESS_HOST_H__
-#define CHROME_BROWSER_RENDER_PROCESS_HOST_H__
+#ifndef CHROME_BROWSER_RENDER_PROCESS_HOST_H_
+#define CHROME_BROWSER_RENDER_PROCESS_HOST_H_
+#include <set>
#include <vector>
#include <windows.h>
#include "base/id_map.h"
-#include "base/message_loop.h"
+#include "base/object_watcher.h"
#include "base/process.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
@@ -61,8 +62,8 @@ class WebContents;
// are correlated with IDs. This way, the Views and the corresponding ViewHosts
// communicate through the two process objects.
class RenderProcessHost : public IPC::Channel::Listener,
- public MessageLoop::Watcher,
public IPC::Channel::Sender,
+ public base::ObjectWatcher::Delegate,
public NotificationObserver {
public:
// Returns the RenderProcessHost given its ID. Returns NULL if the ID does
@@ -155,7 +156,7 @@ class RenderProcessHost : public IPC::Channel::Listener,
virtual void OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelConnected(int32 peer_pid);
- // MessageLoop watcher callback
+ // ObjectWatcher::Delegate
virtual void OnObjectSignaled(HANDLE object);
// IPC::Channel::Sender callback
@@ -244,6 +245,9 @@ class RenderProcessHost : public IPC::Channel::Listener,
// Our renderer process.
Process process_;
+ // Used to watch the renderer process handle.
+ base::ObjectWatcher watcher_;
+
// The profile associated with this renderer process.
Profile* profile_;
@@ -289,4 +293,4 @@ inline std::wstring GenerateRandomChannelID(void* instance) {
}
-#endif // CHROME_BROWSER_RENDER_PROCESS_HOST_H__
+#endif // CHROME_BROWSER_RENDER_PROCESS_HOST_H_