summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/chrome_dll_main.cc6
-rw-r--r--chrome/browser/worker_host/worker_process_host.cc13
-rwxr-xr-xchrome/tools/chrome-process-identifier.sh12
3 files changed, 15 insertions, 16 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index 02f554d..99e5a6a 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -854,12 +854,14 @@ int ChromeMain(int argc, char** argv) {
if (process_type == switches::kRendererProcess ||
process_type == switches::kExtensionProcess) {
rv = RendererMain(main_params);
-#ifndef DISABLE_NACL
+#if !defined(DISABLE_NACL)
} else if (process_type == switches::kNaClLoaderProcess) {
rv = NaClMain(main_params);
#endif
+ } else if (process_type == switches::kWorkerProcess) {
+ rv = WorkerMain(main_params);
} else {
- NOTREACHED() << "Unknown process type";
+ NOTREACHED() << "Unknown process type: " << process_type;
}
} else {
rv = 0;
diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc
index c06465a..ffe64a3 100644
--- a/chrome/browser/worker_host/worker_process_host.cc
+++ b/chrome/browser/worker_host/worker_process_host.cc
@@ -127,6 +127,8 @@ bool WorkerProcessHost::Init() {
arraysize(kSwitchNames));
#if defined(OS_POSIX)
+ bool use_zygote = true;
+
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kWaitForDebuggerChildren)) {
// Look to pass-on the kWaitForDebugger flag.
@@ -134,6 +136,7 @@ bool WorkerProcessHost::Init() {
switches::kWaitForDebuggerChildren);
if (value.empty() || value == switches::kWorkerProcess) {
cmd_line->AppendSwitch(switches::kWaitForDebugger);
+ use_zygote = false;
}
}
@@ -145,22 +148,16 @@ bool WorkerProcessHost::Init() {
// launches a new xterm, and runs the worker process in gdb, reading
// optional commands from gdb_chrome file in the working directory.
cmd_line->PrependWrapper("xterm -e gdb -x gdb_chrome --args");
+ use_zygote = false;
}
}
-
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kRendererCmdPrefix)) {
- cmd_line->PrependWrapper(
- CommandLine::ForCurrentProcess()->GetSwitchValueNative(
- switches::kRendererCmdPrefix));
- }
#endif
Launch(
#if defined(OS_WIN)
FilePath(),
#elif defined(OS_POSIX)
- false,
+ use_zygote,
base::environment_vector(),
#endif
cmd_line);
diff --git a/chrome/tools/chrome-process-identifier.sh b/chrome/tools/chrome-process-identifier.sh
index c12aedb..f7ec283 100755
--- a/chrome/tools/chrome-process-identifier.sh
+++ b/chrome/tools/chrome-process-identifier.sh
@@ -52,7 +52,8 @@ identify() {
foundzygote=0
for child in $(ps h --format pid --ppid $1); do
cmd="$(xargs -0 </proc/$child/cmdline|sed 's/ -/\n-/g')" 2>/dev/null
- case "$(echo "$cmd" | sed 's/--type=//;t1;d;:1;q')" in
+ type="$(echo "$cmd" | sed 's/--type=//;t1;d;:1;q')"
+ case $type in
'')
echo "Process $child is part of the browser"
identify "$child"
@@ -67,19 +68,19 @@ identify() {
echo "Process $child is a \"$plugin\" plugin"
identify "$child"
;;
- renderer)
+ renderer|worker)
# The seccomp sandbox has exactly one child process that has no other
# threads. This is the trusted helper process.
- seccomp="$(ps h --format pid --ppid $child)"
+ seccomp="$(ps h --format pid --ppid $child|xargs)"
if [ $(echo "$seccomp" | wc -w) -eq 1 ] &&
[ $(ls /proc/$seccomp/task 2>/dev/null | wc -w) -eq 1 ] &&
ls -l /proc/$seccomp/exe 2>/dev/null | egrep -q '/chrome$'; then
- echo -n "Process $child is a sandboxed renderer (seccomp helper:" \
+ echo -n "Process $child is a sandboxed $type (seccomp helper:" \
"$seccomp)"
[ -d /proc/$child/cwd/. ] || echo -n "; setuid sandbox is active"
echo
else
- echo -n "Process $child is a renderer"
+ echo -n "Process $child is a $type"
[ -d /proc/$child/cwd/. ] || echo -n "; setuid sandbox is active"
echo
identify "$child"
@@ -91,7 +92,6 @@ identify() {
identify "$child"
;;
*)
- type="$(echo "$cmd" | sed 's/--type=//;t1;d;:1;q')"
echo "Process $child is of unknown type \"$type\""
identify "$child"
;;