From e9f3cabd4541fc67dd34b9a38326cee1fa7fe090 Mon Sep 17 00:00:00 2001 From: Karl Tomlinson Date: Fri, 6 Sep 2019 02:10:33 +0000 Subject: [PATCH] Bug 1578623 use an opaque origin for WorkletGlobalScope r=baku The environment settings object for a WorkletGlobalScope derives from the relevant settings object of the main-thread Worklet object, but the origin is a unique opaque origin. https://drafts.css-houdini.org/worklets/#set-up-a-worklet-environment-settings-object Depends on D44775 Differential Revision: https://phabricator.services.mozilla.com/D44776 --HG-- extra : moz-landing-system : lando --- dom/worklet/WorkletImpl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dom/worklet/WorkletImpl.cpp b/dom/worklet/WorkletImpl.cpp index 7a0c3eddea15..1e7f34f9f274 100644 --- a/dom/worklet/WorkletImpl.cpp +++ b/dom/worklet/WorkletImpl.cpp @@ -10,6 +10,7 @@ #include "WorkletThread.h" #include "mozilla/BasePrincipal.h" +#include "mozilla/NullPrincipal.h" #include "mozilla/dom/RegisterWorkletBindings.h" #include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/WorkletBinding.h" @@ -35,7 +36,7 @@ WorkletLoadInfo::WorkletLoadInfo(nsPIDOMWindowInner* aWindow) WorkletImpl::WorkletImpl(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal) : mOriginAttributes(BasePrincipal::Cast(aPrincipal)->OriginAttributesRef()), - mPrincipal(aPrincipal), + mPrincipal(NullPrincipal::CreateWithInheritedAttributes(aPrincipal)), mWorkletLoadInfo(aWindow), mTerminated(false) {}