Index: chrome/common/json_pref_store.h |
diff --git a/chrome/common/json_pref_store.h b/chrome/common/json_pref_store.h |
index 7ceb7dad2ac0c472e51a1405e58861e6fd6ad93a..0b9fcbf891215a4c26e68e79303d960e03ad8457 100644 |
--- a/chrome/common/json_pref_store.h |
+++ b/chrome/common/json_pref_store.h |
@@ -18,7 +18,8 @@ |
namespace base { |
class DictionaryValue; |
-class MessageLoopProxy; |
+class SequencedWorkerPool; |
+class SequencedTaskRunner; |
class Value; |
} |
@@ -28,10 +29,11 @@ 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. |
- JsonPrefStore(const FilePath& pref_filename, |
- base::MessageLoopProxy* file_message_loop_proxy); |
+ // |worker_pool| is the SequencedWorkerPool on which file I/O can be done. |
+ // The worker pool will also ensure that write requests for the same file are |
+ // sequenced properly and that such requests block shutdown. |
+ static JsonPrefStore* Create(const FilePath& pref_filename, |
+ base::SequencedWorkerPool* worker_pool); |
// PrefStore overrides: |
virtual ReadResult GetValue(const std::string& key, |
@@ -63,13 +65,16 @@ class JsonPrefStore : public PersistentPrefStore, |
void OnFileRead(base::Value* value_owned, PrefReadError error, bool no_dir); |
private: |
+ // |task_runner| is the TaskRunner for a thread on which file I/O can be done. |
+ JsonPrefStore(const FilePath& pref_filename, |
+ base::SequencedTaskRunner* sequenced_task_runner); |
virtual ~JsonPrefStore(); |
// ImportantFileWriter::DataSerializer overrides: |
virtual bool SerializeData(std::string* output) OVERRIDE; |
FilePath path_; |
- scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy_; |
+ scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_; |
scoped_ptr<base::DictionaryValue> prefs_; |