Bug 1231211 P18 Make blob URL worker scripts inherit the parent's controller. r=asuth
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "nsContentPolicyUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsDocShellCID.h"
|
||||
#include "nsHostObjectProtocolHandler.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIPipe.h"
|
||||
@@ -1260,6 +1261,18 @@ private:
|
||||
if (chanLoadInfo) {
|
||||
mController = chanLoadInfo->GetController();
|
||||
}
|
||||
|
||||
// If we are loading a blob URL we must inherit the controller
|
||||
// from the parent. This is a bit odd as the blob URL may have
|
||||
// been created in a different context with a different controller.
|
||||
// For now, though, this is what the spec says. See:
|
||||
//
|
||||
// https://github.com/w3c/ServiceWorker/issues/1261
|
||||
//
|
||||
if (IsBlobURI(mWorkerPrivate->GetBaseURI())) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(mController.isNothing());
|
||||
mController = mWorkerPrivate->GetParentController();
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
||||
Reference in New Issue
Block a user