Bug 1578623 remove OriginAttributes duplication by reading from PrincipalInfo r=baku

Differential Revision: https://phabricator.services.mozilla.com/D44918

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Karl Tomlinson 2019-09-08 23:44:05 +00:00
parent 8b101b80b5
commit 2a772f968e
2 changed files with 2 additions and 4 deletions

View file

@ -35,8 +35,7 @@ WorkletLoadInfo::WorkletLoadInfo(nsPIDOMWindowInner* aWindow)
// WorkletImpl
WorkletImpl::WorkletImpl(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal)
: mOriginAttributes(BasePrincipal::Cast(aPrincipal)->OriginAttributesRef()),
mPrincipal(NullPrincipal::CreateWithInheritedAttributes(aPrincipal)),
: mPrincipal(NullPrincipal::CreateWithInheritedAttributes(aPrincipal)),
mWorkletLoadInfo(aWindow),
mTerminated(false) {
Unused << NS_WARN_IF(

View file

@ -70,7 +70,7 @@ class WorkletImpl {
const WorkletLoadInfo& LoadInfo() const { return mWorkletLoadInfo; }
const OriginAttributes& OriginAttributesRef() const {
return mOriginAttributes;
return mPrincipalInfo.get_NullPrincipalInfo().attrs();
}
const ipc::PrincipalInfo& PrincipalInfo() const { return mPrincipalInfo; }
@ -80,7 +80,6 @@ class WorkletImpl {
virtual already_AddRefed<dom::WorkletGlobalScope> ConstructGlobalScope() = 0;
const OriginAttributes mOriginAttributes;
// Modified only in constructor.
ipc::PrincipalInfo mPrincipalInfo;
// Accessed on only worklet parent thread.