Chromium Code Reviews| 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( |