Chromium Code Reviews| 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..64822e1431a34891d9900d0c1403339828a03704 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 request block shutdown. |
|
akalin
2012/10/10 01:43:16
request -> requests
zel
2012/10/10 23:25:00
Done.
|
| + static JsonPrefStore* Create(const FilePath& pref_filename, |
|
akalin
2012/10/10 01:43:16
return scoped_ptr?
|
| + 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* 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> task_runner_; |
|
akalin
2012/10/10 01:43:16
make this const
zel
2012/10/10 23:25:00
that's not going to work since we use non-const me
akalin
2012/10/12 19:23:57
I meant make the pointer const, like:
'const scop
|
| scoped_ptr<base::DictionaryValue> prefs_; |