mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-27 01:27:30 +09:00
Do not report resource-timing subdocument loads triggered by that subdocument.
This commit is contained in:
parent
a959f4717e
commit
27d88fc505
13 changed files with 108 additions and 12 deletions
|
|
@ -1263,6 +1263,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
|
||||||
nsCOMPtr<nsIURI> referrer;
|
nsCOMPtr<nsIURI> referrer;
|
||||||
nsCOMPtr<nsIURI> originalURI;
|
nsCOMPtr<nsIURI> originalURI;
|
||||||
bool loadReplace = false;
|
bool loadReplace = false;
|
||||||
|
bool isFromProcessingFrameAttributes = false;
|
||||||
nsCOMPtr<nsIInputStream> postStream;
|
nsCOMPtr<nsIInputStream> postStream;
|
||||||
nsCOMPtr<nsIInputStream> headersStream;
|
nsCOMPtr<nsIInputStream> headersStream;
|
||||||
nsCOMPtr<nsIPrincipal> triggeringPrincipal;
|
nsCOMPtr<nsIPrincipal> triggeringPrincipal;
|
||||||
|
|
@ -1292,6 +1293,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
|
||||||
aLoadInfo->GetReferrer(getter_AddRefs(referrer));
|
aLoadInfo->GetReferrer(getter_AddRefs(referrer));
|
||||||
aLoadInfo->GetOriginalURI(getter_AddRefs(originalURI));
|
aLoadInfo->GetOriginalURI(getter_AddRefs(originalURI));
|
||||||
aLoadInfo->GetLoadReplace(&loadReplace);
|
aLoadInfo->GetLoadReplace(&loadReplace);
|
||||||
|
aLoadInfo->GetIsFromProcessingFrameAttributes(&isFromProcessingFrameAttributes);
|
||||||
nsDocShellInfoLoadType lt = nsIDocShellLoadInfo::loadNormal;
|
nsDocShellInfoLoadType lt = nsIDocShellLoadInfo::loadNormal;
|
||||||
aLoadInfo->GetLoadType(<);
|
aLoadInfo->GetLoadType(<);
|
||||||
// Get the appropriate loadType from nsIDocShellLoadInfo type
|
// Get the appropriate loadType from nsIDocShellLoadInfo type
|
||||||
|
|
@ -1571,6 +1573,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
|
||||||
return InternalLoad(aURI,
|
return InternalLoad(aURI,
|
||||||
originalURI,
|
originalURI,
|
||||||
loadReplace,
|
loadReplace,
|
||||||
|
isFromProcessingFrameAttributes,
|
||||||
referrer,
|
referrer,
|
||||||
referrerPolicy,
|
referrerPolicy,
|
||||||
triggeringPrincipal,
|
triggeringPrincipal,
|
||||||
|
|
@ -5340,8 +5343,8 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
|
||||||
rv = NS_NewURI(getter_AddRefs(errorPageURI), errorPageUrl);
|
rv = NS_NewURI(getter_AddRefs(errorPageURI), errorPageUrl);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return InternalLoad(errorPageURI, nullptr, false, nullptr,
|
return InternalLoad(errorPageURI, nullptr, false, false,
|
||||||
mozilla::net::RP_Default,
|
nullptr, mozilla::net::RP_Default,
|
||||||
nsContentUtils::GetSystemPrincipal(), nullptr,
|
nsContentUtils::GetSystemPrincipal(), nullptr,
|
||||||
INTERNAL_LOAD_FLAGS_NONE, EmptyString(),
|
INTERNAL_LOAD_FLAGS_NONE, EmptyString(),
|
||||||
nullptr, NullString(), nullptr, nullptr, LOAD_ERROR_PAGE,
|
nullptr, NullString(), nullptr, nullptr, LOAD_ERROR_PAGE,
|
||||||
|
|
@ -5427,6 +5430,7 @@ nsDocShell::Reload(uint32_t aReloadFlags)
|
||||||
rv = InternalLoad(currentURI,
|
rv = InternalLoad(currentURI,
|
||||||
originalURI,
|
originalURI,
|
||||||
loadReplace,
|
loadReplace,
|
||||||
|
false, // Is from processing frame attributes
|
||||||
referrerURI,
|
referrerURI,
|
||||||
referrerPolicy,
|
referrerPolicy,
|
||||||
triggeringPrincipal,
|
triggeringPrincipal,
|
||||||
|
|
@ -9578,6 +9582,7 @@ class InternalLoadEvent : public Runnable
|
||||||
public:
|
public:
|
||||||
InternalLoadEvent(nsDocShell* aDocShell, nsIURI* aURI,
|
InternalLoadEvent(nsDocShell* aDocShell, nsIURI* aURI,
|
||||||
nsIURI* aOriginalURI, bool aLoadReplace,
|
nsIURI* aOriginalURI, bool aLoadReplace,
|
||||||
|
bool aIsFromProcessingFrameAttributes,
|
||||||
nsIURI* aReferrer, uint32_t aReferrerPolicy,
|
nsIURI* aReferrer, uint32_t aReferrerPolicy,
|
||||||
nsIPrincipal* aTriggeringPrincipal,
|
nsIPrincipal* aTriggeringPrincipal,
|
||||||
nsIPrincipal* aPrincipalToInherit, uint32_t aFlags,
|
nsIPrincipal* aPrincipalToInherit, uint32_t aFlags,
|
||||||
|
|
@ -9591,6 +9596,7 @@ public:
|
||||||
, mURI(aURI)
|
, mURI(aURI)
|
||||||
, mOriginalURI(aOriginalURI)
|
, mOriginalURI(aOriginalURI)
|
||||||
, mLoadReplace(aLoadReplace)
|
, mLoadReplace(aLoadReplace)
|
||||||
|
, mIsFromProcessingFrameAttributes(aIsFromProcessingFrameAttributes)
|
||||||
, mReferrer(aReferrer)
|
, mReferrer(aReferrer)
|
||||||
, mReferrerPolicy(aReferrerPolicy)
|
, mReferrerPolicy(aReferrerPolicy)
|
||||||
, mTriggeringPrincipal(aTriggeringPrincipal)
|
, mTriggeringPrincipal(aTriggeringPrincipal)
|
||||||
|
|
@ -9615,6 +9621,7 @@ public:
|
||||||
{
|
{
|
||||||
return mDocShell->InternalLoad(mURI, mOriginalURI,
|
return mDocShell->InternalLoad(mURI, mOriginalURI,
|
||||||
mLoadReplace,
|
mLoadReplace,
|
||||||
|
mIsFromProcessingFrameAttributes,
|
||||||
mReferrer,
|
mReferrer,
|
||||||
mReferrerPolicy,
|
mReferrerPolicy,
|
||||||
mTriggeringPrincipal, mPrincipalToInherit,
|
mTriggeringPrincipal, mPrincipalToInherit,
|
||||||
|
|
@ -9635,6 +9642,7 @@ private:
|
||||||
nsCOMPtr<nsIURI> mURI;
|
nsCOMPtr<nsIURI> mURI;
|
||||||
nsCOMPtr<nsIURI> mOriginalURI;
|
nsCOMPtr<nsIURI> mOriginalURI;
|
||||||
bool mLoadReplace;
|
bool mLoadReplace;
|
||||||
|
bool mIsFromProcessingFrameAttributes;
|
||||||
nsCOMPtr<nsIURI> mReferrer;
|
nsCOMPtr<nsIURI> mReferrer;
|
||||||
uint32_t mReferrerPolicy;
|
uint32_t mReferrerPolicy;
|
||||||
nsCOMPtr<nsIPrincipal> mTriggeringPrincipal;
|
nsCOMPtr<nsIPrincipal> mTriggeringPrincipal;
|
||||||
|
|
@ -9703,6 +9711,7 @@ NS_IMETHODIMP
|
||||||
nsDocShell::InternalLoad(nsIURI* aURI,
|
nsDocShell::InternalLoad(nsIURI* aURI,
|
||||||
nsIURI* aOriginalURI,
|
nsIURI* aOriginalURI,
|
||||||
bool aLoadReplace,
|
bool aLoadReplace,
|
||||||
|
bool aIsFromProcessingFrameAttributes,
|
||||||
nsIURI* aReferrer,
|
nsIURI* aReferrer,
|
||||||
uint32_t aReferrerPolicy,
|
uint32_t aReferrerPolicy,
|
||||||
nsIPrincipal* aTriggeringPrincipal,
|
nsIPrincipal* aTriggeringPrincipal,
|
||||||
|
|
@ -10005,6 +10014,7 @@ nsDocShell::InternalLoad(nsIURI* aURI,
|
||||||
INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER));
|
INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER));
|
||||||
loadInfo->SetOriginalURI(aOriginalURI);
|
loadInfo->SetOriginalURI(aOriginalURI);
|
||||||
loadInfo->SetLoadReplace(aLoadReplace);
|
loadInfo->SetLoadReplace(aLoadReplace);
|
||||||
|
loadInfo->SetIsFromProcessingFrameAttributes(aIsFromProcessingFrameAttributes);
|
||||||
loadInfo->SetTriggeringPrincipal(aTriggeringPrincipal);
|
loadInfo->SetTriggeringPrincipal(aTriggeringPrincipal);
|
||||||
loadInfo->SetInheritPrincipal(
|
loadInfo->SetInheritPrincipal(
|
||||||
aFlags & INTERNAL_LOAD_FLAGS_INHERIT_PRINCIPAL);
|
aFlags & INTERNAL_LOAD_FLAGS_INHERIT_PRINCIPAL);
|
||||||
|
|
@ -10053,6 +10063,7 @@ nsDocShell::InternalLoad(nsIURI* aURI,
|
||||||
rv = targetDocShell->InternalLoad(aURI,
|
rv = targetDocShell->InternalLoad(aURI,
|
||||||
aOriginalURI,
|
aOriginalURI,
|
||||||
aLoadReplace,
|
aLoadReplace,
|
||||||
|
aIsFromProcessingFrameAttributes,
|
||||||
aReferrer,
|
aReferrer,
|
||||||
aReferrerPolicy,
|
aReferrerPolicy,
|
||||||
aTriggeringPrincipal,
|
aTriggeringPrincipal,
|
||||||
|
|
@ -10135,6 +10146,7 @@ nsDocShell::InternalLoad(nsIURI* aURI,
|
||||||
// Do this asynchronously
|
// Do this asynchronously
|
||||||
nsCOMPtr<nsIRunnable> ev =
|
nsCOMPtr<nsIRunnable> ev =
|
||||||
new InternalLoadEvent(this, aURI, aOriginalURI, aLoadReplace,
|
new InternalLoadEvent(this, aURI, aOriginalURI, aLoadReplace,
|
||||||
|
aIsFromProcessingFrameAttributes,
|
||||||
aReferrer, aReferrerPolicy,
|
aReferrer, aReferrerPolicy,
|
||||||
aTriggeringPrincipal, principalToInherit,
|
aTriggeringPrincipal, principalToInherit,
|
||||||
aFlags, aTypeHint, aPostData, aHeadersData,
|
aFlags, aTypeHint, aPostData, aHeadersData,
|
||||||
|
|
@ -10661,7 +10673,8 @@ nsDocShell::InternalLoad(nsIURI* aURI,
|
||||||
nsINetworkPredictor::PREDICT_LOAD, this, nullptr);
|
nsINetworkPredictor::PREDICT_LOAD, this, nullptr);
|
||||||
|
|
||||||
nsCOMPtr<nsIRequest> req;
|
nsCOMPtr<nsIRequest> req;
|
||||||
rv = DoURILoad(aURI, aOriginalURI, aLoadReplace, loadFromExternal,
|
rv = DoURILoad(aURI, aOriginalURI, aLoadReplace,
|
||||||
|
aIsFromProcessingFrameAttributes, loadFromExternal,
|
||||||
(aFlags & INTERNAL_LOAD_FLAGS_FORCE_ALLOW_DATA_URI),
|
(aFlags & INTERNAL_LOAD_FLAGS_FORCE_ALLOW_DATA_URI),
|
||||||
aReferrer,
|
aReferrer,
|
||||||
!(aFlags & INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER),
|
!(aFlags & INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER),
|
||||||
|
|
@ -10743,6 +10756,7 @@ nsresult
|
||||||
nsDocShell::DoURILoad(nsIURI* aURI,
|
nsDocShell::DoURILoad(nsIURI* aURI,
|
||||||
nsIURI* aOriginalURI,
|
nsIURI* aOriginalURI,
|
||||||
bool aLoadReplace,
|
bool aLoadReplace,
|
||||||
|
bool aIsFromProcessingFrameAttributes,
|
||||||
bool aLoadFromExternal,
|
bool aLoadFromExternal,
|
||||||
bool aForceAllowDataURI,
|
bool aForceAllowDataURI,
|
||||||
nsIURI* aReferrerURI,
|
nsIURI* aReferrerURI,
|
||||||
|
|
@ -10903,7 +10917,7 @@ nsDocShell::DoURILoad(nsIURI* aURI,
|
||||||
securityFlags |= nsILoadInfo::SEC_SANDBOXED;
|
securityFlags |= nsILoadInfo::SEC_SANDBOXED;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsILoadInfo> loadInfo =
|
RefPtr<LoadInfo> loadInfo =
|
||||||
(aContentPolicyType == nsIContentPolicy::TYPE_DOCUMENT) ?
|
(aContentPolicyType == nsIContentPolicy::TYPE_DOCUMENT) ?
|
||||||
new LoadInfo(loadingWindow, aTriggeringPrincipal, topLevelLoadingContext,
|
new LoadInfo(loadingWindow, aTriggeringPrincipal, topLevelLoadingContext,
|
||||||
securityFlags) :
|
securityFlags) :
|
||||||
|
|
@ -10929,6 +10943,10 @@ nsDocShell::DoURILoad(nsIURI* aURI,
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (aIsFromProcessingFrameAttributes) {
|
||||||
|
loadInfo->SetIsFromProcessingFrameAttributes();
|
||||||
|
}
|
||||||
|
|
||||||
if (!isSrcdoc) {
|
if (!isSrcdoc) {
|
||||||
rv = NS_NewChannelInternal(getter_AddRefs(channel),
|
rv = NS_NewChannelInternal(getter_AddRefs(channel),
|
||||||
aURI,
|
aURI,
|
||||||
|
|
@ -12581,6 +12599,7 @@ nsDocShell::LoadHistoryEntry(nsISHEntry* aEntry, uint32_t aLoadType)
|
||||||
rv = InternalLoad(uri,
|
rv = InternalLoad(uri,
|
||||||
originalURI,
|
originalURI,
|
||||||
loadReplace,
|
loadReplace,
|
||||||
|
false, // Is from processing frame attributes
|
||||||
referrerURI,
|
referrerURI,
|
||||||
referrerPolicy,
|
referrerPolicy,
|
||||||
triggeringPrincipal,
|
triggeringPrincipal,
|
||||||
|
|
@ -14084,6 +14103,7 @@ nsDocShell::OnLinkClickSync(nsIContent* aContent,
|
||||||
nsresult rv = InternalLoad(clonedURI, // New URI
|
nsresult rv = InternalLoad(clonedURI, // New URI
|
||||||
nullptr, // Original URI
|
nullptr, // Original URI
|
||||||
false, // LoadReplace
|
false, // LoadReplace
|
||||||
|
false, // From frame attributes
|
||||||
referer, // Referer URI
|
referer, // Referer URI
|
||||||
refererPolicy, // Referer policy
|
refererPolicy, // Referer policy
|
||||||
triggeringPrincipal,
|
triggeringPrincipal,
|
||||||
|
|
|
||||||
|
|
@ -371,6 +371,7 @@ protected:
|
||||||
nsresult DoURILoad(nsIURI* aURI,
|
nsresult DoURILoad(nsIURI* aURI,
|
||||||
nsIURI* aOriginalURI,
|
nsIURI* aOriginalURI,
|
||||||
bool aLoadReplace,
|
bool aLoadReplace,
|
||||||
|
bool aIsFromProcessingFrameAttributes,
|
||||||
bool aLoadFromExternal,
|
bool aLoadFromExternal,
|
||||||
bool aForceAllowDataURI,
|
bool aForceAllowDataURI,
|
||||||
nsIURI* aReferrer,
|
nsIURI* aReferrer,
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ nsDocShellLoadInfo::nsDocShellLoadInfo()
|
||||||
, mReferrerPolicy(mozilla::net::RP_Default)
|
, mReferrerPolicy(mozilla::net::RP_Default)
|
||||||
, mLoadType(nsIDocShellLoadInfo::loadNormal)
|
, mLoadType(nsIDocShellLoadInfo::loadNormal)
|
||||||
, mIsSrcdocLoad(false)
|
, mIsSrcdocLoad(false)
|
||||||
|
, mIsFromProcessingFrameAttributes(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -310,3 +311,19 @@ nsDocShellLoadInfo::SetBaseURI(nsIURI* aBaseURI)
|
||||||
mBaseURI = aBaseURI;
|
mBaseURI = aBaseURI;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsDocShellLoadInfo::GetIsFromProcessingFrameAttributes(bool* aIsFromProcessingFrameAttributes)
|
||||||
|
{
|
||||||
|
NS_ENSURE_ARG_POINTER(aIsFromProcessingFrameAttributes);
|
||||||
|
|
||||||
|
*aIsFromProcessingFrameAttributes = mIsFromProcessingFrameAttributes;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsDocShellLoadInfo::SetIsFromProcessingFrameAttributes(bool aIsFromProcessingFrameAttributes)
|
||||||
|
{
|
||||||
|
mIsFromProcessingFrameAttributes = aIsFromProcessingFrameAttributes;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,10 @@ protected:
|
||||||
nsString mSrcdocData;
|
nsString mSrcdocData;
|
||||||
nsCOMPtr<nsIDocShell> mSourceDocShell;
|
nsCOMPtr<nsIDocShell> mSourceDocShell;
|
||||||
nsCOMPtr<nsIURI> mBaseURI;
|
nsCOMPtr<nsIURI> mBaseURI;
|
||||||
|
|
||||||
|
// This will be true if this load is triggered by attribute changes.
|
||||||
|
// See nsILoadInfo.isFromProcessingFrameAttributes
|
||||||
|
bool mIsFromProcessingFrameAttributes;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* nsDocShellLoadInfo_h__ */
|
#endif /* nsDocShellLoadInfo_h__ */
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,10 @@ interface nsIDocShell : nsIDocShellTreeItem
|
||||||
* @param aLoadReplace - If set LOAD_REPLACE flag will be set on the
|
* @param aLoadReplace - If set LOAD_REPLACE flag will be set on the
|
||||||
* channel. aOriginalURI is null, this argument is
|
* channel. aOriginalURI is null, this argument is
|
||||||
* ignored.
|
* ignored.
|
||||||
|
* @param aIsFromProcessingFrameAttributes
|
||||||
|
* - If this is a load triggered by changing frame
|
||||||
|
* attributes.
|
||||||
|
* See nsILoadInfo.isFromProcessingFrameAttributes
|
||||||
* @param aReferrer - Referring URI
|
* @param aReferrer - Referring URI
|
||||||
* @param aReferrerPolicy - Referrer policy
|
* @param aReferrerPolicy - Referrer policy
|
||||||
* @param aTriggeringPrincipal - A non-null principal that initiated that load.
|
* @param aTriggeringPrincipal - A non-null principal that initiated that load.
|
||||||
|
|
@ -178,6 +182,7 @@ interface nsIDocShell : nsIDocShellTreeItem
|
||||||
[noscript]void internalLoad(in nsIURI aURI,
|
[noscript]void internalLoad(in nsIURI aURI,
|
||||||
in nsIURI aOriginalURI,
|
in nsIURI aOriginalURI,
|
||||||
in boolean aLoadReplace,
|
in boolean aLoadReplace,
|
||||||
|
in boolean aIsFromProcessingFrameAttributes,
|
||||||
in nsIURI aReferrer,
|
in nsIURI aReferrer,
|
||||||
in unsigned long aReferrerPolicy,
|
in unsigned long aReferrerPolicy,
|
||||||
in nsIPrincipal aTriggeringPrincipal,
|
in nsIPrincipal aTriggeringPrincipal,
|
||||||
|
|
|
||||||
|
|
@ -128,4 +128,10 @@ interface nsIDocShellLoadInfo : nsISupports
|
||||||
* URI as this information isn't embedded in the load's URI.
|
* URI as this information isn't embedded in the load's URI.
|
||||||
*/
|
*/
|
||||||
attribute nsIURI baseURI;
|
attribute nsIURI baseURI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This will be true if this load is triggered by attribute changes.
|
||||||
|
* See nsILoadInfo.isFromProcessingFrameAttributes
|
||||||
|
*/
|
||||||
|
attribute boolean isFromProcessingFrameAttributes;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -588,6 +588,9 @@ nsFrameLoader::ReallyStartLoadingInternal()
|
||||||
flags = nsIWebNavigation::LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
|
flags = nsIWebNavigation::LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
|
||||||
nsIWebNavigation::LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL;
|
nsIWebNavigation::LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Notify that this load resulted from attribute changes.
|
||||||
|
loadInfo->SetIsFromProcessingFrameAttributes(true);
|
||||||
|
|
||||||
// Kick off the load...
|
// Kick off the load...
|
||||||
bool tmpState = mNeedsAsyncDestroy;
|
bool tmpState = mNeedsAsyncDestroy;
|
||||||
|
|
|
||||||
|
|
@ -295,7 +295,8 @@ LoadInfoToLoadInfoArgs(nsILoadInfo *aLoadInfo,
|
||||||
aLoadInfo->CorsUnsafeHeaders(),
|
aLoadInfo->CorsUnsafeHeaders(),
|
||||||
aLoadInfo->GetForcePreflight(),
|
aLoadInfo->GetForcePreflight(),
|
||||||
aLoadInfo->GetIsPreflight(),
|
aLoadInfo->GetIsPreflight(),
|
||||||
aLoadInfo->GetLoadTriggeredFromExternal()
|
aLoadInfo->GetLoadTriggeredFromExternal(),
|
||||||
|
aLoadInfo->GetIsFromProcessingFrameAttributes()
|
||||||
);
|
);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
@ -347,7 +348,7 @@ LoadInfoArgsToLoadInfo(const OptionalLoadInfoArgs& aOptionalLoadInfoArgs,
|
||||||
redirectChain.AppendElement(redirectedPrincipal.forget());
|
redirectChain.AppendElement(redirectedPrincipal.forget());
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsILoadInfo> loadInfo =
|
RefPtr<mozilla::LoadInfo> loadInfo =
|
||||||
new mozilla::LoadInfo(loadingPrincipal,
|
new mozilla::LoadInfo(loadingPrincipal,
|
||||||
triggeringPrincipal,
|
triggeringPrincipal,
|
||||||
principalToInherit,
|
principalToInherit,
|
||||||
|
|
@ -375,8 +376,12 @@ LoadInfoArgsToLoadInfo(const OptionalLoadInfoArgs& aOptionalLoadInfoArgs,
|
||||||
loadInfoArgs.loadTriggeredFromExternal()
|
loadInfoArgs.loadTriggeredFromExternal()
|
||||||
);
|
);
|
||||||
|
|
||||||
loadInfo.forget(outLoadInfo);
|
if (loadInfoArgs.isFromProcessingFrameAttributes()) {
|
||||||
return NS_OK;
|
loadInfo->SetIsFromProcessingFrameAttributes();
|
||||||
|
}
|
||||||
|
|
||||||
|
loadInfo.forget(outLoadInfo);
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
|
||||||
, mForcePreflight(false)
|
, mForcePreflight(false)
|
||||||
, mIsPreflight(false)
|
, mIsPreflight(false)
|
||||||
, mLoadTriggeredFromExternal(false)
|
, mLoadTriggeredFromExternal(false)
|
||||||
|
, mIsFromProcessingFrameAttributes(false)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mLoadingPrincipal);
|
MOZ_ASSERT(mLoadingPrincipal);
|
||||||
MOZ_ASSERT(mTriggeringPrincipal);
|
MOZ_ASSERT(mTriggeringPrincipal);
|
||||||
|
|
@ -241,6 +242,7 @@ LoadInfo::LoadInfo(nsPIDOMWindowOuter* aOuterWindow,
|
||||||
, mForcePreflight(false)
|
, mForcePreflight(false)
|
||||||
, mIsPreflight(false)
|
, mIsPreflight(false)
|
||||||
, mLoadTriggeredFromExternal(false)
|
, mLoadTriggeredFromExternal(false)
|
||||||
|
, mIsFromProcessingFrameAttributes(false)
|
||||||
{
|
{
|
||||||
// Top-level loads are never third-party
|
// Top-level loads are never third-party
|
||||||
// Grab the information we can out of the window.
|
// Grab the information we can out of the window.
|
||||||
|
|
@ -304,6 +306,7 @@ LoadInfo::LoadInfo(const LoadInfo& rhs)
|
||||||
, mForcePreflight(rhs.mForcePreflight)
|
, mForcePreflight(rhs.mForcePreflight)
|
||||||
, mIsPreflight(rhs.mIsPreflight)
|
, mIsPreflight(rhs.mIsPreflight)
|
||||||
, mLoadTriggeredFromExternal(rhs.mLoadTriggeredFromExternal)
|
, mLoadTriggeredFromExternal(rhs.mLoadTriggeredFromExternal)
|
||||||
|
, mIsFromProcessingFrameAttributes(rhs.mIsFromProcessingFrameAttributes)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -355,6 +358,7 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
|
||||||
, mForcePreflight(aForcePreflight)
|
, mForcePreflight(aForcePreflight)
|
||||||
, mIsPreflight(aIsPreflight)
|
, mIsPreflight(aIsPreflight)
|
||||||
, mLoadTriggeredFromExternal(aLoadTriggeredFromExternal)
|
, mLoadTriggeredFromExternal(aLoadTriggeredFromExternal)
|
||||||
|
, mIsFromProcessingFrameAttributes(false)
|
||||||
{
|
{
|
||||||
// Only top level TYPE_DOCUMENT loads can have a null loadingPrincipal
|
// Only top level TYPE_DOCUMENT loads can have a null loadingPrincipal
|
||||||
MOZ_ASSERT(mLoadingPrincipal || aContentPolicyType == nsIContentPolicy::TYPE_DOCUMENT);
|
MOZ_ASSERT(mLoadingPrincipal || aContentPolicyType == nsIContentPolicy::TYPE_DOCUMENT);
|
||||||
|
|
@ -970,5 +974,19 @@ LoadInfo::GetIsTopLevelLoad(bool *aResult)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LoadInfo::SetIsFromProcessingFrameAttributes()
|
||||||
|
{
|
||||||
|
mIsFromProcessingFrameAttributes = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
LoadInfo::GetIsFromProcessingFrameAttributes(bool *aIsFromProcessingFrameAttributes)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(aIsFromProcessingFrameAttributes);
|
||||||
|
*aIsFromProcessingFrameAttributes = mIsFromProcessingFrameAttributes;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace net
|
} // namespace net
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,7 @@ public:
|
||||||
|
|
||||||
void SetIsPreflight();
|
void SetIsPreflight();
|
||||||
void SetUpgradeInsecureRequests();
|
void SetUpgradeInsecureRequests();
|
||||||
|
void SetIsFromProcessingFrameAttributes();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// private constructor that is only allowed to be called from within
|
// private constructor that is only allowed to be called from within
|
||||||
|
|
@ -157,6 +158,11 @@ private:
|
||||||
bool mForcePreflight;
|
bool mForcePreflight;
|
||||||
bool mIsPreflight;
|
bool mIsPreflight;
|
||||||
bool mLoadTriggeredFromExternal;
|
bool mLoadTriggeredFromExternal;
|
||||||
|
|
||||||
|
// Is true if this load was triggered by processing the attributes of the
|
||||||
|
// browsing context container.
|
||||||
|
// See nsILoadInfo.isFromProcessingFrameAttributes
|
||||||
|
bool mIsFromProcessingFrameAttributes;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace net
|
} // namespace net
|
||||||
|
|
|
||||||
|
|
@ -740,4 +740,11 @@ interface nsILoadInfo : nsISupports
|
||||||
* Note that the load for a sub-frame's document will return false here.
|
* Note that the load for a sub-frame's document will return false here.
|
||||||
*/
|
*/
|
||||||
[infallible] readonly attribute boolean isTopLevelLoad;
|
[infallible] readonly attribute boolean isTopLevelLoad;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This attribute will be true if this is a load triggered by
|
||||||
|
* https://html.spec.whatwg.org/multipage/iframe-embed-object.html#process-the-iframe-attributes
|
||||||
|
* or https://html.spec.whatwg.org/multipage/obsolete.html#process-the-frame-attributes
|
||||||
|
*/
|
||||||
|
[infallible] readonly attribute boolean isFromProcessingFrameAttributes;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ struct LoadInfoArgs
|
||||||
bool forcePreflight;
|
bool forcePreflight;
|
||||||
bool isPreflight;
|
bool isPreflight;
|
||||||
bool loadTriggeredFromExternal;
|
bool loadTriggeredFromExternal;
|
||||||
|
bool isFromProcessingFrameAttributes;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -3676,14 +3676,17 @@ HttpBaseChannel::GetPerformance()
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We only add to the document's performance object if it has the same
|
|
||||||
// principal as the one triggering the load. This is to prevent navigations
|
|
||||||
// triggered _by_ the iframe from showing up in the parent document's
|
|
||||||
// performance entries if they have different origins.
|
|
||||||
if (!mLoadInfo->TriggeringPrincipal()->Equals(loadingDocument->NodePrincipal())) {
|
if (!mLoadInfo->TriggeringPrincipal()->Equals(loadingDocument->NodePrincipal())) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mLoadInfo->GetExternalContentPolicyType() == nsIContentPolicy::TYPE_SUBDOCUMENT &&
|
||||||
|
!mLoadInfo->GetIsFromProcessingFrameAttributes()) {
|
||||||
|
// We only report loads caused by processing the attributes of the
|
||||||
|
// browsing context container.
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsPIDOMWindowInner> innerWindow = loadingDocument->GetInnerWindow();
|
nsCOMPtr<nsPIDOMWindowInner> innerWindow = loadingDocument->GetInnerWindow();
|
||||||
if (!innerWindow) {
|
if (!innerWindow) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue