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

Side by Side Diff: components/metrics/metrics_state_manager.cc

Issue 887843003: Removed ScopedAllowIO from MetricsStateManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Post on blocking pool Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « components/metrics/client_info.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/metrics/metrics_state_manager.h" 5 #include "components/metrics/metrics_state_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/guid.h" 8 #include "base/guid.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/metrics/sparse_histogram.h" 10 #include "base/metrics/sparse_histogram.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 ClonedInstallDetector::RegisterPrefs(registry); 212 ClonedInstallDetector::RegisterPrefs(registry);
213 CachingPermutedEntropyProvider::RegisterPrefs(registry); 213 CachingPermutedEntropyProvider::RegisterPrefs(registry);
214 214
215 // TODO(asvitkine): Remove these once a couple of releases have passed. 215 // TODO(asvitkine): Remove these once a couple of releases have passed.
216 // http://crbug.com/357704 216 // http://crbug.com/357704
217 registry->RegisterStringPref(prefs::kMetricsOldClientID, std::string()); 217 registry->RegisterStringPref(prefs::kMetricsOldClientID, std::string());
218 registry->RegisterIntegerPref(prefs::kMetricsOldLowEntropySource, 0); 218 registry->RegisterIntegerPref(prefs::kMetricsOldLowEntropySource, 0);
219 } 219 }
220 220
221 void MetricsStateManager::BackUpCurrentClientInfo() { 221 void MetricsStateManager::BackUpCurrentClientInfo() {
222 // TODO(gayane): Eliminate use of ScopedAllowIO. crbug.com/413783
223 base::ThreadRestrictions::ScopedAllowIO allow_io;
224
225 ClientInfo client_info; 222 ClientInfo client_info;
226 client_info.client_id = client_id_; 223 client_info.client_id = client_id_;
227 client_info.installation_date = local_state_->GetInt64(prefs::kInstallDate); 224 client_info.installation_date = local_state_->GetInt64(prefs::kInstallDate);
228 client_info.reporting_enabled_date = 225 client_info.reporting_enabled_date =
229 local_state_->GetInt64(prefs::kMetricsReportingEnabledTimestamp); 226 local_state_->GetInt64(prefs::kMetricsReportingEnabledTimestamp);
230 store_client_info_.Run(client_info); 227 store_client_info_.Run(client_info);
231 } 228 }
232 229
233 scoped_ptr<ClientInfo> MetricsStateManager::LoadClientInfoAndMaybeMigrate() { 230 scoped_ptr<ClientInfo> MetricsStateManager::LoadClientInfoAndMaybeMigrate() {
234 scoped_ptr<ClientInfo> client_info = load_client_info_.Run(); 231 scoped_ptr<ClientInfo> client_info = load_client_info_.Run();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 303
307 local_state_->ClearPref(prefs::kMetricsClientID); 304 local_state_->ClearPref(prefs::kMetricsClientID);
308 local_state_->ClearPref(prefs::kMetricsLowEntropySource); 305 local_state_->ClearPref(prefs::kMetricsLowEntropySource);
309 local_state_->ClearPref(prefs::kMetricsResetIds); 306 local_state_->ClearPref(prefs::kMetricsResetIds);
310 307
311 // Also clear the backed up client info. 308 // Also clear the backed up client info.
312 store_client_info_.Run(ClientInfo()); 309 store_client_info_.Run(ClientInfo());
313 } 310 }
314 311
315 } // namespace metrics 312 } // namespace metrics
OLDNEW
« no previous file with comments | « components/metrics/client_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698