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

Unified Diff: extensions/renderer/argument_spec.cc

Issue 2438623002: [Extensions Bindings] Add APIBindingsSystem (Closed)
Patch Set: woot Created 4 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
Index: extensions/renderer/argument_spec.cc
diff --git a/extensions/renderer/argument_spec.cc b/extensions/renderer/argument_spec.cc
index 623f13587a4bd2a353ee27eb0f8a964e940184c5..f79ea8a9107f44cd2d1da2e4a275ba82ba7cac67 100644
--- a/extensions/renderer/argument_spec.cc
+++ b/extensions/renderer/argument_spec.cc
@@ -93,7 +93,13 @@ void ArgumentSpec::InitializeType(const base::DictionaryValue* dict) {
CHECK_GT(size, 0u);
for (size_t i = 0; i < size; ++i) {
std::string enum_value;
- CHECK(enums->GetString(i, &enum_value));
+ // Enum entries come in two versions: a list of possible strings, and
jbroman 2016/10/21 22:53:59 Could this and its unit test be in another CL? It
Devlin 2016/10/22 00:49:15 Sure, I'll pull them out. They're still needed he
+ // a dictionary with a field 'name'.
+ if (!enums->GetString(i, &enum_value)) {
+ const base::DictionaryValue* enum_value_dictionary = nullptr;
+ CHECK(enums->GetDictionary(i, &enum_value_dictionary));
+ CHECK(enum_value_dictionary->GetString("name", &enum_value));
+ }
enum_values_.insert(std::move(enum_value));
}
}

Powered by Google App Engine
This is Rietveld 408576698