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

Unified Diff: chrome/common/extensions/features/api_feature.cc

Issue 217163003: Enable _api_features.json to block APIs from service worker contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: chrome/common/extensions/features/api_feature.cc
diff --git a/chrome/common/extensions/features/api_feature.cc b/chrome/common/extensions/features/api_feature.cc
index d53d105bc267bcbac7ecb7c26ed9da1fad32d633..edb9317b840f8eff3a55bbe3fe236f4e224f2f52 100644
--- a/chrome/common/extensions/features/api_feature.cc
+++ b/chrome/common/extensions/features/api_feature.cc
@@ -6,8 +6,8 @@
namespace extensions {
-APIFeature::APIFeature() : internal_(false) {
-}
+APIFeature::APIFeature()
+ : internal_(false), blocked_in_service_worker_(false) {}
APIFeature::~APIFeature() {
}
@@ -16,12 +16,17 @@ bool APIFeature::IsInternal() const {
return internal_;
}
+bool APIFeature::IsBlockedInServiceWorker() const {
+ return blocked_in_service_worker_;
+}
+
std::string APIFeature::Parse(const base::DictionaryValue* value) {
std::string error = SimpleFeature::Parse(value);
if (!error.empty())
return error;
value->GetBoolean("internal", &internal_);
+ value->GetBoolean("blocked_in_service_worker", &blocked_in_service_worker_);
if (GetContexts()->empty())
return name() + ": API features must specify at least one context.";
@@ -29,4 +34,4 @@ std::string APIFeature::Parse(const base::DictionaryValue* value) {
return std::string();
}
-} // namespace
+} // namespace extensions
« no previous file with comments | « chrome/common/extensions/features/api_feature.h ('k') | chrome/common/extensions/features/complex_feature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698