| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #endif | 52 #endif |
| 53 | 53 |
| 54 #if defined(OS_MACOSX) | 54 #if defined(OS_MACOSX) |
| 55 #include "base/mac/mac_util.h" | 55 #include "base/mac/mac_util.h" |
| 56 #include "base/mac/os_crash_dumps.h" | 56 #include "base/mac/os_crash_dumps.h" |
| 57 #include "chrome/app/chrome_main_mac.h" | 57 #include "chrome/app/chrome_main_mac.h" |
| 58 #include "chrome/browser/mac/relauncher.h" | 58 #include "chrome/browser/mac/relauncher.h" |
| 59 #include "chrome/common/chrome_paths_internal.h" | 59 #include "chrome/common/chrome_paths_internal.h" |
| 60 #include "chrome/common/mac/cfbundle_blocker.h" | 60 #include "chrome/common/mac/cfbundle_blocker.h" |
| 61 #include "chrome/common/mac/objc_zombie.h" | 61 #include "chrome/common/mac/objc_zombie.h" |
| 62 #include "components/breakpad/breakpad_mac.h" | 62 #include "components/breakpad/app/breakpad_mac.h" |
| 63 #include "grit/chromium_strings.h" | 63 #include "grit/chromium_strings.h" |
| 64 #include "ui/base/l10n/l10n_util_mac.h" | 64 #include "ui/base/l10n/l10n_util_mac.h" |
| 65 #endif | 65 #endif |
| 66 | 66 |
| 67 #if defined(OS_POSIX) | 67 #if defined(OS_POSIX) |
| 68 #include <locale.h> | 68 #include <locale.h> |
| 69 #include <signal.h> | 69 #include <signal.h> |
| 70 #include "chrome/app/chrome_breakpad_client.h" | 70 #include "chrome/app/chrome_breakpad_client.h" |
| 71 #include "components/breakpad/breakpad_client.h" | 71 #include "components/breakpad/app/breakpad_client.h" |
| 72 #endif | 72 #endif |
| 73 | 73 |
| 74 #if !defined(DISABLE_NACL) && defined(OS_LINUX) | 74 #if !defined(DISABLE_NACL) && defined(OS_LINUX) |
| 75 #include "components/nacl/common/nacl_paths.h" | 75 #include "components/nacl/common/nacl_paths.h" |
| 76 #include "components/nacl/zygote/nacl_fork_delegate_linux.h" | 76 #include "components/nacl/zygote/nacl_fork_delegate_linux.h" |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 #if defined(OS_CHROMEOS) | 79 #if defined(OS_CHROMEOS) |
| 80 #include "base/sys_info.h" | 80 #include "base/sys_info.h" |
| 81 #include "chrome/browser/chromeos/boot_times_loader.h" | 81 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 82 #include "chromeos/chromeos_paths.h" | 82 #include "chromeos/chromeos_paths.h" |
| 83 #include "chromeos/chromeos_switches.h" | 83 #include "chromeos/chromeos_switches.h" |
| 84 #endif | 84 #endif |
| 85 | 85 |
| 86 #if defined(OS_ANDROID) | 86 #if defined(OS_ANDROID) |
| 87 #include "chrome/common/descriptors_android.h" | 87 #include "chrome/common/descriptors_android.h" |
| 88 #else | 88 #else |
| 89 // Diagnostics is only available on non-android platforms. | 89 // Diagnostics is only available on non-android platforms. |
| 90 #include "chrome/browser/diagnostics/diagnostics_controller.h" | 90 #include "chrome/browser/diagnostics/diagnostics_controller.h" |
| 91 #include "chrome/browser/diagnostics/diagnostics_writer.h" | 91 #include "chrome/browser/diagnostics/diagnostics_writer.h" |
| 92 #endif | 92 #endif |
| 93 | 93 |
| 94 #if defined(USE_X11) | 94 #if defined(USE_X11) |
| 95 #include <stdlib.h> | 95 #include <stdlib.h> |
| 96 #include <string.h> | 96 #include <string.h> |
| 97 #include "ui/base/x/x11_util.h" | 97 #include "ui/base/x/x11_util.h" |
| 98 #endif | 98 #endif |
| 99 | 99 |
| 100 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 100 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 101 #include "chrome/app/breakpad_linux.h" | 101 #include "components/breakpad/app/breakpad_linux.h" |
| 102 #endif | 102 #endif |
| 103 | 103 |
| 104 #if !defined(CHROME_MULTIPLE_DLL_CHILD) | 104 #if !defined(CHROME_MULTIPLE_DLL_CHILD) |
| 105 base::LazyInstance<chrome::ChromeContentBrowserClient> | 105 base::LazyInstance<chrome::ChromeContentBrowserClient> |
| 106 g_chrome_content_browser_client = LAZY_INSTANCE_INITIALIZER; | 106 g_chrome_content_browser_client = LAZY_INSTANCE_INITIALIZER; |
| 107 #endif | 107 #endif |
| 108 | 108 |
| 109 #if !defined(CHROME_MULTIPLE_DLL_BROWSER) | 109 #if !defined(CHROME_MULTIPLE_DLL_BROWSER) |
| 110 base::LazyInstance<chrome::ChromeContentRendererClient> | 110 base::LazyInstance<chrome::ChromeContentRendererClient> |
| 111 g_chrome_content_renderer_client = LAZY_INSTANCE_INITIALIZER; | 111 g_chrome_content_renderer_client = LAZY_INSTANCE_INITIALIZER; |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 chrome::ChromeContentUtilityClient::PreSandboxStartup(); | 732 chrome::ChromeContentUtilityClient::PreSandboxStartup(); |
| 733 #endif | 733 #endif |
| 734 } | 734 } |
| 735 | 735 |
| 736 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 736 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 737 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain | 737 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain |
| 738 // sets this up for the browser process in a different manner. Zygotes | 738 // sets this up for the browser process in a different manner. Zygotes |
| 739 // need to call InitCrashReporter() in RunZygote(). | 739 // need to call InitCrashReporter() in RunZygote(). |
| 740 if (!process_type.empty() && process_type != switches::kZygoteProcess) { | 740 if (!process_type.empty() && process_type != switches::kZygoteProcess) { |
| 741 #if defined(OS_ANDROID) | 741 #if defined(OS_ANDROID) |
| 742 InitNonBrowserCrashReporterForAndroid(); | 742 breakpad::InitNonBrowserCrashReporterForAndroid(); |
| 743 #else | 743 #else |
| 744 InitCrashReporter(); | 744 breakpad::InitCrashReporter(); |
| 745 #endif | 745 #endif |
| 746 } | 746 } |
| 747 #endif | 747 #endif |
| 748 | 748 |
| 749 // After all the platform Breakpads have been initialized, store the command | 749 // After all the platform Breakpads have been initialized, store the command |
| 750 // line for crash reporting. | 750 // line for crash reporting. |
| 751 crash_keys::SetSwitchesFromCommandLine(&command_line); | 751 crash_keys::SetSwitchesFromCommandLine(&command_line); |
| 752 } | 752 } |
| 753 | 753 |
| 754 void ChromeMainDelegate::SandboxInitialized(const std::string& process_type) { | 754 void ChromeMainDelegate::SandboxInitialized(const std::string& process_type) { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 void ChromeMainDelegate::ZygoteForked() { | 838 void ChromeMainDelegate::ZygoteForked() { |
| 839 Profiling::ProcessStarted(); | 839 Profiling::ProcessStarted(); |
| 840 if (Profiling::BeingProfiled()) { | 840 if (Profiling::BeingProfiled()) { |
| 841 base::debug::RestartProfilingAfterFork(); | 841 base::debug::RestartProfilingAfterFork(); |
| 842 SetUpProfilingShutdownHandler(); | 842 SetUpProfilingShutdownHandler(); |
| 843 } | 843 } |
| 844 | 844 |
| 845 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 845 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 846 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets | 846 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets |
| 847 // this up for the browser process in a different manner. | 847 // this up for the browser process in a different manner. |
| 848 InitCrashReporter(); | 848 breakpad::InitCrashReporter(); |
| 849 | 849 |
| 850 // Reset the command line for the newly spawned process. | 850 // Reset the command line for the newly spawned process. |
| 851 crash_keys::SetSwitchesFromCommandLine(CommandLine::ForCurrentProcess()); | 851 crash_keys::SetSwitchesFromCommandLine(CommandLine::ForCurrentProcess()); |
| 852 #endif | 852 #endif |
| 853 } | 853 } |
| 854 | 854 |
| 855 #endif // OS_MACOSX | 855 #endif // OS_MACOSX |
| 856 | 856 |
| 857 content::ContentBrowserClient* | 857 content::ContentBrowserClient* |
| 858 ChromeMainDelegate::CreateContentBrowserClient() { | 858 ChromeMainDelegate::CreateContentBrowserClient() { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 881 } | 881 } |
| 882 | 882 |
| 883 content::ContentUtilityClient* | 883 content::ContentUtilityClient* |
| 884 ChromeMainDelegate::CreateContentUtilityClient() { | 884 ChromeMainDelegate::CreateContentUtilityClient() { |
| 885 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 885 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
| 886 return NULL; | 886 return NULL; |
| 887 #else | 887 #else |
| 888 return &g_chrome_content_utility_client.Get(); | 888 return &g_chrome_content_utility_client.Get(); |
| 889 #endif | 889 #endif |
| 890 } | 890 } |
| OLD | NEW |