Bug 1508595 - Only set an intercept controller when needed. r=asuth

We only need to expose an intercept controller in SharedWorkers if we're on
the non-parent-intercept version of ServiceWorkers or if e10s is off.
nsDocShell already does this dance and we have to mirror it.

Differential Revision: https://phabricator.services.mozilla.com/D12490
This commit is contained in:
Blake Kaplan
2018-11-21 01:06:08 +00:00
parent b8554c5c0f
commit 8a8d4d8ea1
2 changed files with 10 additions and 3 deletions

View File

@@ -480,6 +480,8 @@ nsDocShell::Create(BrowsingContext* aBrowsingContext)
// If parent intercept is not enabled then we must forward to
// the network controller from docshell. We also enable if we're
// in the parent process in order to support non-e10s configurations.
// Note: This check is duplicated in SharedWorkerInterfaceRequestor's
// constructor.
if (!ServiceWorkerParentInterceptEnabled() || XRE_IsParentProcess()) {
ds->mInterceptController = new ServiceWorkerInterceptController();
}