| 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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 435 |
| 436 } // namespace | 436 } // namespace |
| 437 | 437 |
| 438 #if defined(OS_WIN) | 438 #if defined(OS_WIN) |
| 439 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, | 439 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, |
| 440 sandbox::SandboxInterfaceInfo* sandbox_info, | 440 sandbox::SandboxInterfaceInfo* sandbox_info, |
| 441 TCHAR* command_line) { | 441 TCHAR* command_line) { |
| 442 #elif defined(OS_POSIX) | 442 #elif defined(OS_POSIX) |
| 443 int ChromeMain(int argc, char** argv) { | 443 int ChromeMain(int argc, char** argv) { |
| 444 #endif | 444 #endif |
| 445 #if defined(OS_CHROMEOS) | |
| 446 chromeos::BootTimesLoader::Get()->SaveChromeMainStats(); | |
| 447 #endif | |
| 448 #if defined(OS_MACOSX) | 445 #if defined(OS_MACOSX) |
| 449 // TODO(mark): Some of these things ought to be handled in chrome_exe_main.mm. | 446 // TODO(mark): Some of these things ought to be handled in chrome_exe_main.mm. |
| 450 // Under the current architecture, nothing in chrome_exe_main can rely | 447 // Under the current architecture, nothing in chrome_exe_main can rely |
| 451 // directly on chrome_dll code on the Mac, though, so until some of this code | 448 // directly on chrome_dll code on the Mac, though, so until some of this code |
| 452 // is refactored to avoid such a dependency, it lives here. See also the | 449 // is refactored to avoid such a dependency, it lives here. See also the |
| 453 // TODO(mark) below at InitCrashReporter() and DestructCrashReporter(). | 450 // TODO(mark) below at InitCrashReporter() and DestructCrashReporter(). |
| 454 base::EnableTerminationOnHeapCorruption(); | 451 base::EnableTerminationOnHeapCorruption(); |
| 455 base::EnableTerminationOnOutOfMemory(); | 452 base::EnableTerminationOnOutOfMemory(); |
| 456 #endif // OS_MACOSX | 453 #endif // OS_MACOSX |
| 457 | 454 |
| 458 RegisterInvalidParamHandler(); | 455 RegisterInvalidParamHandler(); |
| 459 | 456 |
| 460 // The exit manager is in charge of calling the dtors of singleton objects. | 457 // The exit manager is in charge of calling the dtors of singleton objects. |
| 461 base::AtExitManager exit_manager; | 458 base::AtExitManager exit_manager; |
| 462 | 459 |
| 463 // We need this pool for all the objects created before we get to the | 460 // We need this pool for all the objects created before we get to the |
| 464 // event loop, but we don't want to leave them hanging around until the | 461 // event loop, but we don't want to leave them hanging around until the |
| 465 // app quits. Each "main" needs to flush this pool right before it goes into | 462 // app quits. Each "main" needs to flush this pool right before it goes into |
| 466 // its main event loop to get rid of the cruft. | 463 // its main event loop to get rid of the cruft. |
| 467 base::ScopedNSAutoreleasePool autorelease_pool; | 464 base::ScopedNSAutoreleasePool autorelease_pool; |
| 468 | 465 |
| 466 #if defined(OS_CHROMEOS) |
| 467 chromeos::BootTimesLoader::Get()->SaveChromeMainStats(); |
| 468 #endif |
| 469 |
| 469 #if defined(OS_POSIX) | 470 #if defined(OS_POSIX) |
| 470 base::GlobalDescriptors* g_fds = Singleton<base::GlobalDescriptors>::get(); | 471 base::GlobalDescriptors* g_fds = Singleton<base::GlobalDescriptors>::get(); |
| 471 g_fds->Set(kPrimaryIPCChannel, | 472 g_fds->Set(kPrimaryIPCChannel, |
| 472 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor); | 473 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor); |
| 473 #if defined(OS_LINUX) | 474 #if defined(OS_LINUX) |
| 474 g_fds->Set(kCrashDumpSignal, | 475 g_fds->Set(kCrashDumpSignal, |
| 475 kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor); | 476 kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor); |
| 476 #endif | 477 #endif |
| 477 #endif | 478 #endif |
| 478 | 479 |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 | 905 |
| 905 logging::CleanupChromeLogging(); | 906 logging::CleanupChromeLogging(); |
| 906 | 907 |
| 907 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) | 908 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) |
| 908 // TODO(mark): See the TODO(mark) above at InitCrashReporter. | 909 // TODO(mark): See the TODO(mark) above at InitCrashReporter. |
| 909 DestructCrashReporter(); | 910 DestructCrashReporter(); |
| 910 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD | 911 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD |
| 911 | 912 |
| 912 return rv; | 913 return rv; |
| 913 } | 914 } |
| OLD | NEW |