diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-12-14 12:50:01 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-12-14 12:50:01 +0100 |
commit | fea96b4527a2db6cd97c9053d647478b347d3853 (patch) | |
tree | eeb73acd7f8295dbab17ec993392bce3161be9db /netwerk/base | |
parent | 2e69b03ddd11de777e6d52a995ff0d1675eb58d2 (diff) | |
download | UXP-fea96b4527a2db6cd97c9053d647478b347d3853.tar UXP-fea96b4527a2db6cd97c9053d647478b347d3853.tar.gz UXP-fea96b4527a2db6cd97c9053d647478b347d3853.tar.lz UXP-fea96b4527a2db6cd97c9053d647478b347d3853.tar.xz UXP-fea96b4527a2db6cd97c9053d647478b347d3853.zip |
Do not report resource-timing subdocument loads triggered by that subdocument.
Diffstat (limited to 'netwerk/base')
-rw-r--r-- | netwerk/base/LoadInfo.cpp | 18 | ||||
-rw-r--r-- | netwerk/base/LoadInfo.h | 6 | ||||
-rw-r--r-- | netwerk/base/nsILoadInfo.idl | 7 |
3 files changed, 31 insertions, 0 deletions
diff --git a/netwerk/base/LoadInfo.cpp b/netwerk/base/LoadInfo.cpp index ebe9d4703..d57f644df 100644 --- a/netwerk/base/LoadInfo.cpp +++ b/netwerk/base/LoadInfo.cpp @@ -67,6 +67,7 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal, , mForcePreflight(false) , mIsPreflight(false) , mLoadTriggeredFromExternal(false) + , mIsFromProcessingFrameAttributes(false) { MOZ_ASSERT(mLoadingPrincipal); MOZ_ASSERT(mTriggeringPrincipal); @@ -241,6 +242,7 @@ LoadInfo::LoadInfo(nsPIDOMWindowOuter* aOuterWindow, , mForcePreflight(false) , mIsPreflight(false) , mLoadTriggeredFromExternal(false) + , mIsFromProcessingFrameAttributes(false) { // Top-level loads are never third-party // Grab the information we can out of the window. @@ -304,6 +306,7 @@ LoadInfo::LoadInfo(const LoadInfo& rhs) , mForcePreflight(rhs.mForcePreflight) , mIsPreflight(rhs.mIsPreflight) , mLoadTriggeredFromExternal(rhs.mLoadTriggeredFromExternal) + , mIsFromProcessingFrameAttributes(rhs.mIsFromProcessingFrameAttributes) { } @@ -355,6 +358,7 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal, , mForcePreflight(aForcePreflight) , mIsPreflight(aIsPreflight) , mLoadTriggeredFromExternal(aLoadTriggeredFromExternal) + , mIsFromProcessingFrameAttributes(false) { // Only top level TYPE_DOCUMENT loads can have a null loadingPrincipal MOZ_ASSERT(mLoadingPrincipal || aContentPolicyType == nsIContentPolicy::TYPE_DOCUMENT); @@ -970,5 +974,19 @@ LoadInfo::GetIsTopLevelLoad(bool *aResult) 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 mozilla diff --git a/netwerk/base/LoadInfo.h b/netwerk/base/LoadInfo.h index 2b1e8c9e8..a4ec25a9d 100644 --- a/netwerk/base/LoadInfo.h +++ b/netwerk/base/LoadInfo.h @@ -81,6 +81,7 @@ public: void SetIsPreflight(); void SetUpgradeInsecureRequests(); + void SetIsFromProcessingFrameAttributes(); private: // private constructor that is only allowed to be called from within @@ -157,6 +158,11 @@ private: bool mForcePreflight; bool mIsPreflight; 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 diff --git a/netwerk/base/nsILoadInfo.idl b/netwerk/base/nsILoadInfo.idl index bc609c317..fc1aadd93 100644 --- a/netwerk/base/nsILoadInfo.idl +++ b/netwerk/base/nsILoadInfo.idl @@ -740,4 +740,11 @@ interface nsILoadInfo : nsISupports * Note that the load for a sub-frame's document will return false here. */ [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; }; |