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

Unified Diff: chrome/browser/metrics/metrics_service.cc

Issue 8198007: Remove PrefService::ScheduleSavePersistentPrefs and SavePersistentPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos Created 9 years, 2 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
Index: chrome/browser/metrics/metrics_service.cc
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index 2d21539ed3af536ee83fd6a4dc29bb8e7dc3e011..cd57f9a18c02da0291e254850cddd55a7238c9dd 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -770,7 +770,6 @@ void MetricsService::SaveLocalState() {
}
RecordCurrentState(pref);
- pref->ScheduleSavePersistentPrefs();
// TODO(jar): Does this run down the batteries????
ScheduleNextStateSave();
@@ -1121,11 +1120,6 @@ void MetricsService::OnURLFetchComplete(const URLFetcher* source,
}
log_manager_.DiscardStagedLog();
- // Since we sent a log, make sure our in-memory state is recorded to disk.
- PrefService* local_state = g_browser_process->local_state();
- DCHECK(local_state);
- if (local_state)
- local_state->ScheduleSavePersistentPrefs();
if (log_manager_.has_unsent_logs())
DCHECK(state_ < SENDING_CURRENT_LOGS);
@@ -1293,7 +1287,7 @@ void MetricsService::LogCleanShutdown() {
// Redundant hack to write pref ASAP.
PrefService* pref = g_browser_process->local_state();
pref->SetBoolean(prefs::kStabilityExitedCleanly, true);
- pref->SavePersistentPrefs();
+ pref->CommitPendingWrite();
// Hack: TBD: Remove this wait.
// We are so concerned that the pref gets written, we are now willing to stall
// the UI thread until we get assurance that a pref-writing task has

Powered by Google App Engine
This is Rietveld 408576698