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

Unified Diff: base/prefs/json_pref_store.h

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
« no previous file with comments | « no previous file | base/prefs/json_pref_store.cc » ('j') | chrome/browser/profiles/profile_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/json_pref_store.h
diff --git a/base/prefs/json_pref_store.h b/base/prefs/json_pref_store.h
index 3ed1ffb13301761809cfc5a707edc8c60c2c9ffa..e818f9baca2246daf10e2b0b8103b0373fb0bd89 100644
--- a/base/prefs/json_pref_store.h
+++ b/base/prefs/json_pref_store.h
@@ -18,7 +18,8 @@
namespace base {
class DictionaryValue;
-class MessageLoopProxy;
+class SequencedWorkerPool;
+class SequencedTaskRunner;
class Value;
}
@@ -28,10 +29,16 @@ class FilePath;
class JsonPrefStore : public PersistentPrefStore,
public ImportantFileWriter::DataSerializer {
public:
- // |file_message_loop_proxy| is the MessageLoopProxy for a thread on which
- // file I/O can be done.
+ // Returns instance of SequencedTaskRunner which guarantees that file
+ // operations on the same file will be executed in sequenced order.
+ static scoped_refptr<base::SequencedTaskRunner> GetTaskRunnerForFile(
+ const FilePath& pref_filename,
+ base::SequencedWorkerPool* worker_pool);
+
+ // |sequenced_task_runner| is must be a shutdown-blocking task runner, ideally
+ // created by GetTaskRunnerForFile() method above.
JsonPrefStore(const FilePath& pref_filename,
- base::MessageLoopProxy* file_message_loop_proxy);
+ base::SequencedTaskRunner* sequenced_task_runner);
// PrefStore overrides:
virtual ReadResult GetValue(const std::string& key,
@@ -69,7 +76,7 @@ class JsonPrefStore : public PersistentPrefStore,
virtual bool SerializeData(std::string* output) OVERRIDE;
FilePath path_;
- scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy_;
+ const scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_;
scoped_ptr<base::DictionaryValue> prefs_;
« no previous file with comments | « no previous file | base/prefs/json_pref_store.cc » ('j') | chrome/browser/profiles/profile_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698