| 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(); |
| 390 #endif | 392 #endif |
| 391 | 393 |
| 392 Profiling::ProcessStarted(); | 394 Profiling::ProcessStarted(); |
| 393 | 395 |
| 394 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 396 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 395 std::string process_type = | 397 std::string process_type = |
| 396 command_line.GetSwitchValueASCII(switches::kProcessType); | 398 command_line.GetSwitchValueASCII(switches::kProcessType); |
| 397 | 399 |
| 398 #if defined(OS_POSIX) | 400 #if defined(OS_POSIX) |
| 399 if (HandleVersionSwitches(command_line)) { | 401 if (HandleVersionSwitches(command_line)) { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 | 674 |
| 673 NOTREACHED() << "Unknown process type: " << process_type; | 675 NOTREACHED() << "Unknown process type: " << process_type; |
| 674 return 1; | 676 return 1; |
| 675 } | 677 } |
| 676 | 678 |
| 677 virtual void ProcessExiting(const std::string& process_type) OVERRIDE { | 679 virtual void ProcessExiting(const std::string& process_type) OVERRIDE { |
| 678 if (SubprocessNeedsResourceBundle(process_type)) | 680 if (SubprocessNeedsResourceBundle(process_type)) |
| 679 ResourceBundle::CleanupSharedInstance(); | 681 ResourceBundle::CleanupSharedInstance(); |
| 680 | 682 |
| 681 logging::CleanupChromeLogging(); | 683 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 | |
| 687 } | 684 } |
| 688 | 685 |
| 689 #if defined(OS_MACOSX) | 686 #if defined(OS_MACOSX) |
| 690 virtual bool ProcessRegistersWithSystemProcess( | 687 virtual bool ProcessRegistersWithSystemProcess( |
| 691 const std::string& process_type) OVERRIDE { | 688 const std::string& process_type) OVERRIDE { |
| 692 return process_type == switches::kNaClLoaderProcess || | 689 return process_type == switches::kNaClLoaderProcess || |
| 693 process_type == switches::kExtensionProcess; | 690 process_type == switches::kExtensionProcess; |
| 694 } | 691 } |
| 695 | 692 |
| 696 virtual bool ShouldSendMachPort(const std::string& process_type) OVERRIDE { | 693 virtual bool ShouldSendMachPort(const std::string& process_type) OVERRIDE { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, | 745 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, |
| 749 sandbox::SandboxInterfaceInfo* sandbox_info) { | 746 sandbox::SandboxInterfaceInfo* sandbox_info) { |
| 750 ChromeMainDelegate chrome_main_delegate; | 747 ChromeMainDelegate chrome_main_delegate; |
| 751 return content::ContentMain(instance, sandbox_info, &chrome_main_delegate); | 748 return content::ContentMain(instance, sandbox_info, &chrome_main_delegate); |
| 752 #elif defined(OS_POSIX) | 749 #elif defined(OS_POSIX) |
| 753 int ChromeMain(int argc, const char** argv) { | 750 int ChromeMain(int argc, const char** argv) { |
| 754 ChromeMainDelegate chrome_main_delegate; | 751 ChromeMainDelegate chrome_main_delegate; |
| 755 return content::ContentMain(argc, argv, &chrome_main_delegate); | 752 return content::ContentMain(argc, argv, &chrome_main_delegate); |
| 756 #endif | 753 #endif |
| 757 } | 754 } |
| OLD | NEW |