diff options
author | jwd@chromium.org <jwd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-01 21:48:27 +0000 |
---|---|---|
committer | jwd@chromium.org <jwd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-01 21:48:27 +0000 |
commit | 22433f70e752e03aa8a961e6d18eac3c8ab2706e (patch) | |
tree | 9b3bc4c72c053e72ca747ee505462653144865dc /chrome/browser/metrics/cloned_install_detector.cc | |
parent | 076447eccf5726c07824b80b4fa58ba9cedd2018 (diff) | |
download | chromium_src-22433f70e752e03aa8a961e6d18eac3c8ab2706e.zip chromium_src-22433f70e752e03aa8a961e6d18eac3c8ab2706e.tar.gz chromium_src-22433f70e752e03aa8a961e6d18eac3c8ab2706e.tar.bz2 |
Merge 260348 "Resetting metrics ids on clump detection."
> Resetting metrics ids on clump detection.
>
> When a cloned install is detected the metrics client id and low entropy source are reset on the next start of Chrome. This is done by setting a pref in local state. The next time either the client id or low entropy source are loaded from the local state, they are first reset.
>
> BUG=343273
> NOTRY=true
>
> Review URL: https://codereview.chromium.org/213363004
TBR=jwd@chromium.org
Review URL: https://codereview.chromium.org/213523003
git-svn-id: svn://svn.chromium.org/chrome/branches/1916/src@260950 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/metrics/cloned_install_detector.cc')
-rw-r--r-- | chrome/browser/metrics/cloned_install_detector.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/metrics/cloned_install_detector.cc b/chrome/browser/metrics/cloned_install_detector.cc index 3ecfd2c..db52b84 100644 --- a/chrome/browser/metrics/cloned_install_detector.cc +++ b/chrome/browser/metrics/cloned_install_detector.cc @@ -72,8 +72,14 @@ void ClonedInstallDetector::SaveMachineId( MachineIdState id_state = ID_NO_STORED_VALUE; if (local_state->HasPrefPath(prefs::kMetricsMachineId)) { - id_state = local_state->GetInteger(prefs::kMetricsMachineId) == hashed_id ? - ID_UNCHANGED : ID_CHANGED; + if (local_state->GetInteger(prefs::kMetricsMachineId) != hashed_id) { + id_state = ID_CHANGED; + // TODO(jwd): Use a callback to set the reset pref. That way + // ClonedInstallDetector doesn't need to know about this pref. + local_state->SetBoolean(prefs::kMetricsResetIds, true); + } else { + id_state = ID_UNCHANGED; + } } LogMachineIdState(id_state); |