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

Unified Diff: chrome/common/important_file_writer.cc

Issue 11027070: Moved JsonPrefStore to use SequencedWorkerPool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/common/important_file_writer.cc
diff --git a/chrome/common/important_file_writer.cc b/chrome/common/important_file_writer.cc
index 6a76dfbb362b83776d0c8f37e0d2bc5176e039df..c77c96f4f64fbd7230a14759600c55a9c3b1b0c2 100644
--- a/chrome/common/important_file_writer.cc
+++ b/chrome/common/important_file_writer.cc
@@ -12,7 +12,7 @@
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/logging.h"
-#include "base/message_loop_proxy.h"
+#include "base/task_runner.h"
akalin 2012/10/19 02:00:51 sequenced_task_runner
#include "base/metrics/histogram.h"
#include "base/string_number_conversions.h"
#include "base/threading/thread.h"
@@ -89,14 +89,14 @@ void WriteToDiskTask(const FilePath& path, const std::string& data) {
} // namespace
ImportantFileWriter::ImportantFileWriter(
- const FilePath& path, base::MessageLoopProxy* file_message_loop_proxy)
+ const FilePath& path, base::SequencedTaskRunner* task_runner)
: path_(path),
- file_message_loop_proxy_(file_message_loop_proxy),
+ task_runner_(task_runner),
serializer_(NULL),
commit_interval_(TimeDelta::FromMilliseconds(
kDefaultCommitIntervalMs)) {
DCHECK(CalledOnValidThread());
- DCHECK(file_message_loop_proxy_.get());
+ DCHECK(task_runner_.get());
}
ImportantFileWriter::~ImportantFileWriter() {
@@ -121,7 +121,7 @@ void ImportantFileWriter::WriteNow(const std::string& data) {
if (HasPendingWrite())
timer_.Stop();
- if (!file_message_loop_proxy_->PostTask(
+ if (!task_runner_->PostTask(
FROM_HERE, base::Bind(&WriteToDiskTask, path_, data))) {
akalin 2012/10/19 02:00:51 fix indent here
zel 2012/10/19 18:45:07 Done.
// Posting the task to background message loop is not expected
// to fail, but if it does, avoid losing data and just hit the disk

Powered by Google App Engine
This is Rietveld 408576698