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

Side by Side Diff: components/sync/driver/glue/chrome_report_unrecoverable_error.cc

Issue 2203673002: [Sync] Move //components/sync_driver to //components/sync/driver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sd-a
Patch Set: Full change rebased on static lib. Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/sync_driver/glue/chrome_report_unrecoverable_error.h" 5 #include "components/sync/driver/glue/chrome_report_unrecoverable_error.h"
6 6
7 #include "base/debug/dump_without_crashing.h" 7 #include "base/debug/dump_without_crashing.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 9
10 namespace browser_sync { 10 namespace browser_sync {
11 11
12 void ChromeReportUnrecoverableError(version_info::Channel channel) { 12 void ChromeReportUnrecoverableError(version_info::Channel channel) {
13 // Only upload on canary/dev builds to avoid overwhelming crash server. 13 // Only upload on canary/dev builds to avoid overwhelming crash server.
14 if (channel != version_info::Channel::CANARY && 14 if (channel != version_info::Channel::CANARY &&
15 channel != version_info::Channel::DEV) { 15 channel != version_info::Channel::DEV) {
16 return; 16 return;
17 } 17 }
18 18
19 // We only want to upload |kErrorUploadRatio| ratio of errors. 19 // We only want to upload |kErrorUploadRatio| ratio of errors.
20 const double kErrorUploadRatio = 0.01; 20 const double kErrorUploadRatio = 0.01;
21 if (kErrorUploadRatio <= 0.0) 21 if (kErrorUploadRatio <= 0.0)
22 return; // We are not allowed to upload errors. 22 return; // We are not allowed to upload errors.
23 double random_number = base::RandDouble(); 23 double random_number = base::RandDouble();
24 if (random_number > kErrorUploadRatio) 24 if (random_number > kErrorUploadRatio)
25 return; 25 return;
26 26
27 base::debug::DumpWithoutCrashing(); 27 base::debug::DumpWithoutCrashing();
28 } 28 }
29 29
30 } // namespace browser_sync 30 } // namespace browser_sync
OLDNEW
« no previous file with comments | « components/sync/driver/glue/chrome_report_unrecoverable_error.h ('k') | components/sync/driver/glue/sync_backend_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698