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

Unified Diff: base/prefs/json_pref_store.h

Issue 347793002: Expand the JsonPrefStore's interface to allow for an alternate filename to be specified. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Dont even attempt to delete the alternate file in unexpected situations. Created 6 years, 6 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') | no next file with comments »
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 49e74ee23a5c5273999354634c2d99b2a1c7ae8b..6ceea6885487a0c73c2910312de60eee7a25a099 100644
--- a/base/prefs/json_pref_store.h
+++ b/base/prefs/json_pref_store.h
@@ -43,12 +43,23 @@ class BASE_PREFS_EXPORT JsonPrefStore
const base::FilePath& pref_filename,
base::SequencedWorkerPool* worker_pool);
- // |sequenced_task_runner| is must be a shutdown-blocking task runner, ideally
- // created by GetTaskRunnerForFile() method above.
+ // Same as the constructor below with no alternate filename.
JsonPrefStore(const base::FilePath& pref_filename,
base::SequencedTaskRunner* sequenced_task_runner,
scoped_ptr<PrefFilter> pref_filter);
+ // |sequenced_task_runner| must be a shutdown-blocking task runner, ideally
+ // created by the GetTaskRunnerForFile() method above.
+ // |pref_filename| is the path to the file to read prefs from.
+ // |pref_alternate_filename| is the path to an alternate file which the
+ // desired prefs may have previously been written to. If |pref_filename|
+ // doesn't exist and |pref_alternate_filename| does, |pref_alternate_filename|
+ // will be moved to |pref_filename| before the read occurs.
+ JsonPrefStore(const base::FilePath& pref_filename,
+ const base::FilePath& pref_alternate_filename,
+ base::SequencedTaskRunner* sequenced_task_runner,
+ scoped_ptr<PrefFilter> pref_filter);
+
// PrefStore overrides:
virtual bool GetValue(const std::string& key,
const base::Value** result) const OVERRIDE;
@@ -115,7 +126,8 @@ class BASE_PREFS_EXPORT JsonPrefStore
scoped_ptr<base::DictionaryValue> prefs,
bool schedule_write);
- base::FilePath path_;
+ const base::FilePath path_;
+ const base::FilePath alternate_path_;
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698