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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 8597005: Provide a way for RenderProcessHosts to register themselves in the global host map. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | « content/browser/renderer_host/render_process_host_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
}
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698