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

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 todo about not failed trybot 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
« no previous file with comments | « extensions/browser/image_loader_unittest.cc ('k') | extensions/common/file_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c4ebbe993220bf45ab74fbc0d9c6ea2604eb93d5 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::DictionaryValue> dictionary = base::DictionaryValue::From(
+ 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 dictionary.release();
}
// Localizes manifest value of string type for a given key.
« no previous file with comments | « extensions/browser/image_loader_unittest.cc ('k') | extensions/common/file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698