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

Unified Diff: extensions/common/features/simple_feature.cc

Issue 1880933002: Begin to enable extension APIs in Extension Service Worker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync @tott Created 4 years, 7 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/extensions_client.cc ('k') | extensions/common/features/simple_feature_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/features/simple_feature.cc
diff --git a/extensions/common/features/simple_feature.cc b/extensions/common/features/simple_feature.cc
index 7caf62425bbbd0eb89ffc1eeb8f20dff83502042..9abc1b4f39224eed5f27a682b50d65fa06c18f43 100644
--- a/extensions/common/features/simple_feature.cc
+++ b/extensions/common/features/simple_feature.cc
@@ -263,6 +263,7 @@ struct SimpleFeature::Mappings {
contexts["web_page"] = Feature::WEB_PAGE_CONTEXT;
contexts["blessed_web_page"] = Feature::BLESSED_WEB_PAGE_CONTEXT;
contexts["webui"] = Feature::WEBUI_CONTEXT;
+ contexts["extension_service_worker"] = Feature::SERVICE_WORKER_CONTEXT;
locations["component"] = SimpleFeature::COMPONENT_LOCATION;
locations["external_component"] =
@@ -439,6 +440,10 @@ Feature::Availability SimpleFeature::IsAvailableToContext(
return result;
}
+ // TODO(lazyboy): This isn't quite right for Extension Service Worker
+ // extension API calls, since there's no guarantee that the extension is
+ // "active" in current renderer process when the API permission check is
+ // done.
if (!contexts_.empty() && !ContainsValue(contexts_, context))
return CreateAvailability(INVALID_CONTEXT, context);
« no previous file with comments | « extensions/common/extensions_client.cc ('k') | extensions/common/features/simple_feature_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698