diff options
author | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-07 07:24:18 +0000 |
---|---|---|
committer | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-07 07:24:18 +0000 |
commit | a346e5d85135c9c5261ad33a20293bf10ca74468 (patch) | |
tree | a91d386790b2812936b4b618165b4e411172f095 /chrome/browser/render_process_host.cc | |
parent | b9c3a91b0340151f21e3708b8187f295e6cf8cfd (diff) | |
download | chromium_src-a346e5d85135c9c5261ad33a20293bf10ca74468.zip chromium_src-a346e5d85135c9c5261ad33a20293bf10ca74468.tar.gz chromium_src-a346e5d85135c9c5261ad33a20293bf10ca74468.tar.bz2 |
rollback r498 and r500 to repair test bustage
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/render_process_host.cc')
-rw-r--r-- | chrome/browser/render_process_host.cc | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/chrome/browser/render_process_host.cc b/chrome/browser/render_process_host.cc index ccf252a..43ebb64 100644 --- a/chrome/browser/render_process_host.cc +++ b/chrome/browser/render_process_host.cc @@ -202,7 +202,7 @@ RenderProcessHost::~RenderProcessHost() { channel_.reset(); if (process_.handle() && !run_renderer_in_process_) { - watcher_.StopWatching(); + MessageLoop::current()->WatchObject(process_.handle(), NULL); ProcessWatcher::EnsureProcessTerminated(process_.handle()); } @@ -420,7 +420,7 @@ bool RenderProcessHost::Init() { process_.set_handle(process); } - watcher_.StartWatching(process_.handle(), this); + MessageLoop::current()->WatchObject(process_.handle(), this); } } @@ -459,21 +459,16 @@ void RenderProcessHost::Release(int listener_id) { DCHECK(listeners_.Lookup(listener_id) != NULL); listeners_.Remove(listener_id); - // Make sure that all associated resource requests are stopped. + // make sure that all associated resource requests are stopped. widget_helper_->CancelResourceRequests(listener_id); - // When there are no other owners of this object, we can delete ourselves. + // when no other owners of this object, we can delete ourselves if (listeners_.IsEmpty()) { if (!notified_termination_) { - // It is possible that the renderer died already even though we haven't - // broken the pipe yet. We should take care to count this as unexpected. - // In unit tests, we do not have a valid process handle. - bool clean_shutdown = true; - if (process_.handle()) - clean_shutdown = !process_util::DidProcessCrash(process_.handle()); + bool close_expected = true; NotificationService::current()->Notify(NOTIFY_RENDERER_PROCESS_TERMINATED, Source<RenderProcessHost>(this), - Details<bool>(&clean_shutdown)); + Details<bool>(&close_expected)); notified_termination_ = true; } Unregister(); @@ -511,8 +506,8 @@ bool RenderProcessHost::FastShutdownIfPossible() { return false; } } - // Otherwise, call TerminateProcess. Using NORMAL_EXIT here means that UMA - // won't treat this as a renderer crash. + // Otherwise, call TerminateProcess. Using exit code 0 means that UMA won't + // treat this as a renderer crash. ::TerminateProcess(proc, ResultCodes::NORMAL_EXIT); return true; } @@ -581,7 +576,7 @@ void RenderProcessHost::OnChannelConnected(int32 peer_pid) { // returned by CreateProcess() has to the process object. process_.set_handle(OpenProcess(MAXIMUM_ALLOWED, FALSE, peer_pid)); DCHECK(process_.handle()); - watcher_.StartWatching(process_.handle(), this); + MessageLoop::current()->WatchObject(process_.handle(), this); } } else { // Need to verify that the peer_pid is actually the process we know, if @@ -596,6 +591,8 @@ void RenderProcessHost::OnObjectSignaled(HANDLE object) { DCHECK(channel_.get()); DCHECK_EQ(object, process_.handle()); + MessageLoop::current()->WatchObject(object, NULL); + bool clean_shutdown = !process_util::DidProcessCrash(object); process_.Close(); @@ -603,8 +600,8 @@ void RenderProcessHost::OnObjectSignaled(HANDLE object) { channel_.reset(); if (!notified_termination_) { - // If |clean_shutdown| is false, it means the renderer process went away - // before we expected it; count it as a crash. + // If |close_expected| is false, it means the renderer process went away + // before the web views expected it; count it as a crash. NotificationService::current()->Notify(NOTIFY_RENDERER_PROCESS_TERMINATED, Source<RenderProcessHost>(this), Details<bool>(&clean_shutdown)); |