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

Unified Diff: content/browser/android/content_startup_flags.cc

Issue 138313004: Render process count should not be forced from java unconditionally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/content_startup_flags.cc
diff --git a/content/browser/android/content_startup_flags.cc b/content/browser/android/content_startup_flags.cc
index 7d9503434434ae5830345e6dfbde40d574f8a911..3ce2bd657b0c2d066f1bc433537b8d47848a9cb9 100644
--- a/content/browser/android/content_startup_flags.cc
+++ b/content/browser/android/content_startup_flags.cc
@@ -27,25 +27,31 @@ void SetContentCommandLineFlags(int max_render_process_count,
CommandLine* parsed_command_line = CommandLine::ForCurrentProcess();
+ int command_line_renderer_limit = -1;
if (parsed_command_line->HasSwitch(switches::kRendererProcessLimit)) {
std::string limit = parsed_command_line->GetSwitchValueASCII(
switches::kRendererProcessLimit);
int value;
if (base::StringToInt(limit, &value))
- max_render_process_count = value;
+ command_line_renderer_limit = value;
}
- if (max_render_process_count <= 0) {
+ if (command_line_renderer_limit != -1) {
aberent 2014/01/24 21:29:09 What happens if command_line_render_limit is set b
kbalazs 2014/01/29 16:55:43 I think the command line should override everythin
+ int limit = std::min(command_line_renderer_limit,
+ static_cast<int>(kMaxRendererProcessCount));
+ RenderProcessHost::SetMaxRendererProcessCount(limit);
+ } else if (max_render_process_count <= 0) {
// Need to ensure the command line flag is consistent as a lot of chrome
// internal code checks this directly, but it wouldn't normally get set when
// we are implementing an embedded WebView.
parsed_command_line->AppendSwitch(switches::kSingleProcess);
} else {
- max_render_process_count =
- std::min(max_render_process_count,
- static_cast<int>(content::kMaxRendererProcessCount));
- content::RenderProcessHost::SetMaxRendererProcessCount(
- max_render_process_count);
+ int default_maximum = RenderProcessHost::GetMaxRendererProcessCount();
aberent 2014/01/24 21:29:09 If I am reading this right then GetMaxRendererProc
kbalazs 2014/01/29 16:55:43 Yes, this was my intent. This is consistent with t
+ DCHECK(default_maximum <= kMaxRendererProcessCount);
+ if (max_render_process_count < default_maximum) {
+ content::RenderProcessHost::SetMaxRendererProcessCount(
aberent 2014/01/24 21:29:09 Why content::RenderProcessHost here, but simply Re
kbalazs 2014/01/29 16:55:43 by mistake
+ max_render_process_count);
+ }
}
parsed_command_line->AppendSwitch(switches::kForceCompositingMode);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698