diff options
author | bratell <bratell@opera.com> | 2015-01-07 08:40:58 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-07 16:42:02 +0000 |
commit | 970f39d3eeac9baa033a48dfe3310df8e388c68f (patch) | |
tree | a65fc94314b4e008b6210ff21a32867e5fd809bf /base | |
parent | b983d4b721828bec761e2a1c93af33a3af3757a1 (diff) | |
download | chromium_src-970f39d3eeac9baa033a48dfe3310df8e388c68f.zip chromium_src-970f39d3eeac9baa033a48dfe3310df8e388c68f.tar.gz chromium_src-970f39d3eeac9baa033a48dfe3310df8e388c68f.tar.bz2 |
Nobody uses base::JsonPrefStore::ReadResult without a path
and if they had tried it, it would have crashed.
This removes the code that tried to support non-path
JsonPrefStore and adds a DCHECK in the constructor in case
it happens in the future.
If the code is ever needed in the future, the
scoped_ptr<ReadResult> need to be initialized
with new ReadResult.
BUG=
R=bauerb@chromium.org
Review URL: https://codereview.chromium.org/836093005
Cr-Commit-Position: refs/heads/master@{#310300}
Diffstat (limited to 'base')
-rw-r--r-- | base/prefs/json_pref_store.cc | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/base/prefs/json_pref_store.cc b/base/prefs/json_pref_store.cc index d471403..e35ed29 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( |