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 #include "app/app_paths.h" | 5 #include "app/app_paths.h" |
6 #include "app/app_switches.h" | 6 #include "app/app_switches.h" |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
11 #include "base/debug_util.h" | |
12 #include "base/i18n/icu_util.h" | 11 #include "base/i18n/icu_util.h" |
13 #include "base/mac/scoped_nsautorelease_pool.h" | 12 #include "base/mac/scoped_nsautorelease_pool.h" |
14 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
15 #include "base/metrics/stats_counters.h" | 14 #include "base/metrics/stats_counters.h" |
16 #include "base/metrics/stats_table.h" | 15 #include "base/metrics/stats_table.h" |
17 #include "base/path_service.h" | 16 #include "base/path_service.h" |
18 #include "base/process_util.h" | 17 #include "base/process_util.h" |
19 #include "base/string_number_conversions.h" | 18 #include "base/string_number_conversions.h" |
20 #include "base/string_util.h" | 19 #include "base/string_util.h" |
21 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
(...skipping 20 matching lines...) Expand all Loading... |
42 #include <atlbase.h> | 41 #include <atlbase.h> |
43 #include <atlapp.h> | 42 #include <atlapp.h> |
44 #include <malloc.h> | 43 #include <malloc.h> |
45 #include <new.h> | 44 #include <new.h> |
46 #include "sandbox/src/sandbox.h" | 45 #include "sandbox/src/sandbox.h" |
47 #include "tools/memory_watcher/memory_watcher.h" | 46 #include "tools/memory_watcher/memory_watcher.h" |
48 #endif | 47 #endif |
49 | 48 |
50 #if defined(OS_MACOSX) | 49 #if defined(OS_MACOSX) |
51 #include "app/l10n_util_mac.h" | 50 #include "app/l10n_util_mac.h" |
| 51 #include "base/mac/os_crash_dumps.h" |
52 #include "base/mac_util.h" | 52 #include "base/mac_util.h" |
53 #include "base/mach_ipc_mac.h" | 53 #include "base/mach_ipc_mac.h" |
54 #include "chrome/app/breakpad_mac.h" | 54 #include "chrome/app/breakpad_mac.h" |
55 #include "chrome/browser/mach_broker_mac.h" | 55 #include "chrome/browser/mach_broker_mac.h" |
56 #include "chrome/common/chrome_paths_internal.h" | 56 #include "chrome/common/chrome_paths_internal.h" |
57 #include "grit/chromium_strings.h" | 57 #include "grit/chromium_strings.h" |
58 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" | 58 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" |
59 #endif | 59 #endif |
60 | 60 |
61 #if defined(OS_POSIX) | 61 #if defined(OS_POSIX) |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 // * We only pass crashes for foreground processes to Apple's Crash reporter. | 742 // * We only pass crashes for foreground processes to Apple's Crash reporter. |
743 // At the time of this writing, that means just the Browser process. | 743 // At the time of this writing, that means just the Browser process. |
744 // * If Breakpad is enabled, it will pass browser crashes to Crash Reporter | 744 // * If Breakpad is enabled, it will pass browser crashes to Crash Reporter |
745 // itself. | 745 // itself. |
746 // * If Breakpad is disabled, we only turn on Crash Reporter for the | 746 // * If Breakpad is disabled, we only turn on Crash Reporter for the |
747 // Browser process in release mode. | 747 // Browser process in release mode. |
748 if (!command_line.HasSwitch(switches::kDisableBreakpad)) { | 748 if (!command_line.HasSwitch(switches::kDisableBreakpad)) { |
749 bool disable_apple_crash_reporter = is_debug_build | 749 bool disable_apple_crash_reporter = is_debug_build |
750 || mac_util::IsBackgroundOnlyProcess(); | 750 || mac_util::IsBackgroundOnlyProcess(); |
751 if (!IsCrashReporterEnabled() && disable_apple_crash_reporter) { | 751 if (!IsCrashReporterEnabled() && disable_apple_crash_reporter) { |
752 DebugUtil::DisableOSCrashDumps(); | 752 base::mac::DisableOSCrashDumps(); |
753 } | 753 } |
754 } | 754 } |
755 | 755 |
756 #if defined(OS_MACOSX) | 756 #if defined(OS_MACOSX) |
757 // Mac Chrome is packaged with a main app bundle and a helper app bundle. | 757 // Mac Chrome is packaged with a main app bundle and a helper app bundle. |
758 // The main app bundle should only be used for the browser process, so it | 758 // The main app bundle should only be used for the browser process, so it |
759 // should never see a --type switch (switches::kProcessType). Likewise, | 759 // should never see a --type switch (switches::kProcessType). Likewise, |
760 // the helper should always have a --type switch. | 760 // the helper should always have a --type switch. |
761 // | 761 // |
762 // This check is done this late so there is already a call to | 762 // This check is done this late so there is already a call to |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 | 912 |
913 int exit_code = RunNamedProcessTypeMain(process_type, main_params); | 913 int exit_code = RunNamedProcessTypeMain(process_type, main_params); |
914 | 914 |
915 if (SubprocessNeedsResourceBundle(process_type)) | 915 if (SubprocessNeedsResourceBundle(process_type)) |
916 ResourceBundle::CleanupSharedInstance(); | 916 ResourceBundle::CleanupSharedInstance(); |
917 | 917 |
918 LowLevelShutdown(); | 918 LowLevelShutdown(); |
919 | 919 |
920 return exit_code; | 920 return exit_code; |
921 } | 921 } |
OLD | NEW |