diff options
author | lipalani@chromium.org <lipalani@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-09 23:26:49 +0000 |
---|---|---|
committer | lipalani@chromium.org <lipalani@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-09 23:26:49 +0000 |
commit | 760e9d8f231b9b79164c28165d4249aeb98463d1 (patch) | |
tree | 3918513a70203fb7751364d207ddfefd8ad99a2f | |
parent | bdfc8165161ed08963174d62c00babc33c38cb41 (diff) | |
download | chromium_src-760e9d8f231b9b79164c28165d4249aeb98463d1.zip chromium_src-760e9d8f231b9b79164c28165d4249aeb98463d1.tar.gz chromium_src-760e9d8f231b9b79164c28165d4249aeb98463d1.tar.bz2 |
Upload only a fixed percentage of unrecoverable errors. We do this to throttle the number of uploads we have currently.
BUG=
TEST=
Review URL: http://codereview.chromium.org/9959084
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131477 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/sync/glue/chrome_report_unrecoverable_error.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/sync/glue/chrome_report_unrecoverable_error.cc b/chrome/browser/sync/glue/chrome_report_unrecoverable_error.cc index fb6f6f9..3164512 100644 --- a/chrome/browser/sync/glue/chrome_report_unrecoverable_error.cc +++ b/chrome/browser/sync/glue/chrome_report_unrecoverable_error.cc @@ -4,6 +4,7 @@ #include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" +#include "base/rand_util.h" #include "build/build_config.h" #if defined(OS_WIN) @@ -14,9 +15,15 @@ namespace browser_sync { +static const double kErrorUploadRatio = 0.15; void ChromeReportUnrecoverableError() { // TODO(lipalani): Add this for other platforms as well. #if defined(OS_WIN) + // We only want to upload |kErrorUploadRatio| ratio of errors. + double random_number = base::RandDouble(); + if (random_number > kErrorUploadRatio) + return; + // Get the breakpad pointer from chrome.exe typedef void (__cdecl *DumpProcessFunction)(); DumpProcessFunction DumpProcess = reinterpret_cast<DumpProcessFunction>( |