| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/common/child_process.h" | 5 #include "chrome/common/child_process.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) |
| 8 #include <signal.h> // For SigUSR1Handler below. |
| 9 #endif |
| 10 |
| 7 #include "app/l10n_util.h" | 11 #include "app/l10n_util.h" |
| 8 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 9 #include "base/process_util.h" | 13 #include "base/process_util.h" |
| 10 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/thread.h" |
| 11 #include "chrome/common/child_thread.h" | 16 #include "chrome/common/child_thread.h" |
| 12 #include "grit/chromium_strings.h" | 17 #include "grit/chromium_strings.h" |
| 13 | 18 |
| 14 #if defined(OS_POSIX) | 19 #if defined(OS_POSIX) |
| 15 #include <signal.h> | |
| 16 | |
| 17 static void SigUSR1Handler(int signal) { } | 20 static void SigUSR1Handler(int signal) { } |
| 18 #endif | 21 #endif |
| 19 | 22 |
| 20 ChildProcess* ChildProcess::child_process_; | 23 ChildProcess* ChildProcess::child_process_; |
| 21 | 24 |
| 22 ChildProcess::ChildProcess() | 25 ChildProcess::ChildProcess() |
| 23 : ref_count_(0), | 26 : ref_count_(0), |
| 24 shutdown_event_(true, false), | 27 shutdown_event_(true, false), |
| 25 io_thread_("Chrome_ChildIOThread") { | 28 io_thread_("Chrome_ChildIOThread") { |
| 26 DCHECK(!child_process_); | 29 DCHECK(!child_process_); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 << ") paused waiting for debugger to attach @ pid"; | 91 << ") paused waiting for debugger to attach @ pid"; |
| 89 // Install a signal handler so that pause can be woken. | 92 // Install a signal handler so that pause can be woken. |
| 90 struct sigaction sa; | 93 struct sigaction sa; |
| 91 memset(&sa, 0, sizeof(sa)); | 94 memset(&sa, 0, sizeof(sa)); |
| 92 sa.sa_handler = SigUSR1Handler; | 95 sa.sa_handler = SigUSR1Handler; |
| 93 sigaction(SIGUSR1, &sa, NULL); | 96 sigaction(SIGUSR1, &sa, NULL); |
| 94 | 97 |
| 95 pause(); | 98 pause(); |
| 96 #endif // defined(OS_POSIX) | 99 #endif // defined(OS_POSIX) |
| 97 } | 100 } |
| OLD | NEW |