Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_METRICS_UTIL_H_ | |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_METRICS_UTIL_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 namespace base { | |
| 11 class TimeDelta; | |
| 12 } | |
| 13 | |
| 14 namespace password_manager_metrics_util { | |
| 15 | |
| 16 // The number of time that each monitored website appears. | |
|
vabr (Chromium)
2013/09/11 17:31:24
Please change
"time that" -> "groups in which"
jdomingos
2013/09/11 19:15:28
Done.
| |
| 17 // It is a half of the total number of buckets. | |
|
vabr (Chromium)
2013/09/11 17:31:24
First: "groups", not "buckets".
Second: If you mea
jdomingos
2013/09/11 19:15:28
Done.
| |
| 18 // For more information see goo.gl/vUuFd5. | |
|
vabr (Chromium)
2013/09/11 17:31:24
Please add http://, so that this becomes a clickab
vabr (Chromium)
2013/09/11 17:31:24
Also, maybe write a very short paragraph about wha
jdomingos
2013/09/11 19:15:28
Done.
jdomingos
2013/09/11 19:15:28
Done.
| |
| 19 const size_t kGroupsPerDomain = 10u; | |
|
vabr (Chromium)
2013/09/11 17:31:24
Also, are these constants used outside of this hea
| |
| 20 | |
| 21 // Number of groups which can store monitored websites. | |
|
vabr (Chromium)
2013/09/11 17:31:24
"store monitored website" sounds confusing (like s
jdomingos
2013/09/11 19:15:28
Done.
| |
| 22 const size_t kGroupNumber = 20u; | |
| 23 | |
| 24 // Check whether the |url_host| is monitored or not. If yes, we return | |
| 25 // the name of the group which contains the domain name otherwise | |
| 26 // returns an empty string. | |
| 27 std::string MonitoredDomainGroup(const std::string& url_host); | |
| 28 | |
| 29 // A version of the UMA_HISTOGRAM_ENUMERATION macro that allows the |name| | |
| 30 // to vary over the program's runtime. | |
| 31 void LogUMAHistogramEnumeration(const std::string& name, | |
| 32 int sample, | |
| 33 int boundary_value); | |
| 34 | |
| 35 // A version of the UMA_HISTOGRAM_TIMES macro that allows the |name| | |
| 36 // to vary over the program's runtime. | |
| 37 void LogUMAHistogramTimes(const std::string& name, | |
| 38 const base::TimeDelta& duration); | |
| 39 | |
| 40 // A version of the UMA_HISTOGRAM_COUNTS macro that allows the |name| | |
| 41 // to vary over the program's runtime. | |
| 42 void LogUMAHistogramCounts(const std::string& name, int sample); | |
| 43 | |
| 44 // A version of the UMA_HISTOGRAM_BOOLEAN macro that allows the |name| | |
| 45 // to vary over the program's runtime. | |
| 46 void LogUMAHistogramBoolean(const std::string& name, bool sample); | |
| 47 | |
| 48 // Generate an id in range [0, |kGroupsPerDomain|). | |
| 49 // If the |random_group_id| is equal to its initial value (|kGroupsPerDomain|), | |
| 50 // the value of |random_id| is not changed. | |
| 51 void generateRandomId(); | |
|
vabr (Chromium)
2013/09/11 17:31:24
Please capitalise (GenerateRandomId), also below f
jdomingos
2013/09/11 19:15:28
Done.
| |
| 52 | |
| 53 // Only used in the IsDomainNameMonitoredTest. | |
| 54 void setRandomId(unsigned int value); | |
|
vabr (Chromium)
2013/09/11 17:31:24
Please append "ForTesting" to the function name. T
jdomingos
2013/09/11 19:15:28
Done.
| |
| 55 | |
| 56 } // namespace password_manager_metrics_util | |
| 57 | |
| 58 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_METRICS_UTIL_H_ | |
| OLD | NEW |