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 a6c236261ba5d4426f2cff61bf398b8330302a9c..3eebff1486350dc5e8ed4be721716a6dc25a474c 100644 |
| --- a/base/prefs/json_pref_store.cc |
| +++ b/base/prefs/json_pref_store.cc |
| @@ -297,8 +297,6 @@ void JsonPrefStore::RegisterOnNextSuccessfulWriteCallback( |
| void JsonPrefStore::OnFileRead(scoped_ptr<base::Value> value, |
| PersistentPrefStore::PrefReadError error, |
| bool no_dir) { |
| - scoped_ptr<base::DictionaryValue> unfiltered_prefs(new base::DictionaryValue); |
| - |
| read_error_ = error; |
| bool initialization_successful = !no_dir; |
| @@ -314,8 +312,7 @@ void JsonPrefStore::OnFileRead(scoped_ptr<base::Value> value, |
| break; |
| case PREF_READ_ERROR_NONE: |
| DCHECK(value.get()); |
| - unfiltered_prefs.reset( |
| - static_cast<base::DictionaryValue*>(value.release())); |
| + prefs_.reset(static_cast<base::DictionaryValue*>(value.release())); |
| break; |
| case PREF_READ_ERROR_NO_FILE: |
| // If the file just doesn't exist, maybe this is first run. In any case |
| @@ -346,10 +343,9 @@ void JsonPrefStore::OnFileRead(scoped_ptr<base::Value> value, |
| const PrefFilter::PostFilterOnLoadCallback post_filter_on_load_callback( |
| base::Bind( |
| &JsonPrefStore::FinalizeFileRead, this, initialization_successful)); |
|
gab
2014/06/11 21:12:55
For context for Bernhard:
this CL is okay in the
|
| - pref_filter_->FilterOnLoad(post_filter_on_load_callback, |
| - unfiltered_prefs.Pass()); |
| + pref_filter_->FilterOnLoad(post_filter_on_load_callback, prefs_.get()); |
| } else { |
| - FinalizeFileRead(initialization_successful, unfiltered_prefs.Pass(), false); |
| + FinalizeFileRead(initialization_successful, false); |
| } |
| } |
| @@ -367,7 +363,6 @@ bool JsonPrefStore::SerializeData(std::string* output) { |
| } |
| void JsonPrefStore::FinalizeFileRead(bool initialization_successful, |
| - scoped_ptr<base::DictionaryValue> prefs, |
| bool schedule_write) { |
| filtering_in_progress_ = false; |
| @@ -378,8 +373,6 @@ void JsonPrefStore::FinalizeFileRead(bool initialization_successful, |
| return; |
| } |
| - prefs_ = prefs.Pass(); |
| - |
| initialized_ = true; |
| if (schedule_write && !read_only_) |