| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 16 matching lines...) Expand all Loading... |
| 27 #include "base/icu_util.h" | 27 #include "base/icu_util.h" |
| 28 #include "base/message_loop.h" | 28 #include "base/message_loop.h" |
| 29 #include "base/path_service.h" | 29 #include "base/path_service.h" |
| 30 #include "base/process_util.h" | 30 #include "base/process_util.h" |
| 31 #include "base/scoped_nsautorelease_pool.h" | 31 #include "base/scoped_nsautorelease_pool.h" |
| 32 #include "base/stats_table.h" | 32 #include "base/stats_table.h" |
| 33 #include "base/string_util.h" | 33 #include "base/string_util.h" |
| 34 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
| 35 #include "base/win_util.h" | 35 #include "base/win_util.h" |
| 36 #endif | 36 #endif |
| 37 #if defined(OS_MACOSX) |
| 38 #include "chrome/app/breakpad_mac.h" |
| 39 #endif |
| 37 #include "chrome/app/scoped_ole_initializer.h" | 40 #include "chrome/app/scoped_ole_initializer.h" |
| 38 #include "chrome/browser/renderer_host/render_process_host.h" | 41 #include "chrome/browser/renderer_host/render_process_host.h" |
| 39 #include "chrome/common/chrome_constants.h" | 42 #include "chrome/common/chrome_constants.h" |
| 40 #include "chrome/common/chrome_counters.h" | 43 #include "chrome/common/chrome_counters.h" |
| 41 #include "chrome/common/chrome_paths.h" | 44 #include "chrome/common/chrome_paths.h" |
| 42 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
| 43 #include "chrome/common/logging_chrome.h" | 46 #include "chrome/common/logging_chrome.h" |
| 44 #include "chrome/common/main_function_params.h" | 47 #include "chrome/common/main_function_params.h" |
| 45 #include "chrome/common/resource_bundle.h" | 48 #include "chrome/common/resource_bundle.h" |
| 46 #include "chrome/common/sandbox_init_wrapper.h" | 49 #include "chrome/common/sandbox_init_wrapper.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 242 |
| 240 #if defined(OS_WIN) | 243 #if defined(OS_WIN) |
| 241 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, | 244 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, |
| 242 sandbox::SandboxInterfaceInfo* sandbox_info, | 245 sandbox::SandboxInterfaceInfo* sandbox_info, |
| 243 TCHAR* command_line) { | 246 TCHAR* command_line) { |
| 244 #elif defined(OS_POSIX) | 247 #elif defined(OS_POSIX) |
| 245 int ChromeMain(int argc, const char** argv) { | 248 int ChromeMain(int argc, const char** argv) { |
| 246 #endif | 249 #endif |
| 247 | 250 |
| 248 #if defined(OS_MACOSX) | 251 #if defined(OS_MACOSX) |
| 249 DebugUtil::DisableOSCrashDumps(); | 252 // If Breakpad is not present then turn off os crash dumps so we don't have |
| 253 // to wait eons for Apple's Crash Reporter to generate a dump. |
| 254 if (!IsCrashReporterEnabled()) { |
| 255 DebugUtil::DisableOSCrashDumps(); |
| 256 } |
| 250 #endif | 257 #endif |
| 251 RegisterInvalidParamHandler(); | 258 RegisterInvalidParamHandler(); |
| 252 | 259 |
| 253 // The exit manager is in charge of calling the dtors of singleton objects. | 260 // The exit manager is in charge of calling the dtors of singleton objects. |
| 254 base::AtExitManager exit_manager; | 261 base::AtExitManager exit_manager; |
| 255 | 262 |
| 256 // We need this pool for all the objects created before we get to the | 263 // We need this pool for all the objects created before we get to the |
| 257 // event loop, but we don't want to leave them hanging around until the | 264 // event loop, but we don't want to leave them hanging around until the |
| 258 // app quits. Each "main" needs to flush this pool right before it goes into | 265 // app quits. Each "main" needs to flush this pool right before it goes into |
| 259 // its main event loop to get rid of the cruft. | 266 // its main event loop to get rid of the cruft. |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 _CrtDumpMemoryLeaks(); | 438 _CrtDumpMemoryLeaks(); |
| 432 #endif // _CRTDBG_MAP_ALLOC | 439 #endif // _CRTDBG_MAP_ALLOC |
| 433 | 440 |
| 434 _Module.Term(); | 441 _Module.Term(); |
| 435 #endif | 442 #endif |
| 436 | 443 |
| 437 logging::CleanupChromeLogging(); | 444 logging::CleanupChromeLogging(); |
| 438 | 445 |
| 439 return rv; | 446 return rv; |
| 440 } | 447 } |
| OLD | NEW |