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

Unified Diff: extensions/common/file_util.cc

Issue 1308013005: Add scoped_ptr-safe base::Value to Dictionary/List conversion functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made conversions static members. Created 5 years, 3 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/common/file_util.h ('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/file_util.cc
diff --git a/extensions/common/file_util.cc b/extensions/common/file_util.cc
index 53f2715426e93282b8074e4bbfe84d41e1e44234..b6156291ab792a7bbbd8c198ac379644bbfe7f17 100644
--- a/extensions/common/file_util.cc
+++ b/extensions/common/file_util.cc
@@ -194,8 +194,8 @@ scoped_refptr<Extension> LoadExtension(const base::FilePath& extension_path,
Manifest::Location location,
int flags,
std::string* error) {
- scoped_ptr<base::DictionaryValue> manifest(
- LoadManifest(extension_path, error));
+ scoped_ptr<base::DictionaryValue> manifest =
+ LoadManifest(extension_path, error);
if (!manifest.get())
return NULL;
if (!extension_l10n_util::LocalizeExtension(
@@ -216,12 +216,13 @@ scoped_refptr<Extension> LoadExtension(const base::FilePath& extension_path,
return extension;
}
-base::DictionaryValue* LoadManifest(const base::FilePath& extension_path,
- std::string* error) {
+scoped_ptr<base::DictionaryValue> LoadManifest(
+ const base::FilePath& extension_path,
+ std::string* error) {
return LoadManifest(extension_path, kManifestFilename, error);
}
-base::DictionaryValue* LoadManifest(
+scoped_ptr<base::DictionaryValue> LoadManifest(
const base::FilePath& extension_path,
const base::FilePath::CharType* manifest_filename,
std::string* error) {
@@ -252,7 +253,7 @@ base::DictionaryValue* LoadManifest(
return NULL;
}
- return static_cast<base::DictionaryValue*>(root.release());
+ return base::DictionaryValue::From(root.Pass());
}
bool ValidateExtension(const Extension* extension,
« no previous file with comments | « extensions/common/file_util.h ('k') | extensions/common/file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698