Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Unified Diff: chrome/browser/renderer_host/render_crash_handler_host_linux.cc

Issue 173397: Allow Chromium Linux to be built with Breakpad. Enable Linux CHROME_HEADLESS ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/render_crash_handler_host_linux.cc
===================================================================
--- chrome/browser/renderer_host/render_crash_handler_host_linux.cc (revision 24255)
+++ chrome/browser/renderer_host/render_crash_handler_host_linux.cc (working copy)
@@ -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 @@
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 @@
info.guid_length = strlen(guid);
info.distro = distro;
info.distro_length = strlen(distro);
- UploadCrashDump(info);
+ info.upload = upload;
+ HandleCrashDump(info);
}
void RenderCrashHandlerHostLinux::WillDestroyCurrentMessageLoop() {

Powered by Google App Engine
This is Rietveld 408576698