OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/app/chrome_main.h" | 5 #include "chrome/app/chrome_main.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
10 #include "base/i18n/icu_util.h" | 10 #include "base/i18n/icu_util.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #include "base/string_util.h" | 53 #include "base/string_util.h" |
54 #include "base/win/registry.h" | 54 #include "base/win/registry.h" |
55 #include "sandbox/src/sandbox.h" | 55 #include "sandbox/src/sandbox.h" |
56 #include "tools/memory_watcher/memory_watcher.h" | 56 #include "tools/memory_watcher/memory_watcher.h" |
57 #endif | 57 #endif |
58 | 58 |
59 #if defined(OS_MACOSX) | 59 #if defined(OS_MACOSX) |
60 #include "base/mac/mac_util.h" | 60 #include "base/mac/mac_util.h" |
61 #include "base/mac/os_crash_dumps.h" | 61 #include "base/mac/os_crash_dumps.h" |
62 #include "base/mach_ipc_mac.h" | 62 #include "base/mach_ipc_mac.h" |
| 63 #include "base/system_monitor/system_monitor.h" |
63 #include "chrome/app/breakpad_mac.h" | 64 #include "chrome/app/breakpad_mac.h" |
64 #include "chrome/browser/mac/relauncher.h" | 65 #include "chrome/browser/mac/relauncher.h" |
65 #include "chrome/common/chrome_paths_internal.h" | 66 #include "chrome/common/chrome_paths_internal.h" |
66 #include "content/browser/mach_broker_mac.h" | 67 #include "content/browser/mach_broker_mac.h" |
67 #include "grit/chromium_strings.h" | 68 #include "grit/chromium_strings.h" |
68 #include "third_party/WebKit/Source/WebKit/mac/WebCoreSupport/WebSystemInterface
.h" | 69 #include "third_party/WebKit/Source/WebKit/mac/WebCoreSupport/WebSystemInterface
.h" |
69 #include "ui/base/l10n/l10n_util_mac.h" | 70 #include "ui/base/l10n/l10n_util_mac.h" |
70 #endif | 71 #endif |
71 | 72 |
72 #if defined(OS_POSIX) | 73 #if defined(OS_POSIX) |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 // app quits. Each "main" needs to flush this pool right before it goes into | 562 // app quits. Each "main" needs to flush this pool right before it goes into |
562 // its main event loop to get rid of the cruft. | 563 // its main event loop to get rid of the cruft. |
563 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 564 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
564 | 565 |
565 #if defined(OS_CHROMEOS) | 566 #if defined(OS_CHROMEOS) |
566 chromeos::BootTimesLoader::Get()->SaveChromeMainStats(); | 567 chromeos::BootTimesLoader::Get()->SaveChromeMainStats(); |
567 #endif | 568 #endif |
568 | 569 |
569 #if defined(OS_MACOSX) | 570 #if defined(OS_MACOSX) |
570 chrome_main::SetUpBundleOverrides(); | 571 chrome_main::SetUpBundleOverrides(); |
| 572 |
| 573 // We need to allocate the IO Ports before the Sandbox is initialized or |
| 574 // the first instance of SystemMonitor is created. |
| 575 base::SystemMonitor::AllocateSystemIOPorts(); |
571 #endif | 576 #endif |
572 | 577 |
573 CommandLine::Init(argc, argv); | 578 CommandLine::Init(argc, argv); |
574 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 579 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
575 | 580 |
576 Profiling::ProcessStarted(); | 581 Profiling::ProcessStarted(); |
577 | 582 |
578 #if defined(OS_POSIX) | 583 #if defined(OS_POSIX) |
579 if (HandleVersionSwitches(command_line)) | 584 if (HandleVersionSwitches(command_line)) |
580 return 0; // Got a --version switch; exit with a success error code. | 585 return 0; // Got a --version switch; exit with a success error code. |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 | 859 |
855 if (SubprocessNeedsResourceBundle(process_type)) | 860 if (SubprocessNeedsResourceBundle(process_type)) |
856 ResourceBundle::CleanupSharedInstance(); | 861 ResourceBundle::CleanupSharedInstance(); |
857 | 862 |
858 logging::CleanupChromeLogging(); | 863 logging::CleanupChromeLogging(); |
859 | 864 |
860 chrome_main::LowLevelShutdown(); | 865 chrome_main::LowLevelShutdown(); |
861 | 866 |
862 return exit_code; | 867 return exit_code; |
863 } | 868 } |
OLD | NEW |