diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-12-17 14:12:04 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-12-17 14:12:04 +0100 |
commit | 51b821b3fdc5a7eab2369cb6a6680598a6264b08 (patch) | |
tree | f3608a518bbb9e31b0a42b9a10742fb11ef5b39b /netwerk | |
parent | 8e44bbb43789e585fab9fc1ce8becc94b45d566c (diff) | |
parent | 680c3eadb6aaec1f3653636db081a519e0f62ef5 (diff) | |
download | UXP-51b821b3fdc5a7eab2369cb6a6680598a6264b08.tar UXP-51b821b3fdc5a7eab2369cb6a6680598a6264b08.tar.gz UXP-51b821b3fdc5a7eab2369cb6a6680598a6264b08.tar.lz UXP-51b821b3fdc5a7eab2369cb6a6680598a6264b08.tar.xz UXP-51b821b3fdc5a7eab2369cb6a6680598a6264b08.zip |
Merge branch 'master' into Sync-weave
Diffstat (limited to 'netwerk')
-rw-r--r-- | netwerk/base/LoadInfo.cpp | 18 | ||||
-rw-r--r-- | netwerk/base/LoadInfo.h | 6 | ||||
-rw-r--r-- | netwerk/base/nsILoadInfo.idl | 7 | ||||
-rw-r--r-- | netwerk/ipc/NeckoChannelParams.ipdlh | 1 | ||||
-rw-r--r-- | netwerk/protocol/http/HttpBaseChannel.cpp | 11 |
5 files changed, 39 insertions, 4 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; }; diff --git a/netwerk/ipc/NeckoChannelParams.ipdlh b/netwerk/ipc/NeckoChannelParams.ipdlh index 2633ef608..2896f427d 100644 --- a/netwerk/ipc/NeckoChannelParams.ipdlh +++ b/netwerk/ipc/NeckoChannelParams.ipdlh @@ -56,6 +56,7 @@ struct LoadInfoArgs bool forcePreflight; bool isPreflight; bool loadTriggeredFromExternal; + bool isFromProcessingFrameAttributes; }; /** diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 03123ceb0..21b661c2b 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -3676,14 +3676,17 @@ HttpBaseChannel::GetPerformance() 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())) { 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(); if (!innerWindow) { return nullptr; |