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

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

Issue 10837044: Correct const accessors in base/values.(h|cc), Part II (ListValue) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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 8f5e9272df9c1617d5dfc380ec4147a4225f6a58..7c37eb50c89c3fbfe179e69dc40093b0b221fef0 100644
--- a/chrome/common/extensions/api/extension_api.cc
+++ b/chrome/common/extensions/api/extension_api.cc
@@ -55,7 +55,7 @@ bool HasUnprivilegedChild(const DictionaryValue* name_space_node,
if (name_space_node->GetList(child_kind, &child_list)) {
for (size_t i = 0; i < child_list->GetSize(); ++i) {
- DictionaryValue* item = NULL;
+ const DictionaryValue* item = NULL;
CHECK(child_list->GetDictionary(i, &item));
if (IsUnprivileged(item))
return true;
@@ -100,11 +100,11 @@ scoped_ptr<ListValue> LoadSchemaList(const std::string& name,
return scoped_ptr<ListValue>(static_cast<ListValue*>(result.release()));
}
-DictionaryValue* FindListItem(const ListValue* list,
- const std::string& property_name,
- const std::string& property_value) {
+const DictionaryValue* FindListItem(const ListValue* list,
+ const std::string& property_name,
+ const std::string& property_value) {
for (size_t i = 0; i < list->GetSize(); ++i) {
- DictionaryValue* item = NULL;
+ const DictionaryValue* item = NULL;
CHECK(list->GetDictionary(i, &item))
<< property_value << "/" << property_name;
std::string value;
@@ -117,7 +117,7 @@ DictionaryValue* FindListItem(const ListValue* list,
const DictionaryValue* GetSchemaChild(const DictionaryValue* schema_node,
const std::string& child_name) {
- DictionaryValue* child_node = NULL;
+ const DictionaryValue* child_node = NULL;
for (size_t i = 0; i < arraysize(kChildKinds); ++i) {
const ListValue* list_node = NULL;
if (!schema_node->GetList(kChildKinds[i], &list_node))

Powered by Google App Engine
This is Rietveld 408576698