| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/lazy_instance.h" | 6 #include "base/lazy_instance.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/metrics/stats_counters.h" | 9 #include "base/metrics/stats_counters.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE { | 380 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE { |
| 381 #if defined(OS_CHROMEOS) | 381 #if defined(OS_CHROMEOS) |
| 382 chromeos::BootTimesLoader::Get()->SaveChromeMainStats(); | 382 chromeos::BootTimesLoader::Get()->SaveChromeMainStats(); |
| 383 #endif | 383 #endif |
| 384 | 384 |
| 385 #if defined(OS_MACOSX) | 385 #if defined(OS_MACOSX) |
| 386 // TODO(shess): Enable zombies for everyone. http://crbug.com/94551 | 386 // TODO(shess): Enable zombies for everyone. http://crbug.com/94551 |
| 387 DCHECK(ObjcEvilDoers::ZombieEnable(true, 1000)); | 387 DCHECK(ObjcEvilDoers::ZombieEnable(true, 1000)); |
| 388 SetUpBundleOverrides(); | 388 SetUpBundleOverrides(); |
| 389 chrome::common::mac::EnableCFBundleBlocker(); | 389 chrome::common::mac::EnableCFBundleBlocker(); |
| 390 | |
| 391 SwitchToMachBootstrapSubsetPort(); | |
| 392 #endif | 390 #endif |
| 393 | 391 |
| 394 Profiling::ProcessStarted(); | 392 Profiling::ProcessStarted(); |
| 395 | 393 |
| 396 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 394 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 397 std::string process_type = | 395 std::string process_type = |
| 398 command_line.GetSwitchValueASCII(switches::kProcessType); | 396 command_line.GetSwitchValueASCII(switches::kProcessType); |
| 399 | 397 |
| 400 #if defined(OS_POSIX) | 398 #if defined(OS_POSIX) |
| 401 if (HandleVersionSwitches(command_line)) { | 399 if (HandleVersionSwitches(command_line)) { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 | 672 |
| 675 NOTREACHED() << "Unknown process type: " << process_type; | 673 NOTREACHED() << "Unknown process type: " << process_type; |
| 676 return 1; | 674 return 1; |
| 677 } | 675 } |
| 678 | 676 |
| 679 virtual void ProcessExiting(const std::string& process_type) OVERRIDE { | 677 virtual void ProcessExiting(const std::string& process_type) OVERRIDE { |
| 680 if (SubprocessNeedsResourceBundle(process_type)) | 678 if (SubprocessNeedsResourceBundle(process_type)) |
| 681 ResourceBundle::CleanupSharedInstance(); | 679 ResourceBundle::CleanupSharedInstance(); |
| 682 | 680 |
| 683 logging::CleanupChromeLogging(); | 681 logging::CleanupChromeLogging(); |
| 682 |
| 683 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) |
| 684 // TODO(mark): See the TODO(mark) at InitCrashReporter. |
| 685 DestructCrashReporter(); |
| 686 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD |
| 684 } | 687 } |
| 685 | 688 |
| 686 #if defined(OS_MACOSX) | 689 #if defined(OS_MACOSX) |
| 687 virtual bool ProcessRegistersWithSystemProcess( | 690 virtual bool ProcessRegistersWithSystemProcess( |
| 688 const std::string& process_type) OVERRIDE { | 691 const std::string& process_type) OVERRIDE { |
| 689 return process_type == switches::kNaClLoaderProcess || | 692 return process_type == switches::kNaClLoaderProcess || |
| 690 process_type == switches::kExtensionProcess; | 693 process_type == switches::kExtensionProcess; |
| 691 } | 694 } |
| 692 | 695 |
| 693 virtual bool ShouldSendMachPort(const std::string& process_type) OVERRIDE { | 696 virtual bool ShouldSendMachPort(const std::string& process_type) OVERRIDE { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, | 748 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, |
| 746 sandbox::SandboxInterfaceInfo* sandbox_info) { | 749 sandbox::SandboxInterfaceInfo* sandbox_info) { |
| 747 ChromeMainDelegate chrome_main_delegate; | 750 ChromeMainDelegate chrome_main_delegate; |
| 748 return content::ContentMain(instance, sandbox_info, &chrome_main_delegate); | 751 return content::ContentMain(instance, sandbox_info, &chrome_main_delegate); |
| 749 #elif defined(OS_POSIX) | 752 #elif defined(OS_POSIX) |
| 750 int ChromeMain(int argc, const char** argv) { | 753 int ChromeMain(int argc, const char** argv) { |
| 751 ChromeMainDelegate chrome_main_delegate; | 754 ChromeMainDelegate chrome_main_delegate; |
| 752 return content::ContentMain(argc, argv, &chrome_main_delegate); | 755 return content::ContentMain(argc, argv, &chrome_main_delegate); |
| 753 #endif | 756 #endif |
| 754 } | 757 } |
| OLD | NEW |