| OLD | NEW |
| 1 // Copyright (c) 2010 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 // TODO(port): the ifdefs in here are a first step towards trying to determine | 5 // TODO(port): the ifdefs in here are a first step towards trying to determine |
| 6 // the correct abstraction for all the OS functionality required at this | 6 // the correct abstraction for all the OS functionality required at this |
| 7 // stage of process initialization. It should not be taken as a final | 7 // stage of process initialization. It should not be taken as a final |
| 8 // abstraction. | 8 // abstraction. |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include <stdlib.h> | 31 #include <stdlib.h> |
| 32 #include <string.h> | 32 #include <string.h> |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 #include "app/app_paths.h" | 35 #include "app/app_paths.h" |
| 36 #include "app/app_switches.h" | 36 #include "app/app_switches.h" |
| 37 #include "app/resource_bundle.h" | 37 #include "app/resource_bundle.h" |
| 38 #include "base/at_exit.h" | 38 #include "base/at_exit.h" |
| 39 #include "base/command_line.h" | 39 #include "base/command_line.h" |
| 40 #include "base/debug_util.h" | 40 #include "base/debug_util.h" |
| 41 #include "base/debug/debugger.h" |
| 41 #include "base/i18n/icu_util.h" | 42 #include "base/i18n/icu_util.h" |
| 42 #include "base/mac/scoped_nsautorelease_pool.h" | 43 #include "base/mac/scoped_nsautorelease_pool.h" |
| 43 #include "base/message_loop.h" | 44 #include "base/message_loop.h" |
| 44 #include "base/metrics/stats_counters.h" | 45 #include "base/metrics/stats_counters.h" |
| 45 #include "base/metrics/stats_table.h" | 46 #include "base/metrics/stats_table.h" |
| 46 #include "base/path_service.h" | 47 #include "base/path_service.h" |
| 47 #include "base/process_util.h" | 48 #include "base/process_util.h" |
| 48 #include "base/string_number_conversions.h" | 49 #include "base/string_number_conversions.h" |
| 49 #include "base/string_util.h" | 50 #include "base/string_util.h" |
| 50 #include "base/utf_string_conversions.h" | 51 #include "base/utf_string_conversions.h" |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 #endif | 621 #endif |
| 621 | 622 |
| 622 #if defined(OS_POSIX) | 623 #if defined(OS_POSIX) |
| 623 // When you hit Ctrl-C in a terminal running the browser | 624 // When you hit Ctrl-C in a terminal running the browser |
| 624 // process, a SIGINT is delivered to the entire process group. | 625 // process, a SIGINT is delivered to the entire process group. |
| 625 // When debugging the browser process via gdb, gdb catches the | 626 // When debugging the browser process via gdb, gdb catches the |
| 626 // SIGINT for the browser process (and dumps you back to the gdb | 627 // SIGINT for the browser process (and dumps you back to the gdb |
| 627 // console) but doesn't for the child processes, killing them. | 628 // console) but doesn't for the child processes, killing them. |
| 628 // The fix is to have child processes ignore SIGINT; they'll die | 629 // The fix is to have child processes ignore SIGINT; they'll die |
| 629 // on their own when the browser process goes away. | 630 // on their own when the browser process goes away. |
| 630 // Note that we *can't* rely on DebugUtil::BeingDebugged to catch this | 631 // |
| 631 // case because we are the child process, which is not being debugged. | 632 // Note that we *can't* rely on BeingDebugged to catch this case because we |
| 632 if (!DebugUtil::BeingDebugged()) | 633 // are the child process, which is not being debugged. |
| 634 if (!base::debug::BeingDebugged()) |
| 633 signal(SIGINT, SIG_IGN); | 635 signal(SIGINT, SIG_IGN); |
| 634 #endif | 636 #endif |
| 635 } | 637 } |
| 636 SetupCRT(parsed_command_line); | 638 SetupCRT(parsed_command_line); |
| 637 | 639 |
| 638 // Initialize the Chrome path provider. | 640 // Initialize the Chrome path provider. |
| 639 app::RegisterPathProvider(); | 641 app::RegisterPathProvider(); |
| 640 chrome::RegisterPathProvider(); | 642 chrome::RegisterPathProvider(); |
| 641 | 643 |
| 642 // Notice a user data directory override if any | 644 // Notice a user data directory override if any |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 | 967 |
| 966 logging::CleanupChromeLogging(); | 968 logging::CleanupChromeLogging(); |
| 967 | 969 |
| 968 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) | 970 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) |
| 969 // TODO(mark): See the TODO(mark) above at InitCrashReporter. | 971 // TODO(mark): See the TODO(mark) above at InitCrashReporter. |
| 970 DestructCrashReporter(); | 972 DestructCrashReporter(); |
| 971 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD | 973 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD |
| 972 | 974 |
| 973 return rv; | 975 return rv; |
| 974 } | 976 } |
| OLD | NEW |