Loading dom/base/nsContentUtils.cpp +9 −2 Original line number Diff line number Diff line Loading @@ -180,6 +180,7 @@ #include "xpcprivate.h" // nsXPConnect #include "HTMLSplitOnSpacesTokenizer.h" #include "nsContentTypeParser.h" #include "mozIThirdPartyUtil.h" #include "nsIBidiKeyboard.h" Loading Loading @@ -3012,10 +3013,16 @@ nsContentUtils::LoadImage(nsIURI* aURI, nsIDocument* aLoadingDocument, // Make the URI immutable so people won't change it under us NS_TryToSetImmutable(aURI); nsCOMPtr<nsIURI> firstPartyIsolationURI; nsCOMPtr<mozIThirdPartyUtil> thirdPartySvc = do_GetService(THIRDPARTYUTIL_CONTRACTID); thirdPartySvc->GetFirstPartyIsolationURI(nullptr, aLoadingDocument, getter_AddRefs(firstPartyIsolationURI)); // XXXbz using "documentURI" for the initialDocumentURI is not quite // right, but the best we can do here... return imgLoader->LoadImage(aURI, /* uri to load */ documentURI, /* initialDocumentURI */ firstPartyIsolationURI, /* initialDocumentURI */ aReferrer, /* referrer */ aReferrerPolicy, /* referrer policy */ aLoadingPrincipal, /* loading principal */ Loading embedding/browser/nsContextMenuInfo.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ #include "nsIContentPolicy.h" #include "nsAutoPtr.h" #include "imgRequestProxy.h" #include "mozIThirdPartyUtil.h" //***************************************************************************** // class nsContextMenuInfo Loading Loading @@ -294,7 +294,12 @@ nsContextMenuInfo::GetBackgroundImageRequestInternal(nsIDOMNode *aDOMNode, imgRe nsRefPtr<imgLoader> il = imgLoader::GetInstance(); NS_ENSURE_TRUE(il, NS_ERROR_FAILURE); return il->LoadImage(bgUri, nullptr, nullptr, nsCOMPtr<nsIURI> firstPartyIsolationURI; nsCOMPtr<mozIThirdPartyUtil> thirdPartySvc = do_GetService(THIRDPARTYUTIL_CONTRACTID); thirdPartySvc->GetFirstPartyIsolationURI(nullptr, doc, getter_AddRefs(firstPartyIsolationURI)); return il->LoadImage(bgUri, firstPartyIsolationURI, nullptr, doc->GetReferrerPolicy(), principal, nullptr, nullptr, nullptr, nsIRequest::LOAD_NORMAL, nullptr, nsIContentPolicy::TYPE_IMAGE, Loading extensions/cookie/nsCookiePermission.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -358,6 +358,9 @@ nsCookiePermission::CanSetCookie(nsIURI *aURI, } } } // TODO: Why don't we just use this here: // httpChannelInternal->GetDocumentURI(aURI); } return NS_OK; Loading image/public/imgILoader.idl +2 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ interface imgILoader : nsISupports /** * Start the load and decode of an image. * @param aURI the URI to load * @param aInitialDocumentURI the URI that 'initiated' the load -- used for * @param aFirstPartyIsolationURI the URI that 'initiated' the load -- used for * 3rd party cookie blocking * @param aReferrerURI the 'referring' URI * @param aReferrerPolicy the policy to apply to sending referrers. Loading @@ -62,7 +62,7 @@ interface imgILoader : nsISupports * goes away. */ imgIRequest loadImageXPCOM(in nsIURI aURI, in nsIURI aInitialDocumentURL, in nsIURI aFirstPartyIsolationURI, in nsIURI aReferrerURI, in AString aReferrerPolicy, in nsIPrincipal aLoadingPrincipal, Loading image/src/ImageURL.h +7 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,13 @@ public: return newURI.forget(); } nsresult Equals(nsIURI *otherURI, bool *result) { nsAutoCString otherSpec; otherURI->GetSpec(otherSpec); *result = mSpec.Equals(otherSpec); return NS_OK; } private: // Since this is a basic storage class, no duplication of spec parsing is // included in the functionality. Instead, the class depends upon the Loading Loading
dom/base/nsContentUtils.cpp +9 −2 Original line number Diff line number Diff line Loading @@ -180,6 +180,7 @@ #include "xpcprivate.h" // nsXPConnect #include "HTMLSplitOnSpacesTokenizer.h" #include "nsContentTypeParser.h" #include "mozIThirdPartyUtil.h" #include "nsIBidiKeyboard.h" Loading Loading @@ -3012,10 +3013,16 @@ nsContentUtils::LoadImage(nsIURI* aURI, nsIDocument* aLoadingDocument, // Make the URI immutable so people won't change it under us NS_TryToSetImmutable(aURI); nsCOMPtr<nsIURI> firstPartyIsolationURI; nsCOMPtr<mozIThirdPartyUtil> thirdPartySvc = do_GetService(THIRDPARTYUTIL_CONTRACTID); thirdPartySvc->GetFirstPartyIsolationURI(nullptr, aLoadingDocument, getter_AddRefs(firstPartyIsolationURI)); // XXXbz using "documentURI" for the initialDocumentURI is not quite // right, but the best we can do here... return imgLoader->LoadImage(aURI, /* uri to load */ documentURI, /* initialDocumentURI */ firstPartyIsolationURI, /* initialDocumentURI */ aReferrer, /* referrer */ aReferrerPolicy, /* referrer policy */ aLoadingPrincipal, /* loading principal */ Loading
embedding/browser/nsContextMenuInfo.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ #include "nsIContentPolicy.h" #include "nsAutoPtr.h" #include "imgRequestProxy.h" #include "mozIThirdPartyUtil.h" //***************************************************************************** // class nsContextMenuInfo Loading Loading @@ -294,7 +294,12 @@ nsContextMenuInfo::GetBackgroundImageRequestInternal(nsIDOMNode *aDOMNode, imgRe nsRefPtr<imgLoader> il = imgLoader::GetInstance(); NS_ENSURE_TRUE(il, NS_ERROR_FAILURE); return il->LoadImage(bgUri, nullptr, nullptr, nsCOMPtr<nsIURI> firstPartyIsolationURI; nsCOMPtr<mozIThirdPartyUtil> thirdPartySvc = do_GetService(THIRDPARTYUTIL_CONTRACTID); thirdPartySvc->GetFirstPartyIsolationURI(nullptr, doc, getter_AddRefs(firstPartyIsolationURI)); return il->LoadImage(bgUri, firstPartyIsolationURI, nullptr, doc->GetReferrerPolicy(), principal, nullptr, nullptr, nullptr, nsIRequest::LOAD_NORMAL, nullptr, nsIContentPolicy::TYPE_IMAGE, Loading
extensions/cookie/nsCookiePermission.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -358,6 +358,9 @@ nsCookiePermission::CanSetCookie(nsIURI *aURI, } } } // TODO: Why don't we just use this here: // httpChannelInternal->GetDocumentURI(aURI); } return NS_OK; Loading
image/public/imgILoader.idl +2 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ interface imgILoader : nsISupports /** * Start the load and decode of an image. * @param aURI the URI to load * @param aInitialDocumentURI the URI that 'initiated' the load -- used for * @param aFirstPartyIsolationURI the URI that 'initiated' the load -- used for * 3rd party cookie blocking * @param aReferrerURI the 'referring' URI * @param aReferrerPolicy the policy to apply to sending referrers. Loading @@ -62,7 +62,7 @@ interface imgILoader : nsISupports * goes away. */ imgIRequest loadImageXPCOM(in nsIURI aURI, in nsIURI aInitialDocumentURL, in nsIURI aFirstPartyIsolationURI, in nsIURI aReferrerURI, in AString aReferrerPolicy, in nsIPrincipal aLoadingPrincipal, Loading
image/src/ImageURL.h +7 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,13 @@ public: return newURI.forget(); } nsresult Equals(nsIURI *otherURI, bool *result) { nsAutoCString otherSpec; otherURI->GetSpec(otherSpec); *result = mSpec.Equals(otherSpec); return NS_OK; } private: // Since this is a basic storage class, no duplication of spec parsing is // included in the functionality. Instead, the class depends upon the Loading