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

Unified Diff: chrome/app/chrome_crash_reporter_client_mac.mm

Issue 2799013002: Monitor crashpad_handler for crashes [sometimes] (Closed)
Patch Set: Created 3 years, 8 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
Index: chrome/app/chrome_crash_reporter_client_mac.mm
diff --git a/chrome/app/chrome_crash_reporter_client_mac.mm b/chrome/app/chrome_crash_reporter_client_mac.mm
index d3a227bc5fe81121f940d2b29f3ee89fadf7005a..b990b2f7be12f7958b6443740e1defc8e57ae73a 100644
--- a/chrome/app/chrome_crash_reporter_client_mac.mm
+++ b/chrome/app/chrome_crash_reporter_client_mac.mm
@@ -8,9 +8,12 @@
#include "base/mac/scoped_cftyperef.h"
#include "base/path_service.h"
+#include "base/rand_util.h"
#include "base/strings/sys_string_conversions.h"
+#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_paths.h"
#include "components/policy/policy_constants.h"
+#include "components/version_info/version_info.h"
#if !defined(DISABLE_NACL)
#include "base/command_line.h"
@@ -38,3 +41,33 @@
}
return false;
}
+
+bool ChromeCrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
+ // This mechanism dedicates a process to be crashpad_handler's own
+ // crashpad_handler. In Chrome builds for official release, scale back on this
+ // in the more stable channels. Other builds are of more of a developmental
+ // nature, so always enable the additional crash reporting.
+#if defined(GOOGLE_CHROME_BUILD) && defined(OFFICIAL_BUILD)
+ double probability;
+ switch (chrome::GetChannel()) {
+ case version_info::Channel::STABLE:
+ probability = 0.01;
+ break;
+
+ case version_info::Channel::BETA:
+ probability = 0.1;
+ break;
+
+ case version_info::Channel::DEV:
+ probability = 0.25;
+ break;
+
+ case version_info::Channel::CANARY:
+ case version_info::Channel::UNKNOWN:
+ return true;
+ }
+ return base::RandDouble() < probability;
+#else
+ return true;
+#endif
+}

Powered by Google App Engine
This is Rietveld 408576698