summaryrefslogtreecommitdiffstats
path: root/chrome/browser/metrics/metrics_service.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/metrics/metrics_service.cc')
-rw-r--r--chrome/browser/metrics/metrics_service.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index 610792c..54cc138 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -322,6 +322,7 @@ void MetricsService::RegisterPrefs(PrefService* local_state) {
local_state->RegisterInt64Pref(prefs::kStabilityLastTimestampSec, 0);
local_state->RegisterInt64Pref(prefs::kStabilityUptimeSec, 0);
local_state->RegisterStringPref(prefs::kStabilityStatsVersion, L"");
+ local_state->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0);
local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true);
local_state->RegisterBooleanPref(prefs::kStabilitySessionEndCompleted, true);
local_state->RegisterIntegerPref(prefs::kMetricsSessionID, -1);
@@ -664,13 +665,17 @@ void MetricsService::InitializeMetricsState() {
PrefService* pref = g_browser_process->local_state();
DCHECK(pref);
- if (WideToUTF8(pref->GetString(prefs::kStabilityStatsVersion)) !=
- MetricsLog::GetVersionString()) {
+ if ((pref->GetInt64(prefs::kStabilityStatsBuildTime)
+ != MetricsLog::GetBuildTime()) ||
+ (WideToUTF8(pref->GetString(prefs::kStabilityStatsVersion))
+ != MetricsLog::GetVersionString())) {
// This is a new version, so we don't want to confuse the stats about the
// old version with info that we upload.
DiscardOldStabilityStats(pref);
pref->SetString(prefs::kStabilityStatsVersion,
UTF8ToWide(MetricsLog::GetVersionString()));
+ pref->SetInt64(prefs::kStabilityStatsBuildTime,
+ MetricsLog::GetBuildTime());
}
// Update session ID