forked from mirrors/gecko-dev
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:
parent
8b101b80b5
commit
2a772f968e
2 changed files with 2 additions and 4 deletions
|
|
@ -35,8 +35,7 @@ WorkletLoadInfo::WorkletLoadInfo(nsPIDOMWindowInner* aWindow)
|
||||||
// WorkletImpl
|
// WorkletImpl
|
||||||
|
|
||||||
WorkletImpl::WorkletImpl(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal)
|
WorkletImpl::WorkletImpl(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal)
|
||||||
: mOriginAttributes(BasePrincipal::Cast(aPrincipal)->OriginAttributesRef()),
|
: mPrincipal(NullPrincipal::CreateWithInheritedAttributes(aPrincipal)),
|
||||||
mPrincipal(NullPrincipal::CreateWithInheritedAttributes(aPrincipal)),
|
|
||||||
mWorkletLoadInfo(aWindow),
|
mWorkletLoadInfo(aWindow),
|
||||||
mTerminated(false) {
|
mTerminated(false) {
|
||||||
Unused << NS_WARN_IF(
|
Unused << NS_WARN_IF(
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class WorkletImpl {
|
||||||
|
|
||||||
const WorkletLoadInfo& LoadInfo() const { return mWorkletLoadInfo; }
|
const WorkletLoadInfo& LoadInfo() const { return mWorkletLoadInfo; }
|
||||||
const OriginAttributes& OriginAttributesRef() const {
|
const OriginAttributes& OriginAttributesRef() const {
|
||||||
return mOriginAttributes;
|
return mPrincipalInfo.get_NullPrincipalInfo().attrs();
|
||||||
}
|
}
|
||||||
const ipc::PrincipalInfo& PrincipalInfo() const { return mPrincipalInfo; }
|
const ipc::PrincipalInfo& PrincipalInfo() const { return mPrincipalInfo; }
|
||||||
|
|
||||||
|
|
@ -80,7 +80,6 @@ class WorkletImpl {
|
||||||
|
|
||||||
virtual already_AddRefed<dom::WorkletGlobalScope> ConstructGlobalScope() = 0;
|
virtual already_AddRefed<dom::WorkletGlobalScope> ConstructGlobalScope() = 0;
|
||||||
|
|
||||||
const OriginAttributes mOriginAttributes;
|
|
||||||
// Modified only in constructor.
|
// Modified only in constructor.
|
||||||
ipc::PrincipalInfo mPrincipalInfo;
|
ipc::PrincipalInfo mPrincipalInfo;
|
||||||
// Accessed on only worklet parent thread.
|
// Accessed on only worklet parent thread.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue