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

Unified Diff: chrome/common/extensions/manifest.cc

Issue 13997002: Load extensions features file separately when needed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/manifest.cc
diff --git a/chrome/common/extensions/manifest.cc b/chrome/common/extensions/manifest.cc
index 04dd09744e8d07b66f90f252b5935cd46e61b855..c5e588ef1ea43bd68555646f97b27327f16a5dba 100644
--- a/chrome/common/extensions/manifest.cc
+++ b/chrome/common/extensions/manifest.cc
@@ -139,16 +139,16 @@ bool Manifest::ValidateManifest(
// TODO(aa): Consider having an error here in the case of strict error
// checking to let developers know when they screw up.
- std::set<std::string> feature_names =
- BaseFeatureProvider::GetManifestFeatures()->GetAllFeatureNames();
+ BaseFeatureProvider* provider =
+ BaseFeatureProvider::GetFeaturesByName("manifest");
+ std::set<std::string> feature_names = provider->GetAllFeatureNames();
for (std::set<std::string>::iterator feature_name = feature_names.begin();
feature_name != feature_names.end(); ++feature_name) {
// Use Get instead of HasKey because the former uses path expansion.
if (!value_->Get(*feature_name, NULL))
continue;
- Feature* feature =
- BaseFeatureProvider::GetManifestFeatures()->GetFeature(*feature_name);
+ Feature* feature = provider->GetFeature(*feature_name);
Feature::Availability result = feature->IsAvailableToManifest(
extension_id_, type_, Feature::ConvertLocation(location_),
GetManifestVersion());
@@ -160,7 +160,7 @@ bool Manifest::ValidateManifest(
// Also generate warnings for keys that are not features.
for (base::DictionaryValue::Iterator it(*value_); !it.IsAtEnd();
it.Advance()) {
- if (!BaseFeatureProvider::GetManifestFeatures()->GetFeature(it.key())) {
+ if (!provider->GetFeature(it.key())) {
warnings->push_back(InstallWarning(
InstallWarning::FORMAT_TEXT,
base::StringPrintf("Unrecognized manifest key '%s'.",
@@ -248,7 +248,7 @@ bool Manifest::CanAccessPath(const std::string& path) const {
bool Manifest::CanAccessKey(const std::string& key) const {
Feature* feature =
- BaseFeatureProvider::GetManifestFeatures()->GetFeature(key);
+ BaseFeatureProvider::GetFeaturesByName("manifest")->GetFeature(key);
if (!feature)
return true;

Powered by Google App Engine
This is Rietveld 408576698