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

Unified Diff: user_collector.cc

Issue 6673002: crash-reporter: keep ignoring chrome crashes even on dev builds (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crash-reporter.git@master
Patch Set: Created 9 years, 9 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 | « user_collector.h ('k') | user_collector_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: user_collector.cc
diff --git a/user_collector.cc b/user_collector.cc
index c166e125e6198f373c8a812a720b8febe7f1f6b7..a038e69dbe51fd5e9828fef7ec7662c4c7e90dca 100644
--- a/user_collector.cc
+++ b/user_collector.cc
@@ -415,6 +415,38 @@ bool UserCollector::ParseCrashAttributes(const std::string &crash_attributes,
return re.FullMatch(crash_attributes, pid, signal, kernel_supplied_name);
}
+bool UserCollector::ShouldDump(bool has_owner_consent,
+ bool is_developer,
+ bool is_crash_test_in_progress,
+ const std::string &exec,
+ std::string *reason) {
+ reason->clear();
+
+ // Treat Chrome crashes as if the user opted-out. We stop counting Chrome
+ // crashes towards user crashes, so user crashes really mean non-Chrome
+ // user-space crashes.
+ if (exec == "chrome" || exec == "supplied_chrome") {
+ *reason = "ignoring - chrome crash";
+ return false;
+ }
+
+ // For developer builds, we always want to keep the crash reports unless
+ // we're testing the crash facilities themselves. This overrides
+ // feedback. Crash sending still obeys consent.
+ if (is_developer && !is_crash_test_in_progress) {
+ *reason = "developer build - not testing - always dumping";
+ return true;
+ }
+
+ if (!has_owner_consent) {
+ *reason = "ignoring - no consent";
+ return false;
+ }
+
+ *reason = "handling";
+ return true;
+}
+
bool UserCollector::HandleCrash(const std::string &crash_attributes,
const char *force_exec) {
CHECK(initialized_);
@@ -450,31 +482,17 @@ bool UserCollector::HandleCrash(const std::string &crash_attributes,
return true;
}
- bool feedback = is_feedback_allowed_function_();
- const char *handling_string = "handling";
- if (!feedback) {
- handling_string = "ignoring - no consent";
- }
-
- // Treat Chrome crashes as if the user opted-out. We stop counting Chrome
- // crashes towards user crashes, so user crashes really mean non-Chrome
- // user-space crashes.
- if (exec == "chrome" || exec == "supplied_chrome") {
- feedback = false;
- handling_string = "ignoring - chrome crash";
- }
+ std::string reason;
+ bool dump = ShouldDump(is_feedback_allowed_function_(),
+ file_util::PathExists(FilePath(kLeaveCoreFile)),
+ IsCrashTestInProgress(),
+ exec,
+ &reason);
LOG(WARNING) << "Received crash notification for " << exec << "[" << pid
- << "] sig " << signal << " (" << handling_string << ")";
-
- // For developer builds, we always want to keep the crash reports unless
- // we're testing the crash facilities themselves.
- if (file_util::PathExists(FilePath(kLeaveCoreFile)) &&
- !IsCrashTestInProgress()) {
- feedback = true;
- }
+ << "] sig " << signal << " (" << reason << ")";
- if (feedback) {
+ if (dump) {
count_crash_function_();
if (generate_diagnostics_) {
« no previous file with comments | « user_collector.h ('k') | user_collector_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698