summaryrefslogtreecommitdiffstats
path: root/chrome/common/important_file_writer.cc
diff options
context:
space:
mode:
authordilmah@chromium.org <dilmah@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 10:59:56 +0000
committerdilmah@chromium.org <dilmah@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 10:59:56 +0000
commit3826fed1adbc6a70f55696e0e4404862906a6c97 (patch)
tree3bc6ea1761aa4aeff79c3984a63879db61636325 /chrome/common/important_file_writer.cc
parentb22d9b8f0dc653557e962708b52a35ff593471b4 (diff)
downloadchromium_src-3826fed1adbc6a70f55696e0e4404862906a6c97.zip
chromium_src-3826fed1adbc6a70f55696e0e4404862906a6c97.tar.gz
chromium_src-3826fed1adbc6a70f55696e0e4404862906a6c97.tar.bz2
Provide lazy CommitPendingWrites in addition to eager SavePersistentPrefs.
We need to land pending writes to disk before doing chromeos::RestartJob. However SavePersistentPrefs is not lazy and takes time even if there is nothing to write. Fix it. BUG=chromium-os:13102,chromium-os:6924 TEST=Manual Review URL: http://codereview.chromium.org/6713032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79387 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/important_file_writer.cc')
-rw-r--r--chrome/common/important_file_writer.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/common/important_file_writer.cc b/chrome/common/important_file_writer.cc
index f5c5fc1..e770678 100644
--- a/chrome/common/important_file_writer.cc
+++ b/chrome/common/important_file_writer.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -106,8 +106,8 @@ void ImportantFileWriter::WriteNow(const std::string& data) {
if (HasPendingWrite())
timer_.Stop();
- if (!file_message_loop_proxy_->PostTask(FROM_HERE,
- new WriteToDiskTask(path_, data))) {
+ if (!file_message_loop_proxy_->PostTask(
+ FROM_HERE, new WriteToDiskTask(path_, data))) {
// Posting the task to background message loop is not expected
// to fail, but if it does, avoid losing data and just hit the disk
// on the current thread.