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

Side by Side Diff: chrome/browser/sync/glue/chrome_report_unrecoverable_error.cc

Issue 1269773002: Cleanup VersionInfo after componentization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" 5 #include "chrome/browser/sync/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 #include "chrome/common/channel_info.h"
9 #include "chrome/common/chrome_constants.h" 10 #include "chrome/common/chrome_constants.h"
10 #include "chrome/common/chrome_version_info.h" 11 #include "components/version_info/version_info.h"
11 12
12 namespace browser_sync { 13 namespace browser_sync {
13 14
14 void ChromeReportUnrecoverableError() { 15 void ChromeReportUnrecoverableError() {
15 // Only upload on canary/dev builds to avoid overwhelming crash server. 16 // Only upload on canary/dev builds to avoid overwhelming crash server.
16 version_info::Channel channel = chrome::VersionInfo::GetChannel(); 17 version_info::Channel channel = chrome::GetChannel();
17 if (channel != version_info::Channel::CANARY && 18 if (channel != version_info::Channel::CANARY &&
18 channel != version_info::Channel::DEV) { 19 channel != version_info::Channel::DEV) {
19 return; 20 return;
20 } 21 }
21 22
22 // We only want to upload |kErrorUploadRatio| ratio of errors. 23 // We only want to upload |kErrorUploadRatio| ratio of errors.
23 const double kErrorUploadRatio = 0.01; 24 const double kErrorUploadRatio = 0.01;
24 if (kErrorUploadRatio <= 0.0) 25 if (kErrorUploadRatio <= 0.0)
25 return; // We are not allowed to upload errors. 26 return; // We are not allowed to upload errors.
26 double random_number = base::RandDouble(); 27 double random_number = base::RandDouble();
27 if (random_number > kErrorUploadRatio) 28 if (random_number > kErrorUploadRatio)
28 return; 29 return;
29 30
30 base::debug::DumpWithoutCrashing(); 31 base::debug::DumpWithoutCrashing();
31 } 32 }
32 33
33 } // namespace browser_sync 34 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/about_sync_util.cc ('k') | chrome/browser/sync/glue/local_device_info_provider_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698