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_; |