| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/app/content_main_runner.h" | 5 #include "content/public/app/content_main_runner.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include "base/allocator/allocator_extension.h" | 9 #include "base/allocator/allocator_extension.h" |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 memset(&sigact, 0, sizeof(sigact)); | 215 memset(&sigact, 0, sizeof(sigact)); |
| 216 sigact.sa_handler = SIG_DFL; | 216 sigact.sa_handler = SIG_DFL; |
| 217 static const int signals_to_reset[] = | 217 static const int signals_to_reset[] = |
| 218 {SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGABRT, SIGFPE, SIGSEGV, | 218 {SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGABRT, SIGFPE, SIGSEGV, |
| 219 SIGALRM, SIGTERM, SIGCHLD, SIGBUS, SIGTRAP}; // SIGPIPE is set below. | 219 SIGALRM, SIGTERM, SIGCHLD, SIGBUS, SIGTRAP}; // SIGPIPE is set below. |
| 220 for (unsigned i = 0; i < arraysize(signals_to_reset); i++) { | 220 for (unsigned i = 0; i < arraysize(signals_to_reset); i++) { |
| 221 CHECK(0 == sigaction(signals_to_reset[i], &sigact, NULL)); | 221 CHECK(0 == sigaction(signals_to_reset[i], &sigact, NULL)); |
| 222 } | 222 } |
| 223 | 223 |
| 224 // Always ignore SIGPIPE. We check the return value of write(). | 224 // Always ignore SIGPIPE. We check the return value of write(). |
| 225 CHECK(signal(SIGPIPE, SIG_IGN) != SIG_ERR); | 225 CHECK(base::IgnoreSigPipe()); |
| 226 } | 226 } |
| 227 | 227 |
| 228 #endif // OS_POSIX && !OS_IOS | 228 #endif // OS_POSIX && !OS_IOS |
| 229 | 229 |
| 230 void CommonSubprocessInit(const std::string& process_type) { | 230 void CommonSubprocessInit(const std::string& process_type) { |
| 231 #if defined(OS_WIN) | 231 #if defined(OS_WIN) |
| 232 // HACK: Let Windows know that we have started. This is needed to suppress | 232 // HACK: Let Windows know that we have started. This is needed to suppress |
| 233 // the IDC_APPSTARTING cursor from being displayed for a prolonged period | 233 // the IDC_APPSTARTING cursor from being displayed for a prolonged period |
| 234 // while a subprocess is starting. | 234 // while a subprocess is starting. |
| 235 PostThreadMessage(GetCurrentThreadId(), WM_NULL, 0, 0); | 235 PostThreadMessage(GetCurrentThreadId(), WM_NULL, 0, 0); |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 | 799 |
| 800 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 800 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
| 801 }; | 801 }; |
| 802 | 802 |
| 803 // static | 803 // static |
| 804 ContentMainRunner* ContentMainRunner::Create() { | 804 ContentMainRunner* ContentMainRunner::Create() { |
| 805 return new ContentMainRunnerImpl(); | 805 return new ContentMainRunnerImpl(); |
| 806 } | 806 } |
| 807 | 807 |
| 808 } // namespace content | 808 } // namespace content |
| OLD | NEW |