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

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

Issue 356453003: Don't share renderers between unrelated tabs on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address John(me)'s comments. Created 6 years, 5 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/android/content_startup_flags.cc
diff --git a/content/browser/android/content_startup_flags.cc b/content/browser/android/content_startup_flags.cc
index f1856917a8a34d2641f00f56fb0b68d717d40f1a..d315371ca4ba858769366bf2160542b9c1425d7c 100644
--- a/content/browser/android/content_startup_flags.cc
+++ b/content/browser/android/content_startup_flags.cc
@@ -18,7 +18,7 @@
namespace content {
-void SetContentCommandLineFlags(int max_render_process_count,
+void SetContentCommandLineFlags(bool single_process,
const std::string& plugin_descriptor) {
// May be called multiple times, to cover all possible program entry points.
static bool already_initialized = false;
@@ -34,9 +34,7 @@ void SetContentCommandLineFlags(int max_render_process_count,
switches::kRendererProcessLimit);
int value;
if (base::StringToInt(limit, &value)) {
- command_line_renderer_limit = value;
- if (value <= 0)
- max_render_process_count = 0;
+ command_line_renderer_limit = std::max(0, value);
}
}
@@ -44,16 +42,13 @@ void SetContentCommandLineFlags(int max_render_process_count,
int limit = std::min(command_line_renderer_limit,
static_cast<int>(kMaxRendererProcessCount));
RenderProcessHost::SetMaxRendererProcessCount(limit);
- } else if (max_render_process_count <= 0) {
+ }
+
+ if (single_process || command_line_renderer_limit == 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 {
- int default_maximum = RenderProcessHost::GetMaxRendererProcessCount();
- DCHECK(default_maximum <= static_cast<int>(kMaxRendererProcessCount));
- if (max_render_process_count < default_maximum)
- RenderProcessHost::SetMaxRendererProcessCount(max_render_process_count);
}
parsed_command_line->AppendSwitch(
« no previous file with comments | « content/browser/android/content_startup_flags.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698