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

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'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 d472b5f99daabb3c3e572c74f529641d331032e8..9a1fa78302d30d826c705366615f8333899995bf 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 in_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 (in_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(switches::kEnableThreadedCompositing);

Powered by Google App Engine
This is Rietveld 408576698