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

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: Moving function body to the .cc file. 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/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index c953db038bf7ff90835fcb1b5c7d7ad5e7107a38..40968218e5152dfb0d98288c05adbf1dc814164e 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"
@@ -26,6 +27,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"
@@ -271,6 +273,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);
+ size_t process_limit;
+ if (base::StringToSizeT(limit_string, &process_limit)) {
+ content::RenderProcessHost::SetMaxRendererProcessCount(process_limit);
+ }
+ }
+
if (parts_.get())
parts_->PostEarlyInitialization();
}
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc ('k') | content/browser/renderer_host/render_process_host_browsertest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698