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

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, 1 month 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
Index: base/prefs/json_pref_store.h
diff --git a/base/prefs/json_pref_store.h b/base/prefs/json_pref_store.h
index 5ae1ca05e336adb0a5de2e29bbd8fae06db108a0..7a75d4cc8fbc834cda6987a3541c144567503505 100644
--- a/base/prefs/json_pref_store.h
+++ b/base/prefs/json_pref_store.h
@@ -20,7 +20,8 @@
namespace base {
class DictionaryValue;
-class MessageLoopProxy;
+class SequencedWorkerPool;
+class SequencedTaskRunner;
class Value;
}
@@ -31,10 +32,16 @@ class BASE_PREFS_EXPORT JsonPrefStore
: public PersistentPrefStore,
public base::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,
@@ -72,7 +79,7 @@ class BASE_PREFS_EXPORT JsonPrefStore
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_;

Powered by Google App Engine
This is Rietveld 408576698