diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-11 18:34:10 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-11 18:34:10 +0000 |
commit | 6b7a5e329b36cbda1f8e432fbc92cc7acb5ede4c (patch) | |
tree | 2599faa9f78691b9e5b353b178d8485a4f6fe320 | |
parent | baf405574a8a4f40dde15ac35ba4ad0cf34846cc (diff) | |
download | chromium_src-6b7a5e329b36cbda1f8e432fbc92cc7acb5ede4c.zip chromium_src-6b7a5e329b36cbda1f8e432fbc92cc7acb5ede4c.tar.gz chromium_src-6b7a5e329b36cbda1f8e432fbc92cc7acb5ede4c.tar.bz2 |
Move Linux sub process breakpad initialization to a common place.
Review URL: http://codereview.chromium.org/6667024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77834 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/chrome_main.cc | 9 | ||||
-rw-r--r-- | chrome/gpu/gpu_channel.cc | 3 | ||||
-rw-r--r-- | chrome/gpu/gpu_main.cc | 13 | ||||
-rw-r--r-- | chrome/gpu/gpu_thread.cc | 2 | ||||
-rw-r--r-- | chrome/nacl/nacl_main.cc | 9 | ||||
-rw-r--r-- | chrome/plugin/plugin_main.cc | 9 | ||||
-rw-r--r-- | chrome/renderer/renderer_main.cc | 9 |
7 files changed, 12 insertions, 42 deletions
diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc index 0156d2a..a1113b8 100644 --- a/chrome/app/chrome_main.cc +++ b/chrome/app/chrome_main.cc @@ -83,6 +83,10 @@ #include "ui/base/x/x11_util.h" #endif +#if defined(USE_LINUX_BREAKPAD) +#include "chrome/app/breakpad_linux.h" +#endif + extern int BrowserMain(const MainFunctionParams&); extern int RendererMain(const MainFunctionParams&); extern int GpuMain(const MainFunctionParams&); @@ -227,6 +231,11 @@ void CommonSubprocessInit() { // surface UI -- but it's likely they get this wrong too so why not. setlocale(LC_NUMERIC, "C"); #endif +#if defined(USE_LINUX_BREAKPAD) + // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets + // this up for the browser process in a different manner. + InitCrashReporter(); +#endif } // Returns true if this subprocess type needs the ResourceBundle initialized diff --git a/chrome/gpu/gpu_channel.cc b/chrome/gpu/gpu_channel.cc index ec8dec2..8b1e1d2 100644 --- a/chrome/gpu/gpu_channel.cc +++ b/chrome/gpu/gpu_channel.cc @@ -11,11 +11,10 @@ #include "base/command_line.h" #include "base/process_util.h" #include "base/string_util.h" -#include "chrome/common/chrome_constants.h" -#include "chrome/common/chrome_switches.h" #include "chrome/gpu/gpu_thread.h" #include "chrome/gpu/gpu_video_service.h" #include "content/common/child_process.h" +#include "content/common/content_switches.h" #include "content/common/gpu_messages.h" #if defined(OS_POSIX) diff --git a/chrome/gpu/gpu_main.cc b/chrome/gpu/gpu_main.cc index 1de26e0..a2b9e5f 100644 --- a/chrome/gpu/gpu_main.cc +++ b/chrome/gpu/gpu_main.cc @@ -14,18 +14,12 @@ #include "base/stringprintf.h" #include "base/threading/platform_thread.h" #include "build/build_config.h" -#include "chrome/common/chrome_constants.h" -#include "chrome/common/chrome_switches.h" -#include "chrome/common/env_vars.h" #include "chrome/common/main_function_params.h" +#include "content/common/content_switches.h" #include "chrome/gpu/gpu_config.h" #include "chrome/gpu/gpu_process.h" #include "chrome/gpu/gpu_thread.h" -#if defined(USE_LINUX_BREAKPAD) -#include "chrome/app/breakpad_linux.h" -#endif - #if defined(OS_MACOSX) #include "chrome/common/chrome_application_mac.h" #endif @@ -38,11 +32,6 @@ int GpuMain(const MainFunctionParams& parameters) { base::Time start_time = base::Time::Now(); -#if defined(USE_LINUX_BREAKPAD) - // Needs to be called after we have chrome::DIR_USER_DATA. - InitCrashReporter(); -#endif - const CommandLine& command_line = parameters.command_line_; if (command_line.HasSwitch(switches::kGpuStartupDialog)) { ChildProcess::WaitForDebugger("Gpu"); diff --git a/chrome/gpu/gpu_thread.cc b/chrome/gpu/gpu_thread.cc index ecc046a..11ff453 100644 --- a/chrome/gpu/gpu_thread.cc +++ b/chrome/gpu/gpu_thread.cc @@ -13,11 +13,11 @@ #include "base/command_line.h" #include "base/threading/worker_pool.h" #include "build/build_config.h" -#include "chrome/common/chrome_switches.h" #include "chrome/gpu/gpu_info_collector.h" #include "chrome/gpu/gpu_watchdog_thread.h" #include "content/common/child_process.h" #include "content/common/content_client.h" +#include "content/common/content_switches.h" #include "content/common/gpu_messages.h" #include "ipc/ipc_channel_handle.h" diff --git a/chrome/nacl/nacl_main.cc b/chrome/nacl/nacl_main.cc index 20ea0c8..11194d9 100644 --- a/chrome/nacl/nacl_main.cc +++ b/chrome/nacl/nacl_main.cc @@ -11,11 +11,6 @@ #include "base/command_line.h" #include "base/message_loop.h" #include "base/string_util.h" - -#if defined(USE_LINUX_BREAKPAD) -#include "chrome/app/breakpad_linux.h" -#endif - #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/hi_res_timer_manager.h" @@ -95,10 +90,6 @@ static void HandleNaClTestParameters(const CommandLine& command_line) { // main() routine for the NaCl loader process. int NaClMain(const MainFunctionParams& parameters) { -#if defined(USE_LINUX_BREAKPAD) - // Needs to be called after we have chrome::DIR_USER_DATA. - InitCrashReporter(); -#endif const CommandLine& parsed_command_line = parameters.command_line_; // This function allows pausing execution using the --nacl-startup-dialog diff --git a/chrome/plugin/plugin_main.cc b/chrome/plugin/plugin_main.cc index 0d6086e..fa45585 100644 --- a/chrome/plugin/plugin_main.cc +++ b/chrome/plugin/plugin_main.cc @@ -31,10 +31,6 @@ #include "ipc/ipc_descriptors.h" #endif -#if defined(USE_LINUX_BREAKPAD) -#include "chrome/app/breakpad_linux.h" -#endif - #if defined(OS_MACOSX) // Removes our Carbon library interposing from the environment so that it // doesn't carry into any processes that plugins might start. @@ -83,11 +79,6 @@ int PreloadIMEForFlash() { // main() routine for running as the plugin process. int PluginMain(const MainFunctionParams& parameters) { -#if defined(USE_LINUX_BREAKPAD) - // Needs to be called after we have chrome::DIR_USER_DATA. - InitCrashReporter(); -#endif - // The main thread of the plugin services UI. #if defined(OS_MACOSX) #if !defined(__LP64__) diff --git a/chrome/renderer/renderer_main.cc b/chrome/renderer/renderer_main.cc index 5a85280..7ac5760 100644 --- a/chrome/renderer/renderer_main.cc +++ b/chrome/renderer/renderer_main.cc @@ -43,10 +43,6 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" #endif // OS_MACOSX -#if defined(USE_LINUX_BREAKPAD) -#include "chrome/app/breakpad_linux.h" -#endif - #if defined(OS_MACOSX) namespace { @@ -212,11 +208,6 @@ int RendererMain(const MainFunctionParams& parameters) { CHECK(sigaction(SIGTERM, &action, NULL) == 0); #endif // OS_MACOSX -#if defined(USE_LINUX_BREAKPAD) - // Needs to be called after we have chrome::DIR_USER_DATA. - InitCrashReporter(); -#endif - #if defined(OS_CHROMEOS) // As Zygote process starts up earlier than browser process gets its own // locale (at login time for Chrome OS), we have to set the ICU default |