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

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: address comments -> round 1 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..892d7019078e3dc6d143bf35bad4d4228112d8b3 100644
--- a/extensions/renderer/script_context.cc
+++ b/extensions/renderer/script_context.cc
@@ -255,8 +255,12 @@ 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 = 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