Index: content/browser/renderer_host/render_process_host_impl.cc |
=================================================================== |
--- content/browser/renderer_host/render_process_host_impl.cc (revision 110616) |
+++ content/browser/renderer_host/render_process_host_impl.cc (working copy) |
@@ -249,14 +249,14 @@ |
return content::GetContentClient()->browser()->IsSuitableHost(host, site_url); |
} |
-} // namespace |
- |
// the global list of all renderer processes |
base::LazyInstance< |
IDMap<content::RenderProcessHost>, |
base::LeakyLazyInstanceTraits<IDMap<content::RenderProcessHost> > > |
g_all_hosts = LAZY_INSTANCE_INITIALIZER; |
+} // namespace |
+ |
// static |
bool g_run_renderer_in_process_ = false; |
@@ -323,7 +323,7 @@ |
base::PLATFORM_FILE_WRITE); |
CHECK(!content::ExitedMainMessageLoop()); |
- g_all_hosts.Get().AddWithID(this, GetID()); |
+ RegisterHost(GetID(), this); |
g_all_hosts.Get().set_check_on_null_data(true); |
// Initialize |child_process_activity_time_| to a reasonable value. |
mark_child_process_activity_time(); |
@@ -344,8 +344,7 @@ |
} |
ClearTransportDIBCache(); |
- if (g_all_hosts.Get().Lookup(GetID())) |
- g_all_hosts.Get().Remove(GetID()); |
+ UnregisterHost(GetID()); |
} |
void RenderProcessHostImpl::EnableSendQueue() { |
@@ -1104,6 +1103,17 @@ |
} |
// static |
+void RenderProcessHostImpl::RegisterHost(int host_id, |
+ content::RenderProcessHost* host) { |
+ g_all_hosts.Get().AddWithID(host, host_id); |
+} |
+ |
+void RenderProcessHostImpl::UnregisterHost(int host_id) { |
+ if (g_all_hosts.Get().Lookup(host_id)) |
+ g_all_hosts.Get().Remove(host_id); |
+} |
+ |
+// static |
bool content::RenderProcessHost::run_renderer_in_process() { |
return g_run_renderer_in_process_; |
} |