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 password_manager_metrics_util { | |
| 11 | |
| 12 // We monitor the performance of the save password heuristic for a handful of | |
| 13 // domains. For privacy reasons we are not reporting UMA signals by domain, but | |
| 14 // by a domain group. A domain group can contain multiple domains, and a domain | |
| 15 // can be contained in multiple groups. | |
| 16 // For more information see http://goo.gl/vUuFd5. | |
| 17 | |
| 18 // The number of group in which each monitored website appears. | |
|
vabr (Chromium)
2013/09/12 13:40:02
group -> groups
| |
| 19 // It is a half of the total number of groups. | |
| 20 const size_t kGroupsPerDomain = 10u; | |
| 21 | |
| 22 // Check whether the |url_host| is monitored or not. If yes, we return | |
| 23 // the id of the group which contains the domain name otherwise | |
| 24 // returns 0. | |
| 25 unsigned int MonitoredDomainGroupId(const std::string& url_host); | |
|
vabr (Chromium)
2013/09/12 13:40:02
As Ilya pointed out, please use size_t, or some un
jdomingos
2013/09/12 16:33:52
Done.
| |
| 26 | |
| 27 // A version of the UMA_HISTOGRAM_ENUMERATION macro that allows the |name| | |
| 28 // to vary over the program's runtime. | |
| 29 void LogUMAHistogramEnumeration(const std::string& name, | |
| 30 int sample, | |
| 31 int boundary_value); | |
| 32 | |
| 33 // A version of the UMA_HISTOGRAM_COUNTS macro that allows the |name| | |
| 34 // to vary over the program's runtime. | |
| 35 void LogUMAHistogramCounts(const std::string& name, int sample); | |
|
vabr (Chromium)
2013/09/12 13:40:02
You don't use this any more. Please remove.
jdomingos
2013/09/12 16:33:52
Done.
| |
| 36 | |
| 37 // A version of the UMA_HISTOGRAM_BOOLEAN macro that allows the |name| | |
| 38 // to vary over the program's runtime. | |
| 39 void LogUMAHistogramBoolean(const std::string& name, bool sample); | |
| 40 | |
| 41 // Generate an id in range [0, |kGroupsPerDomain|). | |
| 42 // If the |g_random_group_id| is equal to its initial value | |
| 43 // (|kGroupsPerDomain|), the value of |g_random_group_id| is changed. | |
| 44 void GenerateRandomId(); | |
| 45 | |
| 46 void SetRandomIdForTesting(unsigned int value); | |
|
vabr (Chromium)
2013/09/12 13:40:02
Also please change to a fixed-width unsigned type.
jdomingos
2013/09/12 16:33:52
Done.
| |
| 47 | |
| 48 // Returns a string which contains group_|group_id|. If the | |
| 49 // group_id corresponds to an unmonitored domain returns an empty string. | |
| 50 std::string GroupIdToString(unsigned int group_id); | |
|
vabr (Chromium)
2013/09/12 13:40:02
Ditto.
jdomingos
2013/09/12 16:33:52
Done.
| |
| 51 | |
| 52 } // namespace password_manager_metrics_util | |
| 53 | |
| 54 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_METRICS_UTIL_H_ | |
| OLD | NEW |