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

Unified Diff: chrome/app/chrome_crash_reporter_client_mac.mm

Issue 2799013002: Monitor crashpad_handler for crashes [sometimes] (Closed)
Patch Set: Address review feedback (scottmg) 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
« no previous file with comments | « chrome/app/chrome_crash_reporter_client.h ('k') | chrome/app/chrome_crash_reporter_client_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c89a83843777ba9ebe849d5001c14b59558c7072 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,29 @@
}
return false;
}
+
+bool ChromeCrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
+ // This mechanism dedicates a process to be crashpad_handler's own
+ // crashpad_handler. In Google Chrome, 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.
+ 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;
+
+ default:
+ return true;
+ }
+
+ return base::RandDouble() < probability;
+}
« no previous file with comments | « chrome/app/chrome_crash_reporter_client.h ('k') | chrome/app/chrome_crash_reporter_client_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698