From 6faa0e0d23ca6fc27ae603063ce23eb018a670cd Mon Sep 17 00:00:00 2001 From: "phajdan.jr@chromium.org" Date: Tue, 28 Apr 2009 06:50:36 +0000 Subject: ImportantFileWriter Introducing a class for writing important files, preventing their corruption during writing. Switched PrefService to use it. Other classes will be switched in future changesets. TEST=This may affect things using preferences. Make sure that changes in preferences don't get lost, and that you don't get excessive disk activity when changing preferences. http://crbug.com/10618 Review URL: http://codereview.chromium.org/83001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14717 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/profile.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'chrome/browser/profile.cc') diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index a234ac5..2a95f9e 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -573,7 +573,8 @@ SSLHostState* ProfileImpl::GetSSLHostState() { PrefService* ProfileImpl::GetPrefs() { if (!prefs_.get()) { - prefs_.reset(new PrefService(GetPrefFilePath())); + prefs_.reset(new PrefService(GetPrefFilePath(), + g_browser_process->file_thread())); // The Profile class and ProfileManager class may read some prefs so // register known prefs as soon as possible. @@ -587,7 +588,7 @@ PrefService* ProfileImpl::GetPrefs() { // Mark the session as open. prefs_->SetBoolean(prefs::kSessionExitedCleanly, false); // Make sure we save to disk that the session has opened. - prefs_->ScheduleSavePersistentPrefs(g_browser_process->file_thread()); + prefs_->ScheduleSavePersistentPrefs(); } return prefs_.get(); @@ -879,7 +880,7 @@ void ProfileImpl::MarkAsCleanShutdown() { // NOTE: If you change what thread this writes on, be sure and update // ChromeFrame::EndSession(). - prefs_->SavePersistentPrefs(g_browser_process->file_thread()); + prefs_->SavePersistentPrefs(); } } -- cgit v1.1