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

Unified Diff: extensions/renderer/script_context.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/renderer/script_context.cc
diff --git a/extensions/renderer/script_context.cc b/extensions/renderer/script_context.cc
index 6a5b631179035859e3b0e53ea7a4cbaef968cac0..28407ab1012315a0f9fa71990675da2ddd344107 100644
--- a/extensions/renderer/script_context.cc
+++ b/extensions/renderer/script_context.cc
@@ -255,8 +255,13 @@ std::string ScriptContext::GetEffectiveContextTypeDescription() const {
bool ScriptContext::IsAnyFeatureAvailableToContext(const Feature& api) {
DCHECK(thread_checker_.CalledOnValidThread());
+ // TODO(lazyboy): Decide what we should do for SERVICE_WORKER_CONTEXT.
+ GURL url = url_;
Devlin 2016/04/13 19:46:32 ternary?
lazyboy 2016/04/14 02:07:53 Done.
+ if (context_type() != Feature::SERVICE_WORKER_CONTEXT)
+ url = GetDataSourceURLForFrame(web_frame());
+
return ExtensionAPI::GetSharedInstance()->IsAnyFeatureAvailableToContext(
- api, extension(), context_type(), GetDataSourceURLForFrame(web_frame()));
+ api, extension(), context_type(), url);
}
// static

Powered by Google App Engine
This is Rietveld 408576698