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

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: 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') | chrome/common/chrome_constants.h » ('J')
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..f0933caf4529276597c05c9fc20eeffdb33e275f 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 prefs
+ // could be read from. If |pref_filename| exists, |pref_alternate_filename|
Bernhard Bauer 2014/06/19 15:38:09 Why do we delete the alternate pref file if the pr
gab 2014/06/19 16:03:51 The alternate pref file is the old name of the fil
Bernhard Bauer 2014/06/19 17:20:20 Yeah, I'm just a bit wary of deleting a file that
gab 2014/06/19 17:50:10 I'm not really worried of this assumption being in
Bernhard Bauer 2014/06/20 14:16:28 See, my immediate reaction to that would be to tou
gab 2014/06/20 14:48:28 Thanks, as discussed this shouldn't happen in norm
+ // will be deleted; otherwise, |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') | chrome/common/chrome_constants.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698