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

Unified Diff: chrome/app/breakpad_linux.cc

Issue 11969025: Enable breakpad building by default on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix assuming linux_breakpad->on Created 7 years, 11 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/app/breakpad_linux.cc
diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc
index 07e1511cfbbc9808abb84ee07a29899757fe586c..50eb46d08c4741bf609df8041f9c3826ae8e9244 100644
--- a/chrome/app/breakpad_linux.cc
+++ b/chrome/app/breakpad_linux.cc
@@ -27,6 +27,7 @@
#include "base/file_path.h"
#include "base/linux_util.h"
#include "base/path_service.h"
+#include "base/platform_file.h"
#include "base/posix/eintr_wrapper.h"
#include "base/posix/global_descriptors.h"
#include "base/process_util.h"
@@ -50,6 +51,7 @@
#include "base/android/build_info.h"
#include "base/android/path_utils.h"
+#include "chrome/common/descriptors_android.h"
#include "third_party/lss/linux_syscall_support.h"
#else
#include "sandbox/linux/seccomp-legacy/linux_syscall_support.h"
@@ -1457,10 +1459,20 @@ void InitCrashReporter() {
}
#if defined(OS_ANDROID)
-void InitNonBrowserCrashReporterForAndroid(int minidump_fd) {
+void InitNonBrowserCrashReporterForAndroid() {
const CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kEnableCrashReporter))
- EnableNonBrowserCrashDumping(minidump_fd);
+ if (command_line->HasSwitch(switches::kEnableCrashReporter)) {
+ // On Android we need to provide a FD to the file where the minidump is
+ // generated as the renderer and browser run with different UIDs
+ // (preventing the browser from inspecting the renderer process).
+ int minidump_fd = base::GlobalDescriptors::GetInstance()->
+ MaybeGet(kAndroidMinidumpDescriptor);
+ if (minidump_fd == base::kInvalidPlatformFileValue) {
+ NOTREACHED() << "Could not find minidump FD, crash reporting disabled.";
+ } else {
+ EnableNonBrowserCrashDumping(minidump_fd);
+ }
+ }
}
#endif // OS_ANDROID

Powered by Google App Engine
This is Rietveld 408576698