Bug 1578623 use an opaque origin for WorkletGlobalScope r=baku
☠☠ backed out by 92823ffcb1dc ☠ ☠
authorKarl Tomlinson <karlt+@karlt.net>
Fri, 06 Sep 2019 02:10:33 +0000
changeset 553498 6d7be8a22f8bfec08cbfe394972590091204b1a0
parent 553497 3be609a9be36ec5b9652f1359f8d1bc4546e0a49
child 553499 8242877392bd38135b6956cd5e56d2456f868f6a
push id12169
push userffxbld-merge
push dateMon, 14 Oct 2019 16:59:29 +0000
treeherdermozilla-beta@c819687300ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1578623
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
dom/worklet/WorkletImpl.cpp
--- a/dom/worklet/WorkletImpl.cpp
+++ b/dom/worklet/WorkletImpl.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
 
 #include "WorkletImpl.h"
 
 #include "Worklet.h"
 #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"
 
 namespace mozilla {
 
 // ---------------------------------------------------------------------------
 // WorkletLoadInfo
@@ -30,17 +31,17 @@ WorkletLoadInfo::WorkletLoadInfo(nsPIDOM
   }
 }
 
 // ---------------------------------------------------------------------------
 // WorkletImpl
 
 WorkletImpl::WorkletImpl(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal)
     : mOriginAttributes(BasePrincipal::Cast(aPrincipal)->OriginAttributesRef()),
-      mPrincipal(aPrincipal),
+      mPrincipal(NullPrincipal::CreateWithInheritedAttributes(aPrincipal)),
       mWorkletLoadInfo(aWindow),
       mTerminated(false) {}
 
 WorkletImpl::~WorkletImpl() {
   MOZ_ASSERT(!mGlobalScope);
   MOZ_ASSERT(!mPrincipal || NS_IsMainThread());
 }