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

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

Issue 9328011: Adding a command line flag to specify renderer process limit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed feedback by creis. Created 8 years, 10 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
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 657c8bb7f94ab668879cfa24ea4e67e5378e33f2..619511601d76b6eb81059c93a2ffa2c97906cb2f 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -201,11 +201,19 @@ class RendererURLRequestContextSelector
scoped_refptr<net::URLRequestContextGetter> media_request_context_;
};
-size_t max_renderer_count_override = 0;
+// the global list of all renderer processes
+base::LazyInstance<IDMap<content::RenderProcessHost> >::Leaky
+ g_all_hosts = LAZY_INSTANCE_INITIALIZER;
+
+} // namespace
+
+// static
+size_t content::RenderProcessHost::max_renderer_count_override_ = 0;
-size_t GetMaxRendererProcessCount() {
- if (max_renderer_count_override)
- return max_renderer_count_override;
+// static
+size_t content::RenderProcessHost::GetMaxRendererProcessCount() {
+ if (max_renderer_count_override_)
+ return max_renderer_count_override_;
// Defines the maximum number of renderer processes according to the
// amount of installed memory as reported by the OS. The table
@@ -245,19 +253,12 @@ size_t GetMaxRendererProcessCount() {
return max_count;
}
-// the global list of all renderer processes
-base::LazyInstance<IDMap<content::RenderProcessHost> >::Leaky
- g_all_hosts = LAZY_INSTANCE_INITIALIZER;
-
-} // namespace
-
// static
bool g_run_renderer_in_process_ = false;
// static
-void content::RenderProcessHost::SetMaxRendererProcessCountForTest(
- size_t count) {
- max_renderer_count_override = count;
+void content::RenderProcessHost::SetMaxRendererProcessCount(size_t count) {
+ max_renderer_count_override_ = count;
}
RenderProcessHostImpl::RenderProcessHostImpl(

Powered by Google App Engine
This is Rietveld 408576698