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

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

Issue 10689097: Enforce the 'requirements' field in manifests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 7e4cf40aa8a10548254366ea50ee973461059475..edf4a20219c6109139f95d8b5fb14ae23e9a7285 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -38,6 +38,7 @@
#include "chrome/common/extensions/file_browser_handler.h"
#include "chrome/common/extensions/manifest.h"
#include "chrome/common/extensions/permissions/permissions_info.h"
+#include "chrome/common/extensions/requirements_provider.h"
#include "chrome/common/extensions/url_pattern_set.h"
#include "chrome/common/extensions/user_script.h"
#include "chrome/common/url_constants.h"
@@ -1676,11 +1677,11 @@ bool Extension::LoadSandboxedPages(string16* error) {
return true;
}
-// These are not actually persisted (they're only used by the store), but
-// still validated.
bool Extension::CheckRequirements(string16* error) {
- if (!manifest_->HasKey(keys::kRequirements))
+ if (!manifest_->HasKey(keys::kRequirements)) {
Aaron Boodman 2012/07/16 21:16:12 No need for braces here.
return true;
+ }
+
DictionaryValue* requirements_value = NULL;
if (!manifest_->GetDictionary(keys::kRequirements, &requirements_value)) {
*error = ASCIIToUTF16(errors::kInvalidRequirements);
@@ -1697,6 +1698,7 @@ bool Extension::CheckRequirements(string16* error) {
return false;
}
}
+
return true;
}

Powered by Google App Engine
This is Rietveld 408576698