Chromium Code Reviews| Index: chrome/browser/metrics/cloned_install_detector.cc |
| diff --git a/chrome/browser/metrics/cloned_install_detector.cc b/chrome/browser/metrics/cloned_install_detector.cc |
| index 3ecfd2ccea742a6e4a0d5c52cf70f0b7ddc5f6c9..669ec60829e18e272e6ec21efaf4e56a8d4f18d3 100644 |
| --- a/chrome/browser/metrics/cloned_install_detector.cc |
| +++ b/chrome/browser/metrics/cloned_install_detector.cc |
| @@ -49,7 +49,8 @@ ClonedInstallDetector::ClonedInstallDetector(MachineIdProvider* raw_id_provider) |
| ClonedInstallDetector::~ClonedInstallDetector() {} |
| void ClonedInstallDetector::CheckForClonedInstall(PrefService* local_state) { |
| - content::BrowserThread::PostTaskAndReplyWithResult( |
| + DVLOG(2) << "\n\nabout to post some tasks.\n\n"; |
| + bool res = content::BrowserThread::PostTaskAndReplyWithResult( |
| content::BrowserThread::FILE, |
| FROM_HERE, |
| base::Bind(&metrics::MachineIdProvider::GetMachineId, |
| @@ -57,11 +58,13 @@ void ClonedInstallDetector::CheckForClonedInstall(PrefService* local_state) { |
| base::Bind(&metrics::ClonedInstallDetector::SaveMachineId, |
| weak_ptr_factory_.GetWeakPtr(), |
| local_state)); |
| + DVLOG(2) << "\n\ntask posted? " << res << "\n\n"; |
| } |
| void ClonedInstallDetector::SaveMachineId( |
| PrefService* local_state, |
| std::string raw_id) { |
| + DVLOG(2) << "\n\nsaving id: " << raw_id << "\n\n"; |
| if (raw_id.empty()) { |
| LogMachineIdState(ID_GENERATION_FAILED); |
| local_state->ClearPref(prefs::kMetricsMachineId); |
| @@ -72,8 +75,12 @@ 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; |
| + local_state->SetBoolean(prefs::kMetricsResetIds, true); |
|
Alexei Svitkine (slow)
2014/03/28 16:30:48
Can this be a callback passed to this class at con
jwd
2014/03/28 18:59:21
Done.
|
| + } else { |
| + id_state = ID_UNCHANGED; |
| + } |
| } |
| LogMachineIdState(id_state); |