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

Unified Diff: chrome/browser/about_flags.cc

Issue 509923003: about_flags::ReportCustomFlags() should use signed 32-bit IDs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/about_flags.cc
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index dd246e7703009eaed6fac106b2a59b162cbd0b7c..675fbf10671f7caf2702928f9e0bf2f126d6441f 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -2239,7 +2239,9 @@ void RecordUMAStatistics(FlagsStorage* flags_storage) {
}
uint32_t GetSwitchUMAId(const std::string& switch_name) {
- return static_cast<uint32_t>(metrics::HashMetricName(switch_name));
+ // Need to strip sign bit.
sky 2014/08/27 20:24:53 You need a better comment. Document 'why' we need
Alexander Alekseev 2014/08/28 02:48:55 Done.
+ return static_cast<uint32_t>(metrics::HashMetricName(switch_name)) &
Ilya Sherman 2014/08/27 22:05:20 Why not just static_cast to <int32_t>? That has t
Alexander Alekseev 2014/08/28 02:48:55 static_cast<int32_t>((uint64_t)(-1LL)) == -1 So I
Ilya Sherman 2014/08/28 03:49:57 I don't understand the problem. What's wrong with
Alexander Alekseev 2014/08/28 14:40:52 Except that it is unnatural, nothing wrong. Done.
+ std::numeric_limits<int32_t>::max();
}
void ReportCustomFlags(const std::string& uma_histogram_hame,
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698