summaryrefslogtreecommitdiffstats
path: root/content/browser/android/content_startup_flags.cc
diff options
context:
space:
mode:
authorppi@chromium.org <ppi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-18 15:03:01 +0000
committerppi@chromium.org <ppi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-18 15:03:01 +0000
commit6f562220ff06895b3c859215c34c4b1935fceb02 (patch)
treecec2acab08891cd412647f125aa3e48879938918 /content/browser/android/content_startup_flags.cc
parent2ba6b280791983324c24dbef211fd4db97ad7f55 (diff)
downloadchromium_src-6f562220ff06895b3c859215c34c4b1935fceb02.zip
chromium_src-6f562220ff06895b3c859215c34c4b1935fceb02.tar.gz
chromium_src-6f562220ff06895b3c859215c34c4b1935fceb02.tar.bz2
Don't share renderers between unrelated tabs on Android.
On Android we explicitly allow the OS to kill Chrome's background renderers when under memory pressure and we don't try to control the number of renderers ourselves. The process limit logic in content causes process sharing between unrelated tabs when the number of renderer process hosts (not the number of actual live processes) is too high. Because on Android the system adjusts the number of actual live processes for us, we don't want to limit the number of process hosts or to ever share renderers between unrelated tabs. This patch: - disables the renderer process host limit on Android. If not overridden, ShouldTryToUseExistingProcessHost() will always return false. - drops the logic that sets the renderer limit based on the number of declared renderer services BUG=325842 Review URL: https://codereview.chromium.org/356453003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284095 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/android/content_startup_flags.cc')
-rw-r--r--content/browser/android/content_startup_flags.cc15
1 files changed, 5 insertions, 10 deletions
diff --git a/content/browser/android/content_startup_flags.cc b/content/browser/android/content_startup_flags.cc
index f185691..d315371 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(