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

Unified Diff: chrome/browser/extensions/external_pref_loader.cc

Issue 1394993004: Make ValueDeserializer::Deserialize return scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
Index: chrome/browser/extensions/external_pref_loader.cc
diff --git a/chrome/browser/extensions/external_pref_loader.cc b/chrome/browser/extensions/external_pref_loader.cc
index c0775d2de2c070883bf455ea2cf1fdded82d4279..a019ec5fd91ee8498bd9e3e3b880b38b98698088 100644
--- a/chrome/browser/extensions/external_pref_loader.cc
+++ b/chrome/browser/extensions/external_pref_loader.cc
@@ -76,7 +76,8 @@ base::DictionaryValue* ExtractExtensionPrefs(
base::ValueDeserializer* deserializer,
const base::FilePath& path) {
std::string error_msg;
- base::Value* extensions = deserializer->Deserialize(NULL, &error_msg);
+ scoped_ptr<base::Value> extensions =
+ deserializer->Deserialize(NULL, &error_msg);
if (!extensions) {
LOG(WARNING) << "Unable to deserialize json data: " << error_msg
<< " in file " << path.value() << ".";
@@ -84,8 +85,10 @@ base::DictionaryValue* ExtractExtensionPrefs(
}
base::DictionaryValue* ext_dictionary = NULL;
- if (extensions->GetAsDictionary(&ext_dictionary))
+ if (extensions->GetAsDictionary(&ext_dictionary)) {
+ base::IgnoreResult(extensions.release());
return ext_dictionary;
+ }
LOG(WARNING) << "Expected a JSON dictionary in file "
<< path.value() << ".";

Powered by Google App Engine
This is Rietveld 408576698