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

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: Created 4 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: extensions/common/features/simple_feature.cc
diff --git a/extensions/common/features/simple_feature.cc b/extensions/common/features/simple_feature.cc
index 68c8dfa175f8100ed6cca8291788422bbf58395d..686fdebc42ce8fd415f43ec4f216eb6b22c786da 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;
Devlin 2016/04/13 19:46:31 We should have this behind a flag (or just an inte
lazyboy 2016/04/14 02:07:53 I've added a bool in feature_util, used that to gu
Devlin 2016/04/14 22:34:52 See suggestion in ipc messages.
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);

Powered by Google App Engine
This is Rietveld 408576698