Chromium Code Reviews| 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); |