@@ -235,9 +235,10 @@ LoadInfo::LoadInfo(
235235 }
236236
237237 mInnerWindowID = aLoadingContext->OwnerDoc ()->InnerWindowID ();
238- mAncestorPrincipals = aLoadingContext->OwnerDoc ()->AncestorPrincipals ();
238+ mAncestorPrincipals =
239+ aLoadingContext->OwnerDoc ()->AncestorPrincipals ().Clone ();
239240 mAncestorOuterWindowIDs =
240- aLoadingContext->OwnerDoc ()->AncestorOuterWindowIDs ();
241+ aLoadingContext->OwnerDoc ()->AncestorOuterWindowIDs (). Clone () ;
241242 MOZ_DIAGNOSTIC_ASSERT (mAncestorPrincipals .Length () ==
242243 mAncestorOuterWindowIDs .Length ());
243244 mDocumentHasUserInteracted =
@@ -596,8 +597,8 @@ LoadInfo::LoadInfo(dom::CanonicalBrowsingContext* aBrowsingContext,
596597 ancestorOuterWindowIDs.AppendElement (ancestorWGP->OuterWindowId ());
597598 ancestorBC = ancestorWGP->BrowsingContext ();
598599 }
599- mAncestorPrincipals = ancestorPrincipals;
600- mAncestorOuterWindowIDs = ancestorOuterWindowIDs;
600+ mAncestorPrincipals = std::move ( ancestorPrincipals) ;
601+ mAncestorOuterWindowIDs = std::move ( ancestorOuterWindowIDs) ;
601602 MOZ_DIAGNOSTIC_ASSERT (mAncestorPrincipals .Length () ==
602603 mAncestorOuterWindowIDs .Length ());
603604
@@ -759,11 +760,11 @@ LoadInfo::LoadInfo(const LoadInfo& rhs)
759760 mSendCSPViolationEvents(rhs.mSendCSPViolationEvents ),
760761 mOriginAttributes(rhs.mOriginAttributes ),
761762 mRedirectChainIncludingInternalRedirects(
762- rhs.mRedirectChainIncludingInternalRedirects ),
763- mRedirectChain(rhs.mRedirectChain ),
764- mAncestorPrincipals(rhs.mAncestorPrincipals ),
765- mAncestorOuterWindowIDs(rhs.mAncestorOuterWindowIDs ),
766- mCorsUnsafeHeaders(rhs.mCorsUnsafeHeaders ),
763+ rhs.mRedirectChainIncludingInternalRedirects .Clone() ),
764+ mRedirectChain(rhs.mRedirectChain .Clone() ),
765+ mAncestorPrincipals(rhs.mAncestorPrincipals .Clone() ),
766+ mAncestorOuterWindowIDs(rhs.mAncestorOuterWindowIDs .Clone() ),
767+ mCorsUnsafeHeaders(rhs.mCorsUnsafeHeaders .Clone() ),
767768 mRequestBlockingReason(rhs.mRequestBlockingReason ),
768769 mForcePreflight(rhs.mForcePreflight ),
769770 mIsPreflight(rhs.mIsPreflight ),
@@ -865,8 +866,8 @@ LoadInfo::LoadInfo(
865866 mSendCSPViolationEvents(aSendCSPViolationEvents),
866867 mOriginAttributes(aOriginAttributes),
867868 mAncestorPrincipals(std::move(aAncestorPrincipals)),
868- mAncestorOuterWindowIDs(aAncestorOuterWindowIDs),
869- mCorsUnsafeHeaders(aCorsUnsafeHeaders),
869+ mAncestorOuterWindowIDs(aAncestorOuterWindowIDs.Clone() ),
870+ mCorsUnsafeHeaders(aCorsUnsafeHeaders.Clone() ),
870871 mRequestBlockingReason(aRequestBlockingReason),
871872 mForcePreflight(aForcePreflight),
872873 mIsPreflight(aIsPreflight),
@@ -1561,7 +1562,7 @@ void LoadInfo::SetCorsPreflightInfo(const nsTArray<nsCString>& aHeaders,
15611562 bool aForcePreflight) {
15621563 MOZ_ASSERT (GetSecurityMode () == nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS);
15631564 MOZ_ASSERT (!mInitialSecurityCheckDone );
1564- mCorsUnsafeHeaders = aHeaders;
1565+ mCorsUnsafeHeaders = aHeaders. Clone () ;
15651566 mForcePreflight = aForcePreflight;
15661567}
15671568
0 commit comments