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

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: nits 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
« no previous file with comments | « chrome/app/breakpad_linux.h ('k') | chrome/app/chrome_main_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/breakpad_linux.cc
diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc
index b4cca7b39e55d6d8e698edb2da009896635e128c..064399313c211841a69d9cd8dfa72c71b7d429a2 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"
@@ -1468,10 +1470,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
« no previous file with comments | « chrome/app/breakpad_linux.h ('k') | chrome/app/chrome_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698