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

Unified Diff: chrome/common/extensions/api/extension_api.cc

Issue 21030009: Make element removal methods in DictionaryValue and ListValue take scoped_ptr's as outparams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 7 years, 4 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/common/extensions/api/extension_api.cc
diff --git a/chrome/common/extensions/api/extension_api.cc b/chrome/common/extensions/api/extension_api.cc
index 360db623195d989c2b0d77ce29d61677cf27061a..56c44b5541d8f6d2f353f4e059374b45a85efe3b 100644
--- a/chrome/common/extensions/api/extension_api.cc
+++ b/chrome/common/extensions/api/extension_api.cc
@@ -204,10 +204,9 @@ void ExtensionAPI::LoadSchema(const std::string& name,
while (!schema_list->empty()) {
base::DictionaryValue* schema = NULL;
{
- base::Value* value = NULL;
+ scoped_ptr<base::Value> value;
schema_list->Remove(schema_list->GetSize() - 1, &value);
- CHECK(value->IsType(base::Value::TYPE_DICTIONARY));
- schema = static_cast<base::DictionaryValue*>(value);
+ CHECK(value.release()->GetAsDictionary(&schema));
}
CHECK(schema->GetString("namespace", &schema_namespace));
« no previous file with comments | « chrome/browser/value_store/value_store_frontend.cc ('k') | chrome/test/automation/automation_json_requests.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698