OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
281 void HandleHelpSwitches(const CommandLine& command_line) { | 281 void HandleHelpSwitches(const CommandLine& command_line) { |
282 if (command_line.HasSwitch(switches::kHelp) || | 282 if (command_line.HasSwitch(switches::kHelp) || |
283 command_line.HasSwitch(switches::kHelpShort)) { | 283 command_line.HasSwitch(switches::kHelpShort)) { |
284 base::FilePath binary(command_line.argv()[0]); | 284 base::FilePath binary(command_line.argv()[0]); |
285 execlp("man", "man", binary.BaseName().value().c_str(), NULL); | 285 execlp("man", "man", binary.BaseName().value().c_str(), NULL); |
286 PLOG(FATAL) << "execlp failed"; | 286 PLOG(FATAL) << "execlp failed"; |
287 } | 287 } |
288 } | 288 } |
289 #endif | 289 #endif |
290 | 290 |
291 #if !defined(OS_MACOSX) | 291 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
292 void SIGTERMProfilingShutdown(int signal) { | 292 void SIGTERMProfilingShutdown(int signal) { |
293 Profiling::Stop(); | 293 Profiling::Stop(); |
294 struct sigaction sigact; | 294 struct sigaction sigact; |
295 memset(&sigact, 0, sizeof(sigact)); | 295 memset(&sigact, 0, sizeof(sigact)); |
296 sigact.sa_handler = SIG_DFL; | 296 sigact.sa_handler = SIG_DFL; |
297 CHECK(sigaction(SIGTERM, &sigact, NULL) == 0); | 297 CHECK(sigaction(SIGTERM, &sigact, NULL) == 0); |
298 raise(signal); | 298 raise(signal); |
299 } | 299 } |
300 | 300 |
301 void SetUpProfilingShutdownHandler() { | 301 void SetUpProfilingShutdownHandler() { |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
807 #endif | 807 #endif |
808 } | 808 } |
809 | 809 |
810 void ChromeMainDelegate::ZygoteForked() { | 810 void ChromeMainDelegate::ZygoteForked() { |
811 Profiling::ProcessStarted(); | 811 Profiling::ProcessStarted(); |
812 if (Profiling::BeingProfiled()) { | 812 if (Profiling::BeingProfiled()) { |
813 base::debug::RestartProfilingAfterFork(); | 813 base::debug::RestartProfilingAfterFork(); |
814 SetUpProfilingShutdownHandler(); | 814 SetUpProfilingShutdownHandler(); |
815 } | 815 } |
816 | 816 |
817 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 817 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
Nico
2013/11/10 05:07:09
This ifdef can go away – OS_POSIX is always true h
hans
2013/11/11 19:29:51
Done.
| |
818 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets | 818 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets |
819 // this up for the browser process in a different manner. | 819 // this up for the browser process in a different manner. |
820 breakpad::InitCrashReporter(); | 820 breakpad::InitCrashReporter(); |
821 | 821 |
822 // Reset the command line for the newly spawned process. | 822 // Reset the command line for the newly spawned process. |
823 crash_keys::SetSwitchesFromCommandLine(CommandLine::ForCurrentProcess()); | 823 crash_keys::SetSwitchesFromCommandLine(CommandLine::ForCurrentProcess()); |
824 #endif | 824 #endif |
825 } | 825 } |
826 | 826 |
827 #endif // OS_MACOSX | 827 #endif // OS_MACOSX |
(...skipping 25 matching lines...) Expand all Loading... | |
853 } | 853 } |
854 | 854 |
855 content::ContentUtilityClient* | 855 content::ContentUtilityClient* |
856 ChromeMainDelegate::CreateContentUtilityClient() { | 856 ChromeMainDelegate::CreateContentUtilityClient() { |
857 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 857 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
858 return NULL; | 858 return NULL; |
859 #else | 859 #else |
860 return &g_chrome_content_utility_client.Get(); | 860 return &g_chrome_content_utility_client.Get(); |
861 #endif | 861 #endif |
862 } | 862 } |
OLD | NEW |