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

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: 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/renderer/resources/runtime_custom_bindings.js ('k') | extensions/renderer/service_worker_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/script_context.cc
diff --git a/extensions/renderer/script_context.cc b/extensions/renderer/script_context.cc
index 529c5fcd40cba368725f1f57b0937420ee759035..587087bd1a5e05af173a28c3375f7c346ca4e205 100644
--- a/extensions/renderer/script_context.cc
+++ b/extensions/renderer/script_context.cc
@@ -256,8 +256,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
« no previous file with comments | « extensions/renderer/resources/runtime_custom_bindings.js ('k') | extensions/renderer/service_worker_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698