summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-25 07:25:06 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-25 07:25:06 +0000
commitd0ea9a67eec3137940326bac3de97d4dfa459a08 (patch)
treeed0aa06fe980c5f9261f178964c8223bc003b403 /chrome/browser
parentb0d3f08961d7bb2e17df4683b7dfbce9a6ece4ee (diff)
downloadchromium_src-d0ea9a67eec3137940326bac3de97d4dfa459a08.zip
chromium_src-d0ea9a67eec3137940326bac3de97d4dfa459a08.tar.gz
chromium_src-d0ea9a67eec3137940326bac3de97d4dfa459a08.tar.bz2
Allow Chromium Linux to be built with Breakpad. Enable Linux CHROME_HEADLESS support.
TEST=none BUG=19663 Review URL: http://codereview.chromium.org/173095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24220 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/renderer_host/render_crash_handler_host_linux.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/chrome/browser/renderer_host/render_crash_handler_host_linux.cc b/chrome/browser/renderer_host/render_crash_handler_host_linux.cc
index 5c99e5f..ec83663 100644
--- a/chrome/browser/renderer_host/render_crash_handler_host_linux.cc
+++ b/chrome/browser/renderer_host/render_crash_handler_host_linux.cc
@@ -10,15 +10,18 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/uio.h>
+#include <stdlib.h>
#include <unistd.h>
#include <string>
#include <vector>
#include "base/eintr_wrapper.h"
+#include "base/file_path.h"
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/message_loop.h"
+#include "base/path_service.h"
#include "base/rand_util.h"
#include "base/string_util.h"
#include "breakpad/linux/exception_handler.h"
@@ -26,6 +29,7 @@
#include "breakpad/linux/minidump_writer.h"
#include "chrome/app/breakpad_linux.h"
#include "chrome/browser/chrome_thread.h"
+#include "chrome/common/chrome_paths.h"
// expected prefix of the target of the /proc/self/fd/%d link for a socket
static const char kSocketLinkPrefix[] = "socket:[";
@@ -303,9 +307,16 @@ void RenderCrashHandlerHostLinux::OnFileCanReadWithoutBlocking(int fd) {
return;
}
+ bool upload = true;
+ FilePath dumps_path("/tmp");
+ if (getenv("CHROME_HEADLESS")) {
+ upload = false;
+ PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path);
+ }
const uint64 rand = base::RandUint64();
const std::string minidump_filename =
- StringPrintf("/tmp/chromium-renderer-minidump-%016" PRIx64 ".dmp", rand);
+ StringPrintf("%s/chromium-renderer-minidump-%016" PRIx64 ".dmp",
+ dumps_path.value().c_str(), rand);
if (!google_breakpad::WriteMinidump(minidump_filename.c_str(),
crashing_pid, crash_context,
kCrashContextSize)) {
@@ -334,7 +345,8 @@ void RenderCrashHandlerHostLinux::OnFileCanReadWithoutBlocking(int fd) {
info.guid_length = strlen(guid);
info.distro = distro;
info.distro_length = strlen(distro);
- UploadCrashDump(info);
+ info.upload = upload;
+ HandleCrashDump(info);
}
void RenderCrashHandlerHostLinux::WillDestroyCurrentMessageLoop() {