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

Unified Diff: extensions/common/extension_l10n_util.cc

Issue 1394993004: Make ValueDeserializer::Deserialize return scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix and add ::From 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: extensions/common/extension_l10n_util.cc
diff --git a/extensions/common/extension_l10n_util.cc b/extensions/common/extension_l10n_util.cc
index dd96b07d2e66ec911f4beb9ecb7f0bdf798044d5..86d8fb394411d07053fabf69ecfee23a36f8ca28 100644
--- a/extensions/common/extension_l10n_util.cc
+++ b/extensions/common/extension_l10n_util.cc
@@ -39,7 +39,8 @@ base::DictionaryValue* LoadMessageFile(const base::FilePath& locale_path,
base::FilePath file =
locale_path.AppendASCII(locale).Append(extensions::kMessagesFilename);
JSONFileValueDeserializer messages_deserializer(file);
- base::Value* dictionary = messages_deserializer.Deserialize(NULL, error);
+ scoped_ptr<base::Value> dictionary =
Lei Zhang 2015/10/14 16:55:35 Let's use DictionaryValue::From() to help do the e
+ messages_deserializer.Deserialize(NULL, error);
if (!dictionary) {
if (error->empty()) {
// JSONFileValueSerializer just returns NULL if file cannot be found. It
@@ -54,7 +55,7 @@ base::DictionaryValue* LoadMessageFile(const base::FilePath& locale_path,
}
}
- return static_cast<base::DictionaryValue*>(dictionary);
+ return static_cast<base::DictionaryValue*>(dictionary.release());
}
// Localizes manifest value of string type for a given key.

Powered by Google App Engine
This is Rietveld 408576698