summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorcarlosvaldivia@google.com <carlosvaldivia@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-10 18:34:44 +0000
committercarlosvaldivia@google.com <carlosvaldivia@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-10 18:34:44 +0000
commit01e77f96bbd03a13876ae6fb2cf684198d858094 (patch)
tree216b6a1f92975d90917ec51eef855733300001c4 /chrome/browser
parentea1be09912afaa22f7a31a0c08a3e99d8ad70147 (diff)
downloadchromium_src-01e77f96bbd03a13876ae6fb2cf684198d858094.zip
chromium_src-01e77f96bbd03a13876ae6fb2cf684198d858094.tar.gz
chromium_src-01e77f96bbd03a13876ae6fb2cf684198d858094.tar.bz2
Upstream Android native crash handling changes.
This is actulaly the second time. Revert "Revert 131404 - Upstream native crash handling changes for Android." This reverts commit 421df96aab6267e963ddff16c9f738aa903a2cba. Conflicts: chrome/browser/chrome_browser_main.cc BUG= TEST= Review URL: http://codereview.chromium.org/9967017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131593 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/chrome_browser_main_linux.cc2
-rw-r--r--chrome/browser/chrome_browser_main_x11.cc4
-rw-r--r--chrome/browser/chrome_content_browser_client.cc10
-rw-r--r--chrome/browser/chromeos/login/wizard_controller.cc2
-rw-r--r--chrome/browser/crash_handler_host_linuxish.cc (renamed from chrome/browser/crash_handler_host_linux.cc)17
-rw-r--r--chrome/browser/crash_handler_host_linuxish.h (renamed from chrome/browser/crash_handler_host_linux.h)16
-rw-r--r--chrome/browser/crash_handler_host_linuxish_stub.cc (renamed from chrome/browser/crash_handler_host_linux_stub.cc)4
-rw-r--r--chrome/browser/ui/gtk/first_run_dialog.cc2
8 files changed, 31 insertions, 26 deletions
diff --git a/chrome/browser/chrome_browser_main_linux.cc b/chrome/browser/chrome_browser_main_linux.cc
index 2ba1b41..1354ffb 100644
--- a/chrome/browser/chrome_browser_main_linux.cc
+++ b/chrome/browser/chrome_browser_main_linux.cc
@@ -8,7 +8,7 @@
#include <stdlib.h>
#include "base/linux_util.h"
-#include "chrome/app/breakpad_linux.h"
+#include "chrome/app/breakpad_linuxish.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/env_vars.h"
#include "chrome/common/pref_names.h"
diff --git a/chrome/browser/chrome_browser_main_x11.cc b/chrome/browser/chrome_browser_main_x11.cc
index 55968ca..fbd832f 100644
--- a/chrome/browser/chrome_browser_main_x11.cc
+++ b/chrome/browser/chrome_browser_main_x11.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -15,7 +15,7 @@
#include "ui/base/x/x11_util_internal.h"
#if defined(USE_LINUX_BREAKPAD)
-#include "chrome/app/breakpad_linux.h"
+#include "chrome/app/breakpad_linuxish.h"
#endif
using content::BrowserThread;
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index d6c8557..b11823e 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -135,9 +135,9 @@
#include "chrome/browser/chrome_browser_main_extra_parts_ash.h"
#endif
-#if defined(OS_LINUX) || defined(OS_OPENBSD)
+#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_ANDROID)
#include "base/linux_util.h"
-#include "chrome/browser/crash_handler_host_linux.h"
+#include "chrome/browser/crash_handler_host_linuxish.h"
#endif
#if defined(TOOLKIT_GTK)
@@ -1611,11 +1611,6 @@ bool ChromeContentBrowserClient::AllowSocketAPI(
#if defined(OS_POSIX) && !defined(OS_MACOSX)
int ChromeContentBrowserClient::GetCrashSignalFD(
const CommandLine& command_line) {
-#if defined(OS_ANDROID)
- // TODO(carlosvaldivia): Upstream breakpad code for Android and remove this
- // fork. http://crbug.com/113560
- NOTIMPLEMENTED();
-#else
if (command_line.HasSwitch(switches::kExtensionProcess)) {
ExtensionCrashHandlerHostLinux* crash_handler =
ExtensionCrashHandlerHostLinux::GetInstance();
@@ -1636,7 +1631,6 @@ int ChromeContentBrowserClient::GetCrashSignalFD(
if (process_type == switches::kGpuProcess)
return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket();
-#endif // defined(OS_ANDROID)
return -1;
}
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc
index d308b30..075e016 100644
--- a/chrome/browser/chromeos/login/wizard_controller.cc
+++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -50,7 +50,7 @@
#include "ui/base/l10n/l10n_util.h"
#if defined(USE_LINUX_BREAKPAD)
-#include "chrome/app/breakpad_linux.h"
+#include "chrome/app/breakpad_linuxish.h"
#endif
using content::BrowserThread;
diff --git a/chrome/browser/crash_handler_host_linux.cc b/chrome/browser/crash_handler_host_linuxish.cc
index c385406..8b393fe 100644
--- a/chrome/browser/crash_handler_host_linux.cc
+++ b/chrome/browser/crash_handler_host_linuxish.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/crash_handler_host_linux.h"
+#include "chrome/browser/crash_handler_host_linuxish.h"
#include <stdint.h>
#include <stdlib.h>
@@ -27,11 +27,17 @@
#include "breakpad/src/client/linux/handler/exception_handler.h"
#include "breakpad/src/client/linux/minidump_writer/linux_dumper.h"
#include "breakpad/src/client/linux/minidump_writer/minidump_writer.h"
-#include "chrome/app/breakpad_linux.h"
+#include "chrome/app/breakpad_linuxish.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/env_vars.h"
#include "content/public/browser/browser_thread.h"
+#if defined(OS_ANDROID)
+#include <sys/linux-syscalls.h>
+
+#define SYS_read __NR_read
+#endif
+
using content::BrowserThread;
using google_breakpad::ExceptionHandler;
@@ -318,8 +324,12 @@ void CrashHandlerHostLinux::OnFileCanReadWithoutBlocking(int fd) {
info->distro_length = strlen(distro);
info->distro = distro;
-
+#if defined(OS_ANDROID)
+ // Nothing gets uploaded in android.
+ info->upload = false;
+#else
info->upload = (getenv(env_vars::kHeadless) == NULL);
+#endif
info->process_start_time = uptime;
info->oom_size = oom_size;
@@ -361,6 +371,7 @@ void CrashHandlerHostLinux::WriteDumpFile(BreakpadInfo* info,
minidump_filename.copy(minidump_filename_str, minidump_filename.length());
minidump_filename_str[minidump_filename.length()] = '\0';
info->filename = minidump_filename_str;
+ info->pid = crashing_pid;
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
diff --git a/chrome/browser/crash_handler_host_linux.h b/chrome/browser/crash_handler_host_linuxish.h
index 55ef624..80c06d9 100644
--- a/chrome/browser/crash_handler_host_linux.h
+++ b/chrome/browser/crash_handler_host_linuxish.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_
-#define CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_
+#ifndef CHROME_BROWSER_CRASH_HANDLER_HOST_LINUXISH_H_
+#define CHROME_BROWSER_CRASH_HANDLER_HOST_LINUXISH_H_
#pragma once
#include "base/compiler_specific.h"
@@ -26,11 +26,11 @@ class Thread;
template <typename T> struct DefaultSingletonTraits;
// This is the base class for singleton objects which crash dump renderers and
-// plugins on Linux. We perform the crash dump from the browser because it
-// allows us to be outside the sandbox.
+// plugins on Linux or Android. We perform the crash dump from the browser
+// because it allows us to be outside the sandbox.
//
-// PluginCrashHandlerHostLinux and RendererCrashHandlerHostLinux are singletons
-// that handle plugin and renderer crashes, respectively.
+// PluginCrashHandlerHostLinux and RendererCrashHandlerHostLinux are
+// singletons that handle plugin and renderer crashes, respectively.
//
// Processes signal that they need to be dumped by sending a datagram over a
// UNIX domain socket. All processes of the same type share the client end of
@@ -181,4 +181,4 @@ class RendererCrashHandlerHostLinux : public CrashHandlerHostLinux {
DISALLOW_COPY_AND_ASSIGN(RendererCrashHandlerHostLinux);
};
-#endif // CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_
+#endif // CHROME_BROWSER_CRASH_HANDLER_HOST_LINUXISH_H_
diff --git a/chrome/browser/crash_handler_host_linux_stub.cc b/chrome/browser/crash_handler_host_linuxish_stub.cc
index 8685846..8101c8f 100644
--- a/chrome/browser/crash_handler_host_linux_stub.cc
+++ b/chrome/browser/crash_handler_host_linuxish_stub.cc
@@ -1,11 +1,11 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This is a stub file which is compiled in when we are building without
// breakpad support.
-#include "chrome/browser/crash_handler_host_linux.h"
+#include "chrome/browser/crash_handler_host_linuxish.h"
#include "base/memory/singleton.h"
diff --git a/chrome/browser/ui/gtk/first_run_dialog.cc b/chrome/browser/ui/gtk/first_run_dialog.cc
index f91b3d9..ddbbeff 100644
--- a/chrome/browser/ui/gtk/first_run_dialog.cc
+++ b/chrome/browser/ui/gtk/first_run_dialog.cc
@@ -29,7 +29,7 @@
#include "ui/base/resource/resource_bundle.h"
#if defined(USE_LINUX_BREAKPAD)
-#include "chrome/app/breakpad_linux.h"
+#include "chrome/app/breakpad_linuxish.h"
#endif
#if defined(GOOGLE_CHROME_BUILD)