diff options
Diffstat (limited to 'chromium/components/crash')
3 files changed, 6 insertions, 4 deletions
diff --git a/chromium/components/crash/content/app/crash_reporter_client.cc b/chromium/components/crash/content/app/crash_reporter_client.cc index b3b09cee8d6..c3c3f9db07d 100644 --- a/chromium/components/crash/content/app/crash_reporter_client.cc +++ b/chromium/components/crash/content/app/crash_reporter_client.cc @@ -148,7 +148,7 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { } #if defined(OS_ANDROID) -unsigned int CrashReporterClient::GetCrashDumpPercentageForWebView() { +unsigned int CrashReporterClient::GetCrashDumpPercentage() { return 100; } diff --git a/chromium/components/crash/content/app/crash_reporter_client.h b/chromium/components/crash/content/app/crash_reporter_client.h index caebf67a7e0..1d35caa3671 100644 --- a/chromium/components/crash/content/app/crash_reporter_client.h +++ b/chromium/components/crash/content/app/crash_reporter_client.h @@ -156,7 +156,7 @@ class CrashReporterClient { // Used by WebView to sample crashes without generating the unwanted dumps. If // the returned value is less than 100, crash dumping will be sampled to that // percentage. - virtual unsigned int GetCrashDumpPercentageForWebView(); + virtual unsigned int GetCrashDumpPercentage(); // Returns true if |ptype| was set to a value to override the default `ptype` // annotation used for the browser process. diff --git a/chromium/components/crash/content/app/crashpad_linux.cc b/chromium/components/crash/content/app/crashpad_linux.cc index 6244bfef583..1c1c80bc92d 100644 --- a/chromium/components/crash/content/app/crashpad_linux.cc +++ b/chromium/components/crash/content/app/crashpad_linux.cc @@ -20,6 +20,7 @@ #include "base/path_service.h" #include "base/posix/eintr_wrapper.h" #include "base/posix/global_descriptors.h" +#include "base/rand_util.h" #include "base/stl_util.h" #include "base/strings/stringprintf.h" #include "build/build_config.h" @@ -639,8 +640,9 @@ base::FilePath PlatformCrashpadInitialization( base::android::SetJavaExceptionCallback(SetJavaExceptionInfo); unsigned int dump_percentage = - GetCrashReporterClient()->GetCrashDumpPercentageForWebView(); - if (dump_percentage < 100 && rand() % 100 >= dump_percentage) { + GetCrashReporterClient()->GetCrashDumpPercentage(); + if (dump_percentage < 100 && + static_cast<unsigned int>(base::RandInt(0, 99)) >= dump_percentage) { dump_at_crash = false; } #endif // OS_ANDROID |