Bug 1646474 - Remove LoadInfo::mDocumentHasLoaded. r=nika,necko-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D96010
This commit is contained in:
Andreas Farre 2020-11-10 12:45:22 +00:00
Родитель 1fe5a936f7
Коммит c208b33fc0
6 изменённых файлов: 39 добавлений и 112 удалений

Просмотреть файл

@ -533,7 +533,6 @@ nsresult LoadInfoToLoadInfoArgs(nsILoadInfo* aLoadInfo,
aLoadInfo->GetLoadTriggeredFromExternal(),
aLoadInfo->GetServiceWorkerTaintingSynthesized(),
aLoadInfo->GetDocumentHasUserInteracted(),
aLoadInfo->GetDocumentHasLoaded(),
aLoadInfo->GetAllowListFutureDocumentsCreatedFromThisRedirectChain(),
cspNonce, aLoadInfo->GetSkipContentSniffing(),
aLoadInfo->GetHttpsOnlyStatus(),
@ -792,7 +791,6 @@ nsresult LoadInfoArgsToLoadInfo(
loadInfoArgs.loadTriggeredFromExternal(),
loadInfoArgs.serviceWorkerTaintingSynthesized(),
loadInfoArgs.documentHasUserInteracted(),
loadInfoArgs.documentHasLoaded(),
loadInfoArgs.allowListFutureDocumentsCreatedFromThisRedirectChain(),
loadInfoArgs.cspNonce(), loadInfoArgs.skipContentSniffing(),
loadInfoArgs.httpsOnlyStatus(),
@ -844,7 +842,6 @@ void LoadInfoToParentLoadInfoForwarder(
aLoadInfo->GetTriggeringSandboxFlags(),
aLoadInfo->GetServiceWorkerTaintingSynthesized(),
aLoadInfo->GetDocumentHasUserInteracted(),
aLoadInfo->GetDocumentHasLoaded(),
aLoadInfo->GetAllowListFutureDocumentsCreatedFromThisRedirectChain(),
cookieJarSettingsArgs, aLoadInfo->GetRequestBlockingReason(),
aLoadInfo->GetHasStoragePermission(),
@ -902,8 +899,6 @@ nsresult MergeParentLoadInfoForwarder(
MOZ_ALWAYS_SUCCEEDS(aLoadInfo->SetDocumentHasUserInteracted(
aForwarderArgs.documentHasUserInteracted()));
MOZ_ALWAYS_SUCCEEDS(
aLoadInfo->SetDocumentHasLoaded(aForwarderArgs.documentHasLoaded()));
MOZ_ALWAYS_SUCCEEDS(
aLoadInfo->SetAllowListFutureDocumentsCreatedFromThisRedirectChain(
aForwarderArgs

Просмотреть файл

@ -200,26 +200,6 @@ LoadInfo::LoadInfo(
mTopLevelPrincipal = innerWindow->GetPrincipal();
}
}
mDocumentHasLoaded = innerWindow->IsDocumentLoaded();
if (bc->IsFrame()) {
// For resources within iframes, we actually want the
// top-level document's flag, not the iframe document's.
mDocumentHasLoaded = false;
// FIXME: This is not Fission-compatible. The flag needs to be moved
// from the document to the WindowContext, and the check updated
// accordingly.
nsGlobalWindowOuter* topOuter =
innerWindow->GetInProcessScriptableTopInternal();
if (topOuter) {
nsGlobalWindowInner* topInner =
nsGlobalWindowInner::Cast(topOuter->GetCurrentInnerWindow());
if (topInner) {
mDocumentHasLoaded = topInner->IsDocumentLoaded();
}
}
}
}
// Let's inherit the cookie behavior and permission from the parent
@ -460,11 +440,6 @@ LoadInfo::LoadInfo(dom::WindowGlobalParent* aParentWGP,
// Let's inherit the cookie behavior and permission from the embedder
// document.
mCookieJarSettings = aParentWGP->CookieJarSettings();
if (parentBC->IsContentSubframe()) {
mDocumentHasLoaded = false;
} else {
mDocumentHasLoaded = aParentWGP->DocumentHasLoaded();
}
if (topLevelWGP->BrowsingContext()->IsTop()) {
if (mCookieJarSettings) {
bool stopAtOurLevel = mCookieJarSettings->GetCookieBehavior() ==
@ -474,11 +449,6 @@ LoadInfo::LoadInfo(dom::WindowGlobalParent* aParentWGP,
mTopLevelPrincipal = topLevelWGP->DocumentPrincipal();
}
}
if (parentBC->IsContentSubframe()) {
// For resources within iframes, we actually want the
// top-level document's flag, not the iframe document's.
mDocumentHasLoaded = topLevelWGP->DocumentHasLoaded();
}
}
// The top-level-storage-area-principal is not null only for the first
@ -605,7 +575,6 @@ LoadInfo::LoadInfo(const LoadInfo& rhs)
// redirect
mServiceWorkerTaintingSynthesized(false),
mDocumentHasUserInteracted(rhs.mDocumentHasUserInteracted),
mDocumentHasLoaded(rhs.mDocumentHasLoaded),
mAllowListFutureDocumentsCreatedFromThisRedirectChain(
rhs.mAllowListFutureDocumentsCreatedFromThisRedirectChain),
mCspNonce(rhs.mCspNonce),
@ -650,7 +619,6 @@ LoadInfo::LoadInfo(
const nsTArray<nsCString>& aCorsUnsafeHeaders, bool aForcePreflight,
bool aIsPreflight, bool aLoadTriggeredFromExternal,
bool aServiceWorkerTaintingSynthesized, bool aDocumentHasUserInteracted,
bool aDocumentHasLoaded,
bool aAllowListFutureDocumentsCreatedFromThisRedirectChain,
const nsAString& aCspNonce, bool aSkipContentSniffing,
uint32_t aHttpsOnlyStatus, bool aHasValidUserGestureActivation,
@ -710,7 +678,6 @@ LoadInfo::LoadInfo(
mLoadTriggeredFromExternal(aLoadTriggeredFromExternal),
mServiceWorkerTaintingSynthesized(aServiceWorkerTaintingSynthesized),
mDocumentHasUserInteracted(aDocumentHasUserInteracted),
mDocumentHasLoaded(aDocumentHasLoaded),
mAllowListFutureDocumentsCreatedFromThisRedirectChain(
aAllowListFutureDocumentsCreatedFromThisRedirectChain),
mCspNonce(aCspNonce),
@ -1543,19 +1510,6 @@ LoadInfo::SetDocumentHasUserInteracted(bool aDocumentHasUserInteracted) {
return NS_OK;
}
NS_IMETHODIMP
LoadInfo::GetDocumentHasLoaded(bool* aDocumentHasLoaded) {
MOZ_ASSERT(aDocumentHasLoaded);
*aDocumentHasLoaded = mDocumentHasLoaded;
return NS_OK;
}
NS_IMETHODIMP
LoadInfo::SetDocumentHasLoaded(bool aDocumentHasLoaded) {
mDocumentHasLoaded = aDocumentHasLoaded;
return NS_OK;
}
NS_IMETHODIMP
LoadInfo::GetAllowListFutureDocumentsCreatedFromThisRedirectChain(
bool* aValue) {

Просмотреть файл

@ -182,48 +182,45 @@ class LoadInfo final : public nsILoadInfo {
// HttpChannelParent and FTPChannelParent declared as friends undeneath.
// In e10s we can not serialize nsINode, hence we store the innerWindowID.
// Please note that aRedirectChain uses swapElements.
LoadInfo(nsIPrincipal* aLoadingPrincipal, nsIPrincipal* aTriggeringPrincipal,
nsIPrincipal* aPrincipalToInherit,
nsIPrincipal* aSandboxedLoadingPrincipal,
nsIPrincipal* aTopLevelPrincipal,
nsIPrincipal* aTopLevelStorageAreaPrincipal,
nsIURI* aResultPrincipalURI,
nsICookieJarSettings* aCookieJarSettings,
nsIContentSecurityPolicy* aCspToInherit,
const Maybe<mozilla::dom::ClientInfo>& aClientInfo,
const Maybe<mozilla::dom::ClientInfo>& aReservedClientInfo,
const Maybe<mozilla::dom::ClientInfo>& aInitialClientInfo,
const Maybe<mozilla::dom::ServiceWorkerDescriptor>& aController,
nsSecurityFlags aSecurityFlags, uint32_t aSandboxFlags,
uint32_t aTriggeringSandboxFlags,
nsContentPolicyType aContentPolicyType, LoadTainting aTainting,
bool aBlockAllMixedContent, bool aUpgradeInsecureRequests,
bool aBrowserUpgradeInsecureRequests,
bool aBrowserDidUpgradeInsecureRequests,
bool aBrowserWouldUpgradeInsecureRequests, bool aForceAllowDataURI,
bool aAllowInsecureRedirectToDataURI, bool aBypassCORSChecks,
bool aSkipContentPolicyCheckForWebRequest,
bool aOriginalFrameSrcLoad, bool aForceInheritPrincipalDropped,
uint64_t aInnerWindowID, uint64_t aBrowsingContextID,
uint64_t aFrameBrowsingContextID, bool aInitialSecurityCheckDone,
bool aIsThirdPartyRequest, bool aIsThirdPartyContextToTopWindow,
bool aIsFormSubmission, bool aSendCSPViolationEvents,
const OriginAttributes& aOriginAttributes,
RedirectHistoryArray&& aRedirectChainIncludingInternalRedirects,
RedirectHistoryArray&& aRedirectChain,
nsTArray<nsCOMPtr<nsIPrincipal>>&& aAncestorPrincipals,
const nsTArray<uint64_t>& aAncestorBrowsingContextIDs,
const nsTArray<nsCString>& aUnsafeHeaders, bool aForcePreflight,
bool aIsPreflight, bool aLoadTriggeredFromExternal,
bool aServiceWorkerTaintingSynthesized,
bool aDocumentHasUserInteracted, bool aDocumentHasLoaded,
bool aAllowListFutureDocumentsCreatedFromThisRedirectChain,
const nsAString& aCspNonce, bool aSkipContentSniffing,
uint32_t aHttpsOnlyStatus, bool aHasValidUserGestureActivation,
bool aAllowDeprecatedSystemRequests, bool aIsDevToolsContext,
bool aParserCreatedScript, bool aHasStoragePermission,
uint32_t aRequestBlockingReason, nsINode* aLoadingContext,
nsILoadInfo::CrossOriginEmbedderPolicy aLoadingEmbedderPolicy);
LoadInfo(
nsIPrincipal* aLoadingPrincipal, nsIPrincipal* aTriggeringPrincipal,
nsIPrincipal* aPrincipalToInherit,
nsIPrincipal* aSandboxedLoadingPrincipal,
nsIPrincipal* aTopLevelPrincipal,
nsIPrincipal* aTopLevelStorageAreaPrincipal, nsIURI* aResultPrincipalURI,
nsICookieJarSettings* aCookieJarSettings,
nsIContentSecurityPolicy* aCspToInherit,
const Maybe<mozilla::dom::ClientInfo>& aClientInfo,
const Maybe<mozilla::dom::ClientInfo>& aReservedClientInfo,
const Maybe<mozilla::dom::ClientInfo>& aInitialClientInfo,
const Maybe<mozilla::dom::ServiceWorkerDescriptor>& aController,
nsSecurityFlags aSecurityFlags, uint32_t aSandboxFlags,
uint32_t aTriggeringSandboxFlags, nsContentPolicyType aContentPolicyType,
LoadTainting aTainting, bool aBlockAllMixedContent,
bool aUpgradeInsecureRequests, bool aBrowserUpgradeInsecureRequests,
bool aBrowserDidUpgradeInsecureRequests,
bool aBrowserWouldUpgradeInsecureRequests, bool aForceAllowDataURI,
bool aAllowInsecureRedirectToDataURI, bool aBypassCORSChecks,
bool aSkipContentPolicyCheckForWebRequest, bool aOriginalFrameSrcLoad,
bool aForceInheritPrincipalDropped, uint64_t aInnerWindowID,
uint64_t aBrowsingContextID, uint64_t aFrameBrowsingContextID,
bool aInitialSecurityCheckDone, bool aIsThirdPartyContext,
bool aIsThirdPartyContextToTopWindow, bool aIsFormSubmission,
bool aSendCSPViolationEvents, const OriginAttributes& aOriginAttributes,
RedirectHistoryArray&& aRedirectChainIncludingInternalRedirects,
RedirectHistoryArray&& aRedirectChain,
nsTArray<nsCOMPtr<nsIPrincipal>>&& aAncestorPrincipals,
const nsTArray<uint64_t>& aAncestorBrowsingContextIDs,
const nsTArray<nsCString>& aCorsUnsafeHeaders, bool aForcePreflight,
bool aIsPreflight, bool aLoadTriggeredFromExternal,
bool aServiceWorkerTaintingSynthesized, bool aDocumentHasUserInteracted,
bool aAllowListFutureDocumentsCreatedFromThisRedirectChain,
const nsAString& aCspNonce, bool aSkipContentSniffing,
uint32_t aHttpsOnlyStatus, bool aHasValidUserGestureActivation,
bool aAllowDeprecatedSystemRequests, bool aIsInDevToolsContext,
bool aParserCreatedScript, bool aHasStoragePermission,
uint32_t aRequestBlockingReason, nsINode* aLoadingContext,
nsILoadInfo::CrossOriginEmbedderPolicy aLoadingEmbedderPolicy);
LoadInfo(const LoadInfo& rhs);
NS_IMETHOD GetRedirects(JSContext* aCx,
@ -315,7 +312,6 @@ class LoadInfo final : public nsILoadInfo {
bool mLoadTriggeredFromExternal = false;
bool mServiceWorkerTaintingSynthesized = false;
bool mDocumentHasUserInteracted = false;
bool mDocumentHasLoaded = false;
bool mAllowListFutureDocumentsCreatedFromThisRedirectChain = false;
nsString mCspNonce;
bool mSkipContentSniffing = false;

Просмотреть файл

@ -476,16 +476,6 @@ TRRLoadInfo::SetDocumentHasUserInteracted(bool aDocumentHasUserInteracted) {
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
TRRLoadInfo::GetDocumentHasLoaded(bool* aDocumentHasLoaded) {
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
TRRLoadInfo::SetDocumentHasLoaded(bool aDocumentHasLoaded) {
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
TRRLoadInfo::GetAllowListFutureDocumentsCreatedFromThisRedirectChain(
bool* aValue) {

Просмотреть файл

@ -1236,12 +1236,6 @@ interface nsILoadInfo : nsISupports
*/
[infallible] attribute boolean documentHasUserInteracted;
/**
* This attribute represents whether the document to which this
* load belongs had finished loading when the load was initiated.
*/
[infallible] attribute boolean documentHasLoaded;
/**
* During a top-level document channel redirect from tracking to
* non-tracking resources, our anti-tracking heuristic, grants the storage

Просмотреть файл

@ -138,7 +138,6 @@ struct LoadInfoArgs
bool loadTriggeredFromExternal;
bool serviceWorkerTaintingSynthesized;
bool documentHasUserInteracted;
bool documentHasLoaded;
bool allowListFutureDocumentsCreatedFromThisRedirectChain;
nsString cspNonce;
bool skipContentSniffing;
@ -214,7 +213,6 @@ struct ParentLoadInfoForwarderArgs
bool serviceWorkerTaintingSynthesized;
bool documentHasUserInteracted;
bool documentHasLoaded;
bool allowListFutureDocumentsCreatedFromThisRedirectChain;
CookieJarSettingsArgs? cookieJarSettings;