Chromium Code Reviews| Index: extensions/common/manifest.cc |
| diff --git a/extensions/common/manifest.cc b/extensions/common/manifest.cc |
| index 112628f77efc3dfd2e6cf112d6866d6781ea915a..41b32175ca2560b24d46bc7aae6806ec6873702d 100644 |
| --- a/extensions/common/manifest.cc |
| +++ b/extensions/common/manifest.cc |
| @@ -146,20 +146,15 @@ bool Manifest::ValidateManifest( |
| const FeatureProvider* manifest_feature_provider = |
| FeatureProvider::GetManifestFeatures(); |
| - const std::vector<std::string>& feature_names = |
| - manifest_feature_provider->GetAllFeatureNames(); |
| - for (std::vector<std::string>::const_iterator feature_name = |
| - feature_names.begin(); |
| - feature_name != feature_names.end(); ++feature_name) { |
| + for (const auto& feature : manifest_feature_provider->GetAllFeatures()) { |
|
Devlin
2016/03/07 17:35:32
nit: calling this "feature" is a little misleading
limasdf
2016/03/08 01:18:20
Done.
I used "map_entry" which is more generally b
|
| // Use Get instead of HasKey because the former uses path expansion. |
| - if (!value_->Get(*feature_name, NULL)) |
| + if (!value_->Get(feature.first, nullptr)) |
| continue; |
| - Feature* feature = manifest_feature_provider->GetFeature(*feature_name); |
| - Feature::Availability result = feature->IsAvailableToManifest( |
| + Feature::Availability result = feature.second->IsAvailableToManifest( |
| extension_id_, type_, location_, GetManifestVersion()); |
| if (!result.is_available()) |
| - warnings->push_back(InstallWarning(result.message(), *feature_name)); |
| + warnings->push_back(InstallWarning(result.message(), feature.first)); |
| } |
| // Also generate warnings for keys that are not features. |