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

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

Issue 16270: Change the signature of JSONReader::Read() and related methods to be more (Closed)
Patch Set: fixens Created 12 years 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/extensions_service.cc
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index cd0397ca6b27860f4033a47127cb79744c2ec03a..f38ff0438d5e9418dffa6569674d1b11610c64a1 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -88,15 +88,14 @@ bool ExtensionsServiceBackend::LoadExtensionsFromDirectory(
}
JSONFileValueSerializer serializer(manifest_path.ToWStringHack());
- Value* root = NULL;
std::string error;
- if (!serializer.Deserialize(&root, &error)) {
+ scoped_ptr<Value> root(serializer.Deserialize(&error));
+ if (!root.get()) {
ReportExtensionLoadError(frontend.get(), child_path.ToWStringHack(),
error);
continue;
}
- scoped_ptr<Value> scoped_root(root);
if (!root->IsType(Value::TYPE_DICTIONARY)) {
ReportExtensionLoadError(frontend.get(), child_path.ToWStringHack(),
Extension::kInvalidManifestError);
@@ -104,7 +103,7 @@ bool ExtensionsServiceBackend::LoadExtensionsFromDirectory(
}
scoped_ptr<Extension> extension(new Extension(child_path));
- if (!extension->InitFromValue(*static_cast<DictionaryValue*>(root),
+ if (!extension->InitFromValue(*static_cast<DictionaryValue*>(root.get()),
&error)) {
ReportExtensionLoadError(frontend.get(), child_path.ToWStringHack(),
error);

Powered by Google App Engine
This is Rietveld 408576698