diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-12 18:36:03 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-12 18:36:03 +0000 |
commit | f3abf10c215c3d281ee52a18a97a004a6d6c6dfd (patch) | |
tree | 03781eb460ac881b84b68eea0819b14a1543dde7 /content/browser/renderer_host/render_process_host.cc | |
parent | 333b1de96adffbde36931f68a0ee9f099d9dd8f3 (diff) | |
download | chromium_src-f3abf10c215c3d281ee52a18a97a004a6d6c6dfd.zip chromium_src-f3abf10c215c3d281ee52a18a97a004a6d6c6dfd.tar.gz chromium_src-f3abf10c215c3d281ee52a18a97a004a6d6c6dfd.tar.bz2 |
Reset RPH's channel.
This is important for shutdown ordering to make sure the objects hanging off the channel get deleted before objects they reference (like data in ResourceContext) go away.
BUG=91398
TEST=none
Review URL: http://codereview.chromium.org/7796029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100730 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/render_process_host.cc')
-rw-r--r-- | content/browser/renderer_host/render_process_host.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/content/browser/renderer_host/render_process_host.cc b/content/browser/renderer_host/render_process_host.cc index e34a600..ec097de 100644 --- a/content/browser/renderer_host/render_process_host.cc +++ b/content/browser/renderer_host/render_process_host.cc @@ -114,6 +114,10 @@ RenderProcessHost::~RenderProcessHost() { all_hosts.Remove(id()); } +bool RenderProcessHost::HasConnection() const { + return channel_.get() != NULL; +} + void RenderProcessHost::Attach(IPC::Channel::Listener* listener, int routing_id) { VLOG_IF(1, g_log_bug53991) << "AddListener: (" << this << "): " << routing_id; @@ -136,6 +140,12 @@ void RenderProcessHost::Release(int listener_id) { Source<RenderProcessHost>(this), NotificationService::NoDetails()); MessageLoop::current()->DeleteSoon(FROM_HERE, this); deleting_soon_ = true; + // It's important not to wait for the DeleteTask to delete the channel + // proxy. Kill it off now. That way, in case the profile is going away, the + // rest of the objects attached to this RenderProcessHost start going + // away first, since deleting the channel proxy will post a + // OnChannelClosed() to IPC::ChannelProxy::Context on the IO thread. + channel_.reset(); // Remove ourself from the list of renderer processes so that we can't be // reused in between now and when the Delete task runs. |