summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-23 18:29:11 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-23 18:29:11 +0000
commitee052b86770a2d1d269502dd6c903276024e7826 (patch)
treee01b2e23116a733fb7b95130ae74b1abc60e6e84
parent3ae83989fbb4bc835109d709c4e71650f0788a14 (diff)
downloadchromium_src-ee052b86770a2d1d269502dd6c903276024e7826.zip
chromium_src-ee052b86770a2d1d269502dd6c903276024e7826.tar.gz
chromium_src-ee052b86770a2d1d269502dd6c903276024e7826.tar.bz2
Linux: fix crash reporting for zygote model
Crash reporting broke on Linux when we enabled the zygote model a couple of weeks ago. We can't just add "zygote" to the check for the process type because the crash signal fd is set at the same time and that will change when a renderer is forked from the zygote. This fixes it for now, but it will need to be redone when we enable sandboxing. http://codereview.chromium.org/147004 BUG=14969 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19035 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/breakpad_linux.cc6
-rw-r--r--chrome/app/chrome_dll_main.cc7
-rw-r--r--chrome/browser/browser_main.cc5
-rw-r--r--chrome/renderer/renderer_main.cc9
4 files changed, 18 insertions, 9 deletions
diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc
index 2b293be..588118a 100644
--- a/chrome/app/breakpad_linux.cc
+++ b/chrome/app/breakpad_linux.cc
@@ -518,8 +518,10 @@ void InitCrashReporter() {
const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
const std::wstring process_type =
parsed_command_line.GetSwitchValue(switches::kProcessType);
- if (process_type.empty())
+ if (process_type.empty()) {
EnableCrashDumping();
- else if (process_type == switches::kRendererProcess)
+ } else if (process_type == switches::kRendererProcess ||
+ process_type == switches::kZygoteProcess) {
EnableRendererCrashDumping();
+ }
}
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index 0703fc3..de4d822 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -50,8 +50,6 @@
#endif
#if defined(OS_MACOSX)
#include "chrome/app/breakpad_mac.h"
-#elif defined(OS_LINUX)
-#include "chrome/app/breakpad_linux.h"
#endif
#include "chrome/app/scoped_ole_initializer.h"
#include "chrome/browser/renderer_host/render_process_host.h"
@@ -420,11 +418,6 @@ int ChromeMain(int argc, const char** argv) {
if (!user_data_dir.empty())
CHECK(PathService::Override(chrome::DIR_USER_DATA, user_data_dir));
-#if defined(OS_LINUX)
- // Needs to be called after we have chrome::DIR_USER_DATA.
- InitCrashReporter();
-#endif
-
bool single_process =
#if defined (GOOGLE_CHROME_BUILD)
// This is an unsupported and not fully tested mode, so don't enable it for
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 675e363..38842da 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -248,6 +248,11 @@ int BrowserMain(const MainFunctionParams& parameters) {
const CommandLine& parsed_command_line = parameters.command_line_;
base::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_;
+#if defined(OS_LINUX)
+ // Needs to be called after we have chrome::DIR_USER_DATA.
+ InitCrashReporter();
+#endif
+
// WARNING: If we get a WM_ENDSESSION objects created on the stack here
// are NOT deleted. If you need something to run during WM_ENDSESSION add it
// to browser_shutdown::Shutdown or BrowserProcess::EndSession.
diff --git a/chrome/renderer/renderer_main.cc b/chrome/renderer/renderer_main.cc
index 03e731f..55ca339 100644
--- a/chrome/renderer/renderer_main.cc
+++ b/chrome/renderer/renderer_main.cc
@@ -25,6 +25,10 @@
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
+#if defined(OS_LINUX)
+#include "chrome/app/breakpad_linux.h"
+#endif
+
// This function provides some ways to test crash and assertion handling
// behavior of the renderer.
static void HandleRendererErrorTestParameters(const CommandLine& command_line) {
@@ -64,6 +68,11 @@ int RendererMain(const MainFunctionParams& parameters) {
const CommandLine& parsed_command_line = parameters.command_line_;
base::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_;
+#if defined(OS_LINUX)
+ // Needs to be called after we have chrome::DIR_USER_DATA.
+ InitCrashReporter();
+#endif
+
// This function allows pausing execution using the --renderer-startup-dialog
// flag allowing us to attach a debugger.
// Do not move this function down since that would mean we can't easily debug