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

Unified Diff: components/prefs/json_pref_store.cc

Issue 2751603002: Remove the alternative preferences filename from JsonPrefStore. (Closed)
Patch Set: Created 3 years, 9 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 | « components/prefs/json_pref_store.h ('k') | components/prefs/json_pref_store_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/prefs/json_pref_store.cc
diff --git a/components/prefs/json_pref_store.cc b/components/prefs/json_pref_store.cc
index a9a39227d3fef97904abee35390c2fc54dc30ceb..cf4d2a352cc52b45d55a7c029242586fda55c829 100644
--- a/components/prefs/json_pref_store.cc
+++ b/components/prefs/json_pref_store.cc
@@ -111,13 +111,7 @@ void RecordJsonDataSizeHistogram(const base::FilePath& path, size_t size) {
}
std::unique_ptr<JsonPrefStore::ReadResult> ReadPrefsFromDisk(
- const base::FilePath& path,
- const base::FilePath& alternate_path) {
- if (!base::PathExists(path) && !alternate_path.empty() &&
- base::PathExists(alternate_path)) {
- base::Move(alternate_path, path);
- }
-
+ const base::FilePath& path) {
int error_code;
std::string error_msg;
std::unique_ptr<JsonPrefStore::ReadResult> read_result(
@@ -151,18 +145,7 @@ JsonPrefStore::JsonPrefStore(
const base::FilePath& pref_filename,
const scoped_refptr<base::SequencedTaskRunner>& sequenced_task_runner,
std::unique_ptr<PrefFilter> pref_filter)
- : JsonPrefStore(pref_filename,
- base::FilePath(),
- sequenced_task_runner,
- std::move(pref_filter)) {}
-
-JsonPrefStore::JsonPrefStore(
- const base::FilePath& pref_filename,
- const base::FilePath& pref_alternate_filename,
- const scoped_refptr<base::SequencedTaskRunner>& sequenced_task_runner,
- std::unique_ptr<PrefFilter> pref_filter)
: path_(pref_filename),
- alternate_path_(pref_alternate_filename),
sequenced_task_runner_(sequenced_task_runner),
prefs_(new base::DictionaryValue()),
read_only_(false),
@@ -283,7 +266,7 @@ PersistentPrefStore::PrefReadError JsonPrefStore::GetReadError() const {
PersistentPrefStore::PrefReadError JsonPrefStore::ReadPrefs() {
DCHECK(CalledOnValidThread());
- OnFileRead(ReadPrefsFromDisk(path_, alternate_path_));
+ OnFileRead(ReadPrefsFromDisk(path_));
return filtering_in_progress_ ? PREF_READ_ERROR_ASYNCHRONOUS_TASK_INCOMPLETE
: read_error_;
}
@@ -296,9 +279,8 @@ void JsonPrefStore::ReadPrefsAsync(ReadErrorDelegate* error_delegate) {
// Weakly binds the read task so that it doesn't kick in during shutdown.
base::PostTaskAndReplyWithResult(
- sequenced_task_runner_.get(),
- FROM_HERE,
- base::Bind(&ReadPrefsFromDisk, path_, alternate_path_),
+ sequenced_task_runner_.get(), FROM_HERE,
+ base::Bind(&ReadPrefsFromDisk, path_),
base::Bind(&JsonPrefStore::OnFileRead, AsWeakPtr()));
}
« no previous file with comments | « components/prefs/json_pref_store.h ('k') | components/prefs/json_pref_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698