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

Unified Diff: base/prefs/json_pref_store.cc

Issue 836093005: Remove dead code related to base::JsonPrefStore without a path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved DCHECK to constructors. Created 5 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/json_pref_store.cc
diff --git a/base/prefs/json_pref_store.cc b/base/prefs/json_pref_store.cc
index d4714037c0137ad0df0a3c7a081fde00edcfaa1f..e35ed295d699b68ffe50d707d1864b8dcc046125 100644
--- a/base/prefs/json_pref_store.cc
+++ b/base/prefs/json_pref_store.cc
@@ -137,6 +137,7 @@ JsonPrefStore::JsonPrefStore(
initialized_(false),
filtering_in_progress_(false),
read_error_(PREF_READ_ERROR_NONE) {
+ DCHECK(!path_.empty());
}
JsonPrefStore::JsonPrefStore(
@@ -154,6 +155,7 @@ JsonPrefStore::JsonPrefStore(
initialized_(false),
filtering_in_progress_(false),
read_error_(PREF_READ_ERROR_NONE) {
+ DCHECK(!path_.empty());
}
bool JsonPrefStore::GetValue(const std::string& key,
@@ -258,13 +260,6 @@ PersistentPrefStore::PrefReadError JsonPrefStore::GetReadError() const {
PersistentPrefStore::PrefReadError JsonPrefStore::ReadPrefs() {
DCHECK(CalledOnValidThread());
- if (path_.empty()) {
- scoped_ptr<ReadResult> no_file_result;
- no_file_result->error = PREF_READ_ERROR_FILE_NOT_SPECIFIED;
- OnFileRead(no_file_result.Pass());
- return PREF_READ_ERROR_FILE_NOT_SPECIFIED;
- }
-
OnFileRead(ReadPrefsFromDisk(path_, alternate_path_));
return filtering_in_progress_ ? PREF_READ_ERROR_ASYNCHRONOUS_TASK_INCOMPLETE
: read_error_;
@@ -275,12 +270,6 @@ void JsonPrefStore::ReadPrefsAsync(ReadErrorDelegate* error_delegate) {
initialized_ = false;
error_delegate_.reset(error_delegate);
- if (path_.empty()) {
- scoped_ptr<ReadResult> no_file_result;
- no_file_result->error = PREF_READ_ERROR_FILE_NOT_SPECIFIED;
- OnFileRead(no_file_result.Pass());
- return;
- }
// Weakly binds the read task so that it doesn't kick in during shutdown.
base::PostTaskAndReplyWithResult(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698