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

Unified Diff: content/browser/browser_main_loop.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: Created 8 years, 11 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/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index d208f74cdec2d9f3224ae9889b60c7b51b8537bf..1656f6ec42bb268ba006b00d657eb7bd23861a34 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -11,6 +11,7 @@
#include "base/message_loop.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
+#include "base/string_number_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "content/browser/browser_thread_impl.h"
#include "content/browser/download/download_file_manager.h"
@@ -24,6 +25,7 @@
#include "content/public/browser/browser_main_parts.h"
#include "content/public/browser/browser_shutdown.h"
#include "content/public/browser/content_browser_client.h"
+#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
#include "content/public/common/result_codes.h"
@@ -268,6 +270,15 @@ void BrowserMainLoop::EarlyInitialization() {
if (parsed_command_line_.HasSwitch(switches::kEnableTcpFastOpen))
net::set_tcp_fastopen_enabled(true);
+ if (parsed_command_line_.HasSwitch(switches::kRendererProcessLimit)) {
+ std::string limit_string = parsed_command_line_.GetSwitchValueASCII(
+ switches::kRendererProcessLimit);
+ int process_limit;
+ if (base::StringToInt(limit_string, &process_limit)) {
Charlie Reis 2012/02/03 23:05:34 We should use StringToSizeT, right? No negatives
nasko 2012/02/07 00:42:05 Done.
+ content::RenderProcessHost::SetMaxRendererProcessCount(process_limit);
+ }
+ }
+
if (parts_.get())
parts_->PostEarlyInitialization();
}

Powered by Google App Engine
This is Rietveld 408576698