summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chrome_browser_main_android.cc
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-24 22:03:38 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-24 22:03:38 +0000
commit40da3e0c42d83eb6225d9d340780bd6e3af14b6c (patch)
treeabb3a7d5bc2db5dcdbd5031fa6acbf018e9a0652 /chrome/browser/chrome_browser_main_android.cc
parent4d8517ad228e3eb26bcc776c6c95dcdfeb51a31c (diff)
downloadchromium_src-40da3e0c42d83eb6225d9d340780bd6e3af14b6c.zip
chromium_src-40da3e0c42d83eb6225d9d340780bd6e3af14b6c.tar.gz
chromium_src-40da3e0c42d83eb6225d9d340780bd6e3af14b6c.tar.bz2
Because of UID isolation on Android, crash dump generation has to happen
in-process for renderers as well (as the browser cannot access all the necessary states of the renderer process). Breakpad has support for generating minidumps to a passed FD (as the renderer process on Android does not have permission to create file), so the flow on Android is: - when a render process is created the browser creates a file and passes its FD to the process - the renderer process initializes Breakpad with that FD - if there is a crash, Breakpad generates the minidump to that FD. - when the browser process detects a renderer stopped it checks the minidump file. If it's empty it deletes the file. If it's not empty, it means there was a crasher in which case it moves it to the crash dump folder for it to be picked up and uploaded by the Java side. BUG=None TEST=Test that minidumps are generated and uploaded when visiting about:crash and about:crashbrowserforrealz on Android and desktop Chrome. Review URL: https://chromiumcodereview.appspot.com/11189068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163917 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chrome_browser_main_android.cc')
-rw-r--r--chrome/browser/chrome_browser_main_android.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/chrome_browser_main_android.cc b/chrome/browser/chrome_browser_main_android.cc
index d99c140..4522b54 100644
--- a/chrome/browser/chrome_browser_main_android.cc
+++ b/chrome/browser/chrome_browser_main_android.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/chrome_browser_main_android.h"
-#include "chrome/common/chrome_switches.h"
+#include "chrome/app/breakpad_linux.h"
#include "content/public/common/main_function_params.h"
#include "net/android/network_change_notifier_factory_android.h"
#include "net/base/network_change_notifier.h"
@@ -17,6 +17,17 @@ ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid(
ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() {
}
+void ChromeBrowserMainPartsAndroid::PreProfileInit() {
+#if defined(USE_LINUX_BREAKPAD)
+ // TODO(jcivelli): we should not initialize the crash-reporter when it was not
+ // enabled. Right now if it is disabled we still generate the minidumps but we
+ // do not upload them.
+ InitCrashReporter();
+#endif
+
+ ChromeBrowserMainParts::PreProfileInit();
+}
+
void ChromeBrowserMainPartsAndroid::PreEarlyInitialization() {
net::NetworkChangeNotifier::SetFactory(
new net::NetworkChangeNotifierFactoryAndroid());