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

Unified Diff: content/browser/utility_process_host.cc

Issue 8770025: Zygote most of the uses of the utility process on Linux (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month 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/utility_process_host.cc
diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc
index 65a7e706758fecf49c15d5929b5eb3febefa938c..b7b5dbd2d5eb5fd47f7c2151d8e00a617577e339 100644
--- a/content/browser/utility_process_host.cc
+++ b/content/browser/utility_process_host.cc
@@ -41,6 +41,7 @@ UtilityProcessHost::UtilityProcessHost(Client* client,
no_sandbox_(false),
#if defined(OS_LINUX)
child_flags_(CHILD_ALLOW_SELF),
+ should_use_zygote_(false),
#else
child_flags_(CHILD_NORMAL),
#endif
@@ -112,8 +113,7 @@ bool UtilityProcessHost::StartProcess() {
cmd_line->AppendSwitch(switches::kDebugPluginLoading);
#if defined(OS_POSIX)
- // TODO(port): Sandbox this on Linux. Also, zygote this to work with
- // Linux updating.
+ // TODO(port): Sandbox extension unpacking on Linux.
bool has_cmd_prefix = browser_command_line.HasSwitch(
switches::kUtilityCmdPrefix);
if (has_cmd_prefix) {
@@ -126,11 +126,17 @@ bool UtilityProcessHost::StartProcess() {
cmd_line->AppendSwitchPath(switches::kUtilityProcessAllowedDir, exposed_dir_);
#endif
+ bool use_zygote = false;
+
+#if defined(OS_LINUX)
+ use_zygote = !no_sandbox_ && should_use_zygote_;
+#endif
+
Launch(
#if defined(OS_WIN)
exposed_dir_,
#elif defined(OS_POSIX)
- false,
+ use_zygote,
env_,
#endif
cmd_line);
« content/browser/utility_process_host.h ('K') | « content/browser/utility_process_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698