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

Unified Diff: extensions/common/manifest.cc

Issue 1772683002: FeatureProvider returns std::map instead of vector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 4 years, 9 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
« no previous file with comments | « extensions/common/features/feature_provider.h ('k') | extensions/renderer/api_definitions_natives.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/manifest.cc
diff --git a/extensions/common/manifest.cc b/extensions/common/manifest.cc
index 112628f77efc3dfd2e6cf112d6866d6781ea915a..8bc2e28ea858531a5a091f7ecc89e97bf0581793 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& map_entry : manifest_feature_provider->GetAllFeatures()) {
// Use Get instead of HasKey because the former uses path expansion.
- if (!value_->Get(*feature_name, NULL))
+ if (!value_->Get(map_entry.first, nullptr))
continue;
- Feature* feature = manifest_feature_provider->GetFeature(*feature_name);
- Feature::Availability result = feature->IsAvailableToManifest(
+ Feature::Availability result = map_entry.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(), map_entry.first));
}
// Also generate warnings for keys that are not features.
« no previous file with comments | « extensions/common/features/feature_provider.h ('k') | extensions/renderer/api_definitions_natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698