Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3123)

Unified Diff: chrome/browser/renderer_host/render_process_host.cc

Issue 257028: Remove the RenderProcessHost from the list of renderer processes when we call... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix unit tests Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/render_process_host.cc
===================================================================
--- chrome/browser/renderer_host/render_process_host.cc (revision 27822)
+++ chrome/browser/renderer_host/render_process_host.cc (working copy)
@@ -87,7 +87,9 @@
}
RenderProcessHost::~RenderProcessHost() {
- all_hosts.Remove(id());
+ // In unit tests, Release() might not have been called.
+ if (all_hosts.Lookup(id()))
+ all_hosts.Remove(id());
}
void RenderProcessHost::Attach(IPC::Channel::Listener* listener,
@@ -108,6 +110,10 @@
NotificationType::RENDERER_PROCESS_TERMINATED,
Source<RenderProcessHost>(this), NotificationService::NoDetails());
MessageLoop::current()->DeleteSoon(FROM_HERE, this);
+
+ // Remove ourself from the list of renderer processes so that we can't be
+ // reused in between now and when the Delete task runs.
+ all_hosts.Remove(id());
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698