diff options
author | yfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-22 21:53:43 +0000 |
---|---|---|
committer | yfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-22 21:53:43 +0000 |
commit | 82174aa4938e03fbb38098d2cf283cbf09bfb300 (patch) | |
tree | 81702cf79b137684475ee3a25565aaacad3a59ca /chrome/app/breakpad_linux.cc | |
parent | ca8f905b9e13d9698d5f6c38b805e1c390578c9d (diff) | |
download | chromium_src-82174aa4938e03fbb38098d2cf283cbf09bfb300.zip chromium_src-82174aa4938e03fbb38098d2cf283cbf09bfb300.tar.gz chromium_src-82174aa4938e03fbb38098d2cf283cbf09bfb300.tar.bz2 |
Enable breakpad building by default on Android.
After https://chromiumcodereview.appspot.com/10407058 we can compile
breakpad by default and still have it disabled for non-official builds.
Changes the Android build to allow compiling breakpad but not use
it by not creating the crash fd and not passing it to the renderer
process unless breakpad is enabled.
Changes linux and Android to use a switch for enabling breakpad
since that's a lot easier to test with on android then an environment
variable.
BUG=105778,170530
Review URL: https://chromiumcodereview.appspot.com/11969025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178111 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/breakpad_linux.cc')
-rw-r--r-- | chrome/app/breakpad_linux.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc index b4cca7b..0643993 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 |