Backed out 14 changesets (bug 1425975) for M(5) permafails mochitest/test_ext_webrequest_filter.html. r=backout a=backout
Backed out changeset e6f4a2d1df9a (bug 1425975) Backed out changeset 1e657fa97b71 (bug 1425975) Backed out changeset 9e1544ec814d (bug 1425975) Backed out changeset 0e50d9d1d069 (bug 1425975) Backed out changeset fb89dbd922ba (bug 1425975) Backed out changeset f2b451ce55d4 (bug 1425975) Backed out changeset 4ce186c6d8f5 (bug 1425975) Backed out changeset 6f520ab76d6a (bug 1425975) Backed out changeset f091f5e182c4 (bug 1425975) Backed out changeset 82d39ed8c831 (bug 1425975) Backed out changeset df13eba47970 (bug 1425975) Backed out changeset 553628a56e6a (bug 1425975) Backed out changeset acf4d61babab (bug 1425975) Backed out changeset b7ae11b5bce8 (bug 1425975)
This commit is contained in:
@@ -155,7 +155,6 @@
|
||||
#include "mozIAsyncFavicons.h"
|
||||
#endif
|
||||
#include "nsINetworkPredictor.h"
|
||||
#include "nsIServiceWorkerManager.h"
|
||||
|
||||
// Editor-related
|
||||
#include "nsIEditingSession.h"
|
||||
@@ -3418,7 +3417,7 @@ nsDocShell::MaybeCreateInitialClientSource(nsIPrincipal* aPrincipal)
|
||||
// Don't pre-allocate the client when we are sandboxed. The inherited
|
||||
// principal does not take sandboxing into account.
|
||||
// TODO: Refactor sandboxing principal code out so we can use it here.
|
||||
if (!aPrincipal && mSandboxFlags) {
|
||||
if (!aPrincipal && (mSandboxFlags & SANDBOXED_ORIGIN)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3460,35 +3459,18 @@ nsDocShell::MaybeCreateInitialClientSource(nsIPrincipal* aPrincipal)
|
||||
return;
|
||||
}
|
||||
|
||||
// We're done if there is no parent controller. Also, don't inherit
|
||||
// the controller if we're sandboxed. This matches our behavior in
|
||||
// ShouldPrepareForIntercept(),
|
||||
Maybe<ServiceWorkerDescriptor> controller(parentInner->GetController());
|
||||
if (controller.isNothing() || mSandboxFlags) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIServiceWorkerManager> swm = mozilla::services::GetServiceWorkerManager();
|
||||
if (!swm) {
|
||||
if (controller.isNothing()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If the parent is controlled then propagate that controller to the
|
||||
// initial about:blank client as well. This will set the controller
|
||||
// in the ClientManagerService in the parent.
|
||||
//
|
||||
// Note: If the registration is missing from the SWM we avoid setting
|
||||
// the controller on the client. We can do this synchronously
|
||||
// for now since SWM is in the child process. In the future
|
||||
// when SWM is in the parent process we will probably have to
|
||||
// always set the initial client source and then somehow clear
|
||||
// it if we find the registration is acutally gone. Its also
|
||||
// possible this race only occurs in cases where the resulting
|
||||
// window is no longer exposed. For example, in theory the SW
|
||||
// should not go away if our parent window is controlled.
|
||||
if (!swm->StartControlling(mInitialClientSource->Info(), controller.ref())) {
|
||||
return;
|
||||
}
|
||||
RefPtr<ClientHandle> handle =
|
||||
ClientManager::CreateHandle(mInitialClientSource->Info(),
|
||||
parentInner->EventTargetFor(TaskCategory::Other));
|
||||
handle->Control(controller.ref());
|
||||
|
||||
// Also mark the ClientSource as controlled directly in case script
|
||||
// immediately accesses navigator.serviceWorker.controller.
|
||||
|
||||
Reference in New Issue
Block a user