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

Unified Diff: components/metrics/metrics_log.cc

Issue 1030503003: Metrics log modification to handle external components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: newlinewq Created 5 years, 9 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 | « components/metrics/metrics_log.h ('k') | components/metrics/metrics_log_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/metrics_log.cc
diff --git a/components/metrics/metrics_log.cc b/components/metrics/metrics_log.cc
index 917405bff87868e5a4a27eca876c741397500030..42dca83236b6c598701b448ca35f8dca7d53676b 100644
--- a/components/metrics/metrics_log.cc
+++ b/components/metrics/metrics_log.cc
@@ -56,17 +56,6 @@ bool IsTestingID(const std::string& id) {
return id.size() < 16;
}
-// Returns the date at which the current metrics client ID was created as
-// a string containing seconds since the epoch, or "0" if none was found.
-std::string GetMetricsEnabledDate(PrefService* pref) {
- if (!pref) {
- NOTREACHED();
- return "0";
- }
-
- return pref->GetString(prefs::kMetricsReportingEnabledTimestamp);
-}
-
// Computes a SHA-1 hash of |data| and returns it as a hex string.
std::string ComputeSHA1(const std::string& data) {
const std::string sha1 = base::SHA1HashString(data);
@@ -302,7 +291,8 @@ void MetricsLog::WriteRealtimeStabilityAttributes(
void MetricsLog::RecordEnvironment(
const std::vector<MetricsProvider*>& metrics_providers,
const std::vector<variations::ActiveGroupId>& synthetic_trials,
- int64 install_date) {
+ int64 install_date,
+ int64 metrics_reporting_enabled_date) {
DCHECK(!HasEnvironment());
SystemProfileProto* system_profile = uma_proto()->mutable_system_profile();
@@ -311,13 +301,9 @@ void MetricsLog::RecordEnvironment(
if (client_->GetBrand(&brand_code))
system_profile->set_brand_code(brand_code);
- int enabled_date;
- bool success =
- base::StringToInt(GetMetricsEnabledDate(local_state_), &enabled_date);
- DCHECK(success);
-
// Reduce granularity of the enabled_date field to nearest hour.
- system_profile->set_uma_enabled_date(RoundSecondsToHour(enabled_date));
+ system_profile->set_uma_enabled_date(
+ RoundSecondsToHour(metrics_reporting_enabled_date));
// Reduce granularity of the install_date field to nearest hour.
system_profile->set_install_date(RoundSecondsToHour(install_date));
« no previous file with comments | « components/metrics/metrics_log.h ('k') | components/metrics/metrics_log_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698