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

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: Less code is better (removed instead of fixed). 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..9dedf17efebb930c7a23b9bc9728d24b3c212d85 100644
--- a/base/prefs/json_pref_store.cc
+++ b/base/prefs/json_pref_store.cc
@@ -257,13 +257,7 @@ 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;
- }
+ DCHECK(!path_.empty());
Bernhard Bauer 2015/01/07 11:01:03 Can we do this check at construction time?
Daniel Bratell 2015/01/07 13:44:34 Done.
OnFileRead(ReadPrefsFromDisk(path_, alternate_path_));
return filtering_in_progress_ ? PREF_READ_ERROR_ASYNCHRONOUS_TASK_INCOMPLETE
@@ -272,15 +266,10 @@ PersistentPrefStore::PrefReadError JsonPrefStore::ReadPrefs() {
void JsonPrefStore::ReadPrefsAsync(ReadErrorDelegate* error_delegate) {
DCHECK(CalledOnValidThread());
+ DCHECK(!path_.empty());
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