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

Unified Diff: chrome/common/important_file_writer.cc

Issue 10384047: Revert 135222 - it broke multiprofile tests - Use worker pool for IO in JsonPrefStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « chrome/common/important_file_writer.h ('k') | chrome/common/json_pref_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/important_file_writer.cc
===================================================================
--- chrome/common/important_file_writer.cc (revision 135722)
+++ chrome/common/important_file_writer.cc (working copy)
@@ -89,15 +89,14 @@
} // namespace
ImportantFileWriter::ImportantFileWriter(
- const FilePath& path,
- base::SequencedTaskRunner* blocking_task_runner)
- : path_(path),
- blocking_task_runner_(blocking_task_runner),
- serializer_(NULL),
- commit_interval_(TimeDelta::FromMilliseconds(
- kDefaultCommitIntervalMs)) {
+ const FilePath& path, base::MessageLoopProxy* file_message_loop_proxy)
+ : path_(path),
+ file_message_loop_proxy_(file_message_loop_proxy),
+ serializer_(NULL),
+ commit_interval_(TimeDelta::FromMilliseconds(
+ kDefaultCommitIntervalMs)) {
DCHECK(CalledOnValidThread());
- DCHECK(blocking_task_runner_.get());
+ DCHECK(file_message_loop_proxy_.get());
}
ImportantFileWriter::~ImportantFileWriter() {
@@ -122,7 +121,7 @@
if (HasPendingWrite())
timer_.Stop();
- if (!blocking_task_runner_->PostTask(
+ if (!file_message_loop_proxy_->PostTask(
FROM_HERE, base::Bind(&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
« no previous file with comments | « chrome/common/important_file_writer.h ('k') | chrome/common/json_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698