summaryrefslogtreecommitdiffstats
path: root/components/breakpad
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-07 08:35:29 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-07 08:35:29 +0000
commit6664958acde27d18518aeafa1e8fe7cafe289f81 (patch)
tree6faf0242eb85f19d26de2e0d78f24cb5ebbcb85a /components/breakpad
parent2da86252173ef56798a5a2b910ceb245d5bdad99 (diff)
downloadchromium_src-6664958acde27d18518aeafa1e8fe7cafe289f81.zip
chromium_src-6664958acde27d18518aeafa1e8fe7cafe289f81.tar.gz
chromium_src-6664958acde27d18518aeafa1e8fe7cafe289f81.tar.bz2
Move init of breakpad in the browser process as early as possible
On Linux and Android, we delayed initialization until the browser process was already up. That way, certain crash keys did not get registered correctly. Instead, use a similar logic than on mac and windows to determine whether we can run breakpad. In particular, this relies on the fact that the GetCollectStatsConsent() setting reflects the policy enforced value. R=mark@chromium.org, pastarmovj@chromium.org, rsesek@chromium.org BUG=311877 Review URL: https://codereview.chromium.org/61923002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233553 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/breakpad')
-rw-r--r--components/breakpad/app/breakpad_client.cc2
-rw-r--r--components/breakpad/app/breakpad_client.h2
-rw-r--r--components/breakpad/app/breakpad_linux.cc13
3 files changed, 15 insertions, 2 deletions
diff --git a/components/breakpad/app/breakpad_client.cc b/components/breakpad/app/breakpad_client.cc
index 16f7dc7..c39d8f9 100644
--- a/components/breakpad/app/breakpad_client.cc
+++ b/components/breakpad/app/breakpad_client.cc
@@ -103,11 +103,11 @@ bool BreakpadClient::IsRunningUnattended() {
return true;
}
-#if defined(OS_WIN) || defined(OS_MACOSX)
bool BreakpadClient::GetCollectStatsConsent() {
return false;
}
+#if defined(OS_WIN) || defined(OS_MACOSX)
bool BreakpadClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
return false;
}
diff --git a/components/breakpad/app/breakpad_client.h b/components/breakpad/app/breakpad_client.h
index 6a514d0..a92c0fb 100644
--- a/components/breakpad/app/breakpad_client.h
+++ b/components/breakpad/app/breakpad_client.h
@@ -119,10 +119,10 @@ class BreakpadClient {
// Returns true if running in unattended mode (for automated testing).
virtual bool IsRunningUnattended();
-#if defined(OS_WIN) || defined(OS_MACOSX)
// Returns true if the user has given consent to collect stats.
virtual bool GetCollectStatsConsent();
+#if defined(OS_WIN) || defined(OS_MACOSX)
// Returns true if breakpad is enforced via management policies. In that
// case, |breakpad_enabled| is set to the value enforced by policies.
virtual bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled);
diff --git a/components/breakpad/app/breakpad_linux.cc b/components/breakpad/app/breakpad_linux.cc
index 740213b..9106568 100644
--- a/components/breakpad/app/breakpad_linux.cc
+++ b/components/breakpad/app/breakpad_linux.cc
@@ -1455,6 +1455,19 @@ void InitCrashReporter() {
const std::string process_type =
parsed_command_line.GetSwitchValueASCII(switches::kProcessType);
if (process_type.empty()) {
+ bool enable_breakpad = GetBreakpadClient()->GetCollectStatsConsent() ||
+ GetBreakpadClient()->IsRunningUnattended();
+ enable_breakpad &=
+ !parsed_command_line.HasSwitch(switches::kDisableBreakpad);
+ if (!enable_breakpad) {
+ enable_breakpad = parsed_command_line.HasSwitch(
+ switches::kEnableCrashReporterForTesting);
+ }
+ if (!enable_breakpad) {
+ VLOG(1) << "Breakpad disabled";
+ return;
+ }
+
EnableCrashDumping(GetBreakpadClient()->IsRunningUnattended());
} else if (process_type == switches::kRendererProcess ||
process_type == switches::kPluginProcess ||