Chromium Code Reviews| Index: extensions/common/features/base_feature_provider.cc |
| diff --git a/extensions/common/features/base_feature_provider.cc b/extensions/common/features/base_feature_provider.cc |
| index 97f87bedb34f278dc732cb4b1fb6fdf8ff09b888..63ef5b611b71a68be254af8c30eb969e03c62ac6 100644 |
| --- a/extensions/common/features/base_feature_provider.cc |
| +++ b/extensions/common/features/base_feature_provider.cc |
| @@ -17,6 +17,17 @@ namespace extensions { |
| namespace { |
| +bool IsNocompile(const base::Value& value) { |
| + bool nocompile = false; |
| + const base::DictionaryValue* as_dict = NULL; |
|
Marijn Kruisselbrink
2015/01/13 01:06:10
nullptr is recommended over NULL for new code
not at google - send to devlin
2015/01/13 01:14:52
Done. It irritated me having one instance of nullp
|
| + if (value.GetAsDictionary(&as_dict)) { |
| + as_dict->GetBoolean("nocompile", &nocompile); |
|
Marijn Kruisselbrink
2015/01/13 01:06:10
Would it make sense to DCHECK for the situation wh
not at google - send to devlin
2015/01/13 01:14:52
Eh... it adds 2 lines of code, and we don't check
Marijn Kruisselbrink
2015/01/13 01:19:59
Okay, makes sense. Yeah, it seems a bit arbitrary
|
| + } else { |
| + NOTREACHED() << "nocompile only supported for simple features"; |
| + } |
| + return nocompile; |
| +} |
| + |
| bool ParseFeature(const base::DictionaryValue* value, |
| const std::string& name, |
| SimpleFeature* feature) { |
| @@ -34,6 +45,10 @@ BaseFeatureProvider::BaseFeatureProvider(const base::DictionaryValue& root, |
| : factory_(factory) { |
| for (base::DictionaryValue::Iterator iter(root); !iter.IsAtEnd(); |
| iter.Advance()) { |
| + if (IsNocompile(iter.value())) { |
| + continue; |
| + } |
| + |
| if (iter.value().GetType() == base::Value::TYPE_DICTIONARY) { |
| linked_ptr<SimpleFeature> feature((*factory_)()); |