From d6d727a69eaf065c0eb205f233ede4912c3c1d8a Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Sat, 13 May 2017 13:55:11 +0200 Subject: [PATCH] backout of f9abb9c83452 (bug 1319111) for crashes, r=bz --- addon-sdk/source/test/test-xpcom.js | 1 - browser/components/about/AboutRedirector.cpp | 20 ++-- browser/components/feeds/FeedConverter.js | 5 +- .../test/browser_parentProcessRestoreHash.js | 1 - .../pdfjs/content/PdfStreamConverter.jsm | 1 - .../extensions/pocket/content/AboutPocket.jsm | 1 - chrome/nsChromeProtocolHandler.cpp | 5 +- .../framework/about-devtools-toolbox.js | 4 - docshell/base/nsAboutRedirector.cpp | 20 ++-- docshell/base/nsDocShell.cpp | 6 - dom/file/nsHostObjectProtocolHandler.cpp | 2 - dom/html/nsHTMLDocument.cpp | 1 - mobile/android/components/AboutRedirector.js | 1 - mobile/android/extensions/flyweb/bootstrap.js | 1 - netwerk/base/LoadInfo.cpp | 15 --- netwerk/base/LoadInfo.h | 1 - netwerk/base/nsILoadInfo.idl | 9 -- netwerk/base/nsNetUtil.cpp | 47 +++----- netwerk/base/nsNetUtil.h | 8 +- netwerk/protocol/file/nsFileChannel.cpp | 3 + netwerk/protocol/http/HttpBaseChannel.cpp | 109 ++++++++---------- netwerk/protocol/http/HttpBaseChannel.h | 2 - netwerk/protocol/http/HttpChannelChild.cpp | 3 +- netwerk/protocol/http/nsHttpChannel.cpp | 19 ++- .../protocol/res/ExtensionProtocolHandler.h | 4 - .../res/SubstitutingProtocolHandler.cpp | 15 +-- .../viewsource/nsViewSourceHandler.cpp | 12 -- .../protocol/wyciwyg/WyciwygChannelParent.cpp | 6 +- .../converters/nsMultiMixedConv.cpp | 4 - netwerk/test/unit/test_file_protocol.js | 3 + services/sync/Weave.js | 1 - .../content/content-about-page-utils.js | 1 - .../content/tabswitch-content-process.js | 1 - .../talos/talos/tests/tabswitch/install.rdf | 2 +- .../tests/tabswitch/tabswitch-signed.xpi | Bin 12774 -> 13350 bytes .../mozprotocol/mozProtocolHandler.js | 1 + ...r_hasInsecureLoginForms_streamConverter.js | 1 - .../places/PageIconProtocolHandler.js | 1 - .../thumbnails/PageThumbsProtocol.js | 1 - .../test/browser/browser_openDialog.js | 1 - 40 files changed, 119 insertions(+), 220 deletions(-) diff --git a/addon-sdk/source/test/test-xpcom.js b/addon-sdk/source/test/test-xpcom.js index 8abbbb4a090f..97631bd3cde0 100644 --- a/addon-sdk/source/test/test-xpcom.js +++ b/addon-sdk/source/test/test-xpcom.js @@ -145,7 +145,6 @@ function testRegister(assert, text) { var channel = ios.newChannelFromURIWithLoadInfo(uri, aLoadInfo); channel.originalURI = aURI; - aLoadInfo.resultPrincipalURI = aURI; return channel; }, getURIFlags: function(aURI) { diff --git a/browser/components/about/AboutRedirector.cpp b/browser/components/about/AboutRedirector.cpp index ae788fb4cd73..b9de6a318722 100644 --- a/browser/components/about/AboutRedirector.cpp +++ b/browser/components/about/AboutRedirector.cpp @@ -172,23 +172,27 @@ AboutRedirector::NewChannel(nsIURI* aURI, rv = NS_NewURI(getter_AddRefs(tempURI), url); NS_ENSURE_SUCCESS(rv, rv); - // If tempURI links to an internal URI (chrome://, resource://) - // then set the result principal URL on the channel's load info. - // Otherwise, we leave it null which forces the channel principal - // to reflect the displayed URL rather than being the systemPrincipal. + // If tempURI links to an external URI (i.e. something other than + // chrome:// or resource://) then set the LOAD_REPLACE flag on the + // channel which forces the channel owner to reflect the displayed + // URL rather then being the systemPrincipal. bool isUIResource = false; rv = NS_URIChainHasFlags(tempURI, nsIProtocolHandler::URI_IS_UI_RESOURCE, &isUIResource); NS_ENSURE_SUCCESS(rv, rv); + nsLoadFlags loadFlags = isUIResource + ? static_cast(nsIChannel::LOAD_NORMAL) + : static_cast(nsIChannel::LOAD_REPLACE); + rv = NS_NewChannelInternal(getter_AddRefs(tempChannel), tempURI, - aLoadInfo); + aLoadInfo, + nullptr, // aLoadGroup + nullptr, // aCallbacks + loadFlags); NS_ENSURE_SUCCESS(rv, rv); - if (isUIResource) { - aLoadInfo->SetResultPrincipalURI(aURI); - } tempChannel->SetOriginalURI(aURI); NS_ADDREF(*result = tempChannel); diff --git a/browser/components/feeds/FeedConverter.js b/browser/components/feeds/FeedConverter.js index fb259fee5f1b..86b7f6c91b67 100644 --- a/browser/components/feeds/FeedConverter.js +++ b/browser/components/feeds/FeedConverter.js @@ -253,7 +253,6 @@ FeedConverter.prototype = { let aboutFeedsURI = ios.newURI("about:feeds"); chromeChannel = ios.newChannelFromURIWithLoadInfo(aboutFeedsURI, loadInfo); chromeChannel.originalURI = result.uri; - loadInfo.resultPrincipalURI = result.uri; // carry the origin attributes from the channel that loaded the feed. chromeChannel.owner = @@ -561,12 +560,10 @@ GenericProtocolHandler.prototype = { const schemeId = this._getTelemetrySchemeId(); Services.telemetry.getHistogramById("FEED_PROTOCOL_USAGE").add(schemeId); - if (channel instanceof Components.interfaces.nsIHttpChannel) { + if (channel instanceof Components.interfaces.nsIHttpChannel) // Set this so we know this is supposed to be a feed channel.setRequestHeader("X-Moz-Is-Feed", "1", false); - } channel.originalURI = aUri; - aLoadInfo.resultPrincipalURI = aUri; return channel; }, diff --git a/browser/components/sessionstore/test/browser_parentProcessRestoreHash.js b/browser/components/sessionstore/test/browser_parentProcessRestoreHash.js index ab62eec43879..fde9467491ca 100644 --- a/browser/components/sessionstore/test/browser_parentProcessRestoreHash.js +++ b/browser/components/sessionstore/test/browser_parentProcessRestoreHash.js @@ -26,7 +26,6 @@ let TestAboutPage = { let channel = Services.io.newChannelFromURIWithLoadInfo(newURI, aLoadInfo); channel.originalURI = aURI; - aLoadInfo.resultPrincipalURI = aURI; return channel; }, diff --git a/browser/extensions/pdfjs/content/PdfStreamConverter.jsm b/browser/extensions/pdfjs/content/PdfStreamConverter.jsm index eebda99130cd..9b10554b853c 100644 --- a/browser/extensions/pdfjs/content/PdfStreamConverter.jsm +++ b/browser/extensions/pdfjs/content/PdfStreamConverter.jsm @@ -1003,7 +1003,6 @@ PdfStreamConverter.prototype = { // Keep the URL the same so the browser sees it as the same. channel.originalURI = aRequest.URI; - channel.loadInfo.resultPrincipalURI = aRequest.loadInfo.resultPrincipalURI; channel.loadGroup = aRequest.loadGroup; channel.loadInfo.originAttributes = aRequest.loadInfo.originAttributes; diff --git a/browser/extensions/pocket/content/AboutPocket.jsm b/browser/extensions/pocket/content/AboutPocket.jsm index 13be47111820..9fe76e8c5b73 100644 --- a/browser/extensions/pocket/content/AboutPocket.jsm +++ b/browser/extensions/pocket/content/AboutPocket.jsm @@ -40,7 +40,6 @@ AboutPage.prototype = { let channel = Services.io.newChannelFromURIWithLoadInfo(newURI, aLoadInfo); channel.originalURI = aURI; - aLoadInfo.resultPrincipalURI = aURI; if (this.uriFlags & Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT) { let principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(aURI); diff --git a/chrome/nsChromeProtocolHandler.cpp b/chrome/nsChromeProtocolHandler.cpp index a647a50a3231..f66c6d362f3f 100644 --- a/chrome/nsChromeProtocolHandler.cpp +++ b/chrome/nsChromeProtocolHandler.cpp @@ -168,11 +168,12 @@ nsChromeProtocolHandler::NewChannel2(nsIURI* aURI, // Make sure that the channel remembers where it was // originally loaded from. + nsLoadFlags loadFlags = 0; + result->GetLoadFlags(&loadFlags); + result->SetLoadFlags(loadFlags & ~nsIChannel::LOAD_REPLACE); rv = result->SetOriginalURI(aURI); if (NS_FAILED(rv)) return rv; - aLoadInfo->SetResultPrincipalURI(aURI); - // Get a system principal for content files and set the owner // property of the result nsCOMPtr url = do_QueryInterface(aURI); diff --git a/devtools/client/framework/about-devtools-toolbox.js b/devtools/client/framework/about-devtools-toolbox.js index 24f37a4c5464..e929ee03059e 100644 --- a/devtools/client/framework/about-devtools-toolbox.js +++ b/devtools/client/framework/about-devtools-toolbox.js @@ -26,10 +26,6 @@ AboutURL.prototype = { newChannel: function (aURI, aLoadInfo) { let chan = Services.io.newChannelFromURIWithLoadInfo(this.uri, aLoadInfo); chan.owner = Services.scriptSecurityManager.getSystemPrincipal(); - - // Must set the result principal URI _after_ we've created the channel - // since the chrome protocol would overwrite it with a chrome:// URL. - aLoadInfo.resultPrincipalURI = aURI; return chan; }, diff --git a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp index 63103bfecf4e..bb3989a15e5a 100644 --- a/docshell/base/nsAboutRedirector.cpp +++ b/docshell/base/nsAboutRedirector.cpp @@ -174,10 +174,10 @@ nsAboutRedirector::NewChannel(nsIURI* aURI, rv = NS_NewURI(getter_AddRefs(tempURI), kRedirMap[i].url); NS_ENSURE_SUCCESS(rv, rv); - // If tempURI links to an internal URI (chrome://, resource://, about:) - // then set the result principal URL on the channel's load info. - // Otherwise, we leave it null which forces the channel principal - // to reflect the displayed URL rather than being the systemPrincipal. + // If tempURI links to an external URI (i.e. something other than + // chrome:// or resource://) then set the LOAD_REPLACE flag on the + // channel which forces the channel owner to reflect the displayed + // URL rather then being the systemPrincipal. bool isUIResource = false; rv = NS_URIChainHasFlags(tempURI, nsIProtocolHandler::URI_IS_UI_RESOURCE, &isUIResource); @@ -185,14 +185,18 @@ nsAboutRedirector::NewChannel(nsIURI* aURI, bool isAboutBlank = NS_IsAboutBlank(tempURI); + nsLoadFlags loadFlags = isUIResource || isAboutBlank + ? static_cast(nsIChannel::LOAD_NORMAL) + : static_cast(nsIChannel::LOAD_REPLACE); + rv = NS_NewChannelInternal(getter_AddRefs(tempChannel), tempURI, - aLoadInfo); + aLoadInfo, + nullptr, // aLoadGroup + nullptr, // aCallbacks + loadFlags); NS_ENSURE_SUCCESS(rv, rv); - if (isUIResource || isAboutBlank) { - aLoadInfo->SetResultPrincipalURI(aURI); - } tempChannel->SetOriginalURI(aURI); tempChannel.forget(aResult); diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 79029faf9ad3..442b81ce580b 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -11182,12 +11182,6 @@ nsDocShell::DoURILoad(nsIURI* aURI, if (aOriginalURI) { channel->SetOriginalURI(aOriginalURI); - // The LOAD_REPLACE flag and its handling here will be removed as part - // of bug 1319110. For now preserve its restoration here to not break - // any code expecting it being set specially on redirected channels. - // If the flag has originally been set to change result of - // NS_GetFinalChannelURI it won't have any effect and also won't cause - // any harm. if (aLoadReplace) { uint32_t loadFlags; channel->GetLoadFlags(&loadFlags); diff --git a/dom/file/nsHostObjectProtocolHandler.cpp b/dom/file/nsHostObjectProtocolHandler.cpp index 4de46fe36cd3..c5d7e1e863d5 100644 --- a/dom/file/nsHostObjectProtocolHandler.cpp +++ b/dom/file/nsHostObjectProtocolHandler.cpp @@ -883,8 +883,6 @@ nsHostObjectProtocolHandler::NewChannel2(nsIURI* uri, } channel->SetOriginalURI(uri); - aLoadInfo->SetResultPrincipalURI(uri); - channel->SetContentType(NS_ConvertUTF16toUTF8(contentType)); channel->SetContentLength(size); diff --git a/dom/html/nsHTMLDocument.cpp b/dom/html/nsHTMLDocument.cpp index 3c3e6b32c277..81aca17b1e19 100644 --- a/dom/html/nsHTMLDocument.cpp +++ b/dom/html/nsHTMLDocument.cpp @@ -2412,7 +2412,6 @@ nsHTMLDocument::CreateAndAddWyciwygChannel(void) channel->SetLoadFlags(loadFlags); channel->SetOriginalURI(wcwgURI); - loadInfo->SetResultPrincipalURI(wcwgURI); rv = loadGroup->AddRequest(mWyciwygChannel, nullptr); NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to add request to load group."); diff --git a/mobile/android/components/AboutRedirector.js b/mobile/android/components/AboutRedirector.js index f6801b8fdd6a..c738e3a01333 100644 --- a/mobile/android/components/AboutRedirector.js +++ b/mobile/android/components/AboutRedirector.js @@ -123,7 +123,6 @@ AboutRedirector.prototype = { } channel.originalURI = aURI; - aLoadInfo.resultPrincipalURI = aURI; return channel; } diff --git a/mobile/android/extensions/flyweb/bootstrap.js b/mobile/android/extensions/flyweb/bootstrap.js index 4a87c4bdd975..d1493b08afe5 100644 --- a/mobile/android/extensions/flyweb/bootstrap.js +++ b/mobile/android/extensions/flyweb/bootstrap.js @@ -38,7 +38,6 @@ AboutFlyWeb.prototype = Object.freeze({ let uri = Services.io.newURI("chrome://flyweb/content/aboutFlyWeb.xhtml"); let channel = Services.io.newChannelFromURIWithLoadInfo(uri, aLoadInfo); channel.originalURI = aURI; - aLoadInfo.resultPrincipalURI = aURI; return channel; } }); diff --git a/netwerk/base/LoadInfo.cpp b/netwerk/base/LoadInfo.cpp index 82af31fa2762..1dffcb2f2d02 100644 --- a/netwerk/base/LoadInfo.cpp +++ b/netwerk/base/LoadInfo.cpp @@ -269,7 +269,6 @@ LoadInfo::LoadInfo(const LoadInfo& rhs) , mTriggeringPrincipal(rhs.mTriggeringPrincipal) , mPrincipalToInherit(rhs.mPrincipalToInherit) , mSandboxedLoadingPrincipal(rhs.mSandboxedLoadingPrincipal) - , mResultPrincipalURI(rhs.mResultPrincipalURI) , mLoadingContext(rhs.mLoadingContext) , mSecurityFlags(rhs.mSecurityFlags) , mInternalContentPolicyType(rhs.mInternalContentPolicyType) @@ -937,19 +936,5 @@ LoadInfo::GetIsTopLevelLoad(bool *aResult) return NS_OK; } -NS_IMETHODIMP -LoadInfo::GetResultPrincipalURI(nsIURI **aURI) -{ - NS_IF_ADDREF(*aURI = mResultPrincipalURI); - return NS_OK; -} - -NS_IMETHODIMP -LoadInfo::SetResultPrincipalURI(nsIURI *aURI) -{ - mResultPrincipalURI = aURI; - return NS_OK; -} - } // namespace net } // namespace mozilla diff --git a/netwerk/base/LoadInfo.h b/netwerk/base/LoadInfo.h index fdb1ff0ecb62..6dfcc5a92a24 100644 --- a/netwerk/base/LoadInfo.h +++ b/netwerk/base/LoadInfo.h @@ -128,7 +128,6 @@ private: nsCOMPtr mTriggeringPrincipal; nsCOMPtr mPrincipalToInherit; nsCOMPtr mSandboxedLoadingPrincipal; - nsCOMPtr mResultPrincipalURI; nsWeakPtr mLoadingContext; nsSecurityFlags mSecurityFlags; nsContentPolicyType mInternalContentPolicyType; diff --git a/netwerk/base/nsILoadInfo.idl b/netwerk/base/nsILoadInfo.idl index a64a5cef6b28..326fbe1004e9 100644 --- a/netwerk/base/nsILoadInfo.idl +++ b/netwerk/base/nsILoadInfo.idl @@ -10,7 +10,6 @@ interface nsIDOMDocument; interface nsINode; interface nsIPrincipal; -interface nsIURI; %{C++ #include "nsTArray.h" @@ -741,14 +740,6 @@ interface nsILoadInfo : nsISupports */ [infallible] readonly attribute boolean isTopLevelLoad; - /** - * If this is non-null, this property represents two things: (1) the - * URI to be used for the principal if the channel with this loadinfo - * gets a principal based on URI and (2) the URI to use for a document - * created from the channel with this loadinfo. - */ - attribute nsIURI resultPrincipalURI; - /** * Returns the null principal of the resulting resource if the SEC_SANDBOXED * flag is set. Otherwise returns null. This is used by diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp index 0680d9c7ab22..0edbaf2329e5 100644 --- a/netwerk/base/nsNetUtil.cpp +++ b/netwerk/base/nsNetUtil.cpp @@ -189,21 +189,13 @@ NS_NewChannelInternal(nsIChannel **outChannel, } if (aLoadFlags != nsIRequest::LOAD_NORMAL) { - rv = channel->SetLoadFlags(aLoadFlags); + // Retain the LOAD_REPLACE load flag if set. + nsLoadFlags normalLoadFlags = 0; + channel->GetLoadFlags(&normalLoadFlags); + rv = channel->SetLoadFlags(aLoadFlags | (normalLoadFlags & nsIChannel::LOAD_REPLACE)); NS_ENSURE_SUCCESS(rv, rv); } -#ifdef DEBUG - nsLoadFlags channelLoadFlags = 0; - channel->GetLoadFlags(&channelLoadFlags); - // Will be removed when we remove LOAD_REPLACE altogether - // This check is trying to catch protocol handlers that still - // try to set the LOAD_REPLACE flag. Only exception is when - // this flag is carried in the aLoadFlags argument (e.g. when - // cloning redirected channels for CORS preflight.) - MOZ_ASSERT(!((channelLoadFlags & ~aLoadFlags) & nsIChannel::LOAD_REPLACE)); -#endif - channel.forget(outChannel); return NS_OK; } @@ -276,21 +268,13 @@ NS_NewChannelInternal(nsIChannel **outChannel, } if (aLoadFlags != nsIRequest::LOAD_NORMAL) { - rv = channel->SetLoadFlags(aLoadFlags); + // Retain the LOAD_REPLACE load flag if set. + nsLoadFlags normalLoadFlags = 0; + channel->GetLoadFlags(&normalLoadFlags); + rv = channel->SetLoadFlags(aLoadFlags | (normalLoadFlags & nsIChannel::LOAD_REPLACE)); NS_ENSURE_SUCCESS(rv, rv); } -#ifdef DEBUG - nsLoadFlags channelLoadFlags = 0; - channel->GetLoadFlags(&channelLoadFlags); - // Will be removed when we remove LOAD_REPLACE altogether - // This check is trying to catch protocol handlers that still - // try to set the LOAD_REPLACE flag. Only exception is when - // this flag is carried in the aLoadFlags argument (e.g. when - // cloning redirected channels for CORS preflight.) - MOZ_ASSERT(!((channelLoadFlags & ~aLoadFlags) & nsIChannel::LOAD_REPLACE)); -#endif - channel.forget(outChannel); return NS_OK; } @@ -1901,18 +1885,15 @@ nsresult NS_GetFinalChannelURI(nsIChannel *channel, nsIURI **uri) { *uri = nullptr; + nsLoadFlags loadFlags = 0; + nsresult rv = channel->GetLoadFlags(&loadFlags); + NS_ENSURE_SUCCESS(rv, rv); - nsCOMPtr loadInfo = channel->GetLoadInfo(); - if (loadInfo) { - nsCOMPtr resultPrincipalURI; - loadInfo->GetResultPrincipalURI(getter_AddRefs(resultPrincipalURI)); - if (resultPrincipalURI) { - resultPrincipalURI.forget(uri); - return NS_OK; - } + if (loadFlags & nsIChannel::LOAD_REPLACE) { + return channel->GetURI(uri); } - return channel->GetURI(uri); + return channel->GetOriginalURI(uri); } nsresult diff --git a/netwerk/base/nsNetUtil.h b/netwerk/base/nsNetUtil.h index 6dd6d495a4c0..02e9c7972362 100644 --- a/netwerk/base/nsNetUtil.h +++ b/netwerk/base/nsNetUtil.h @@ -781,9 +781,11 @@ nsresult NS_URIChainHasFlags(nsIURI *uri, already_AddRefed NS_GetInnermostURI(nsIURI *aURI); /** - * Get the "final" URI for a channel. This is either channel's load info - * resultPrincipalURI, if set, or GetURI. In most cases (but not all) load - * info resultPrincipalURI, if set, corresponds to originalURI of the channel. + * Get the "final" URI for a channel. This is either the same as GetURI or + * GetOriginalURI, depending on whether this channel has + * nsIChanel::LOAD_REPLACE set. For channels without that flag set, the final + * URI is the original URI, while for ones with the flag the final URI is the + * channel URI. */ nsresult NS_GetFinalChannelURI(nsIChannel *channel, nsIURI **uri); diff --git a/netwerk/protocol/file/nsFileChannel.cpp b/netwerk/protocol/file/nsFileChannel.cpp index 6160a441f0d3..dc66920c9a62 100644 --- a/netwerk/protocol/file/nsFileChannel.cpp +++ b/netwerk/protocol/file/nsFileChannel.cpp @@ -290,6 +290,9 @@ nsFileChannel::nsFileChannel(nsIURI *uri) SetURI(targetURI); SetOriginalURI(uri); + nsLoadFlags loadFlags = 0; + GetLoadFlags(&loadFlags); + SetLoadFlags(loadFlags | nsIChannel::LOAD_REPLACE); } else { SetURI(uri); } diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 2f4dac8b952c..f0b9a4c1dc3f 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -2973,64 +2973,6 @@ void HttpBaseChannel::AssertPrivateBrowsingId() } #endif -already_AddRefed -HttpBaseChannel::CloneLoadInfoForRedirect(nsIURI * newURI, uint32_t redirectFlags) -{ - // make a copy of the loadinfo, append to the redirectchain - // this will be set on the newly created channel for the redirect target. - if (!mLoadInfo) { - return nullptr; - } - - nsCOMPtr newLoadInfo = - static_cast(mLoadInfo.get())->Clone(); - - nsContentPolicyType contentPolicyType = mLoadInfo->GetExternalContentPolicyType(); - if (contentPolicyType == nsIContentPolicy::TYPE_DOCUMENT || - contentPolicyType == nsIContentPolicy::TYPE_SUBDOCUMENT) { - nsCOMPtr nullPrincipalToInherit = NullPrincipal::Create(); - newLoadInfo->SetPrincipalToInherit(nullPrincipalToInherit); - } - - // re-compute the origin attributes of the loadInfo if it's top-level load. - bool isTopLevelDoc = - newLoadInfo->GetExternalContentPolicyType() == nsIContentPolicy::TYPE_DOCUMENT; - - if (isTopLevelDoc) { - nsCOMPtr loadContext; - NS_QueryNotificationCallbacks(this, loadContext); - OriginAttributes docShellAttrs; - if (loadContext) { - loadContext->GetOriginAttributes(docShellAttrs); - } - - OriginAttributes attrs = newLoadInfo->GetOriginAttributes(); - - MOZ_ASSERT(docShellAttrs.mUserContextId == attrs.mUserContextId, - "docshell and necko should have the same userContextId attribute."); - MOZ_ASSERT(docShellAttrs.mInIsolatedMozBrowser == attrs.mInIsolatedMozBrowser, - "docshell and necko should have the same inIsolatedMozBrowser attribute."); - MOZ_ASSERT(docShellAttrs.mPrivateBrowsingId == attrs.mPrivateBrowsingId, - "docshell and necko should have the same privateBrowsingId attribute."); - - attrs = docShellAttrs; - attrs.SetFirstPartyDomain(true, newURI); - newLoadInfo->SetOriginAttributes(attrs); - } - - // Drop the target principal URI from the cloned load info because we want - // NS_GetFinalChannelURI to return either the URI of the target channel - // or anything that the target protocol handler potentially sets itself. - newLoadInfo->SetResultPrincipalURI(nullptr); - - bool isInternalRedirect = - (redirectFlags & (nsIChannelEventSink::REDIRECT_INTERNAL | - nsIChannelEventSink::REDIRECT_STS_UPGRADE)); - newLoadInfo->AppendRedirectedPrincipal(GetURIPrincipal(), isInternalRedirect); - - return newLoadInfo.forget(); -} - //----------------------------------------------------------------------------- // nsHttpChannel::nsITraceableChannel //----------------------------------------------------------------------------- @@ -3219,6 +3161,57 @@ HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI, } } + // make a copy of the loadinfo, append to the redirectchain + // and set it on the new channel + if (mLoadInfo) { + nsCOMPtr newLoadInfo = + static_cast(mLoadInfo.get())->Clone(); + + nsContentPolicyType contentPolicyType = mLoadInfo->GetExternalContentPolicyType(); + if (contentPolicyType == nsIContentPolicy::TYPE_DOCUMENT || + contentPolicyType == nsIContentPolicy::TYPE_SUBDOCUMENT) { + nsCOMPtr nullPrincipalToInherit = NullPrincipal::Create(); + newLoadInfo->SetPrincipalToInherit(nullPrincipalToInherit); + } + + // re-compute the origin attributes of the loadInfo if it's top-level load. + bool isTopLevelDoc = + newLoadInfo->GetExternalContentPolicyType() == nsIContentPolicy::TYPE_DOCUMENT; + + if (isTopLevelDoc) { + nsCOMPtr loadContext; + NS_QueryNotificationCallbacks(this, loadContext); + OriginAttributes docShellAttrs; + if (loadContext) { + loadContext->GetOriginAttributes(docShellAttrs); + } + + OriginAttributes attrs = newLoadInfo->GetOriginAttributes(); + + MOZ_ASSERT(docShellAttrs.mUserContextId == attrs.mUserContextId, + "docshell and necko should have the same userContextId attribute."); + MOZ_ASSERT(docShellAttrs.mInIsolatedMozBrowser == attrs.mInIsolatedMozBrowser, + "docshell and necko should have the same inIsolatedMozBrowser attribute."); + MOZ_ASSERT(docShellAttrs.mPrivateBrowsingId == attrs.mPrivateBrowsingId, + "docshell and necko should have the same privateBrowsingId attribute."); + + attrs = docShellAttrs; + attrs.SetFirstPartyDomain(true, newURI); + newLoadInfo->SetOriginAttributes(attrs); + } + + bool isInternalRedirect = + (redirectFlags & (nsIChannelEventSink::REDIRECT_INTERNAL | + nsIChannelEventSink::REDIRECT_STS_UPGRADE)); + newLoadInfo->AppendRedirectedPrincipal(GetURIPrincipal(), isInternalRedirect); + newChannel->SetLoadInfo(newLoadInfo); + } + else { + // the newChannel was created with a dummy loadInfo, we should clear + // it in case the original channel does not have a loadInfo + newChannel->SetLoadInfo(nullptr); + } + nsCOMPtr httpChannel = do_QueryInterface(newChannel); if (!httpChannel) return NS_OK; // no other options to set diff --git a/netwerk/protocol/http/HttpBaseChannel.h b/netwerk/protocol/http/HttpBaseChannel.h index b78f287bdf3d..3b611801e9d0 100644 --- a/netwerk/protocol/http/HttpBaseChannel.h +++ b/netwerk/protocol/http/HttpBaseChannel.h @@ -424,8 +424,6 @@ protected: void AssertPrivateBrowsingId(); #endif - already_AddRefed CloneLoadInfoForRedirect(nsIURI *newURI, uint32_t redirectFlags); - friend class PrivateBrowsingChannel; friend class InterceptFailedOnStop; diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index 76cb4ca901c6..471cbe6494e4 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -1493,10 +1493,9 @@ HttpChannelChild::SetupRedirect(nsIURI* uri, NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr newChannel; - nsCOMPtr redirectLoadInfo = CloneLoadInfoForRedirect(uri, redirectFlags); rv = NS_NewChannelInternal(getter_AddRefs(newChannel), uri, - redirectLoadInfo, + mLoadInfo, nullptr, // aLoadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index 4bf0708990c1..39b7d2bebbc9 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -2620,8 +2620,6 @@ nsHttpChannel::StartRedirectChannelToURI(nsIURI *upgradedURI, uint32_t flags) LOG(("nsHttpChannel::StartRedirectChannelToURI()\n")); nsCOMPtr newChannel; - nsCOMPtr redirectLoadInfo = CloneLoadInfoForRedirect(upgradedURI, - flags); nsCOMPtr ioService; rv = gHttpHandler->GetIOService(getter_AddRefs(ioService)); @@ -2629,7 +2627,7 @@ nsHttpChannel::StartRedirectChannelToURI(nsIURI *upgradedURI, uint32_t flags) rv = NS_NewChannelInternal(getter_AddRefs(newChannel), upgradedURI, - redirectLoadInfo, + mLoadInfo, nullptr, // aLoadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, @@ -5481,23 +5479,22 @@ nsHttpChannel::ContinueProcessRedirectionAfterFallback(nsresult rv) rv = gHttpHandler->GetIOService(getter_AddRefs(ioService)); if (NS_FAILED(rv)) return rv; - uint32_t redirectFlags; - if (nsHttp::IsPermanentRedirect(mRedirectType)) - redirectFlags = nsIChannelEventSink::REDIRECT_PERMANENT; - else - redirectFlags = nsIChannelEventSink::REDIRECT_TEMPORARY; - nsCOMPtr newChannel; - nsCOMPtr redirectLoadInfo = CloneLoadInfoForRedirect(mRedirectURI, redirectFlags); rv = NS_NewChannelInternal(getter_AddRefs(newChannel), mRedirectURI, - redirectLoadInfo, + mLoadInfo, nullptr, // aLoadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, ioService); NS_ENSURE_SUCCESS(rv, rv); + uint32_t redirectFlags; + if (nsHttp::IsPermanentRedirect(mRedirectType)) + redirectFlags = nsIChannelEventSink::REDIRECT_PERMANENT; + else + redirectFlags = nsIChannelEventSink::REDIRECT_TEMPORARY; + rv = SetupReplacementChannel(mRedirectURI, newChannel, !rewriteToGET, redirectFlags); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/protocol/res/ExtensionProtocolHandler.h b/netwerk/protocol/res/ExtensionProtocolHandler.h index 9bb08343ab14..ebafd68d34dd 100644 --- a/netwerk/protocol/res/ExtensionProtocolHandler.h +++ b/netwerk/protocol/res/ExtensionProtocolHandler.h @@ -33,10 +33,6 @@ protected: const nsACString& aPathname, nsACString& aResult) override; - // |result| is an inout param. On entry to this function, *result - // is expected to be non-null and already addrefed. This function - // may release the object stored in *result on entry and write - // a new pointer to an already addrefed channel to *result. virtual MOZ_MUST_USE nsresult SubstituteChannel(nsIURI* uri, nsILoadInfo* aLoadInfo, nsIChannel** result) override; diff --git a/netwerk/protocol/res/SubstitutingProtocolHandler.cpp b/netwerk/protocol/res/SubstitutingProtocolHandler.cpp index 0e9efc4d6969..99061e0f7158 100644 --- a/netwerk/protocol/res/SubstitutingProtocolHandler.cpp +++ b/netwerk/protocol/res/SubstitutingProtocolHandler.cpp @@ -257,21 +257,12 @@ SubstitutingProtocolHandler::NewChannel2(nsIURI* uri, rv = NS_NewChannelInternal(result, newURI, aLoadInfo); NS_ENSURE_SUCCESS(rv, rv); + nsLoadFlags loadFlags = 0; + (*result)->GetLoadFlags(&loadFlags); + (*result)->SetLoadFlags(loadFlags & ~nsIChannel::LOAD_REPLACE); rv = (*result)->SetOriginalURI(uri); NS_ENSURE_SUCCESS(rv, rv); - // We must set result principal URL prior to calling SubstituteChannel - // because it may call NS_GetFinalChannelURI and the correct result - // (in this case |uri|) is already expected. - // - // We don't want to reset the result principal URL to |uri| after calling - // SubstituteChannel since whatever substituting protocol handler(s) set - // has to override anything we set here. - if (aLoadInfo) { - rv = aLoadInfo->SetResultPrincipalURI(uri); - NS_ENSURE_SUCCESS(rv, rv); - } - return SubstituteChannel(uri, aLoadInfo, result); } diff --git a/netwerk/protocol/viewsource/nsViewSourceHandler.cpp b/netwerk/protocol/viewsource/nsViewSourceHandler.cpp index 87260bca1952..e8d4711d8c88 100644 --- a/netwerk/protocol/viewsource/nsViewSourceHandler.cpp +++ b/netwerk/protocol/viewsource/nsViewSourceHandler.cpp @@ -116,12 +116,6 @@ nsViewSourceHandler::NewChannel2(nsIURI* uri, return rv; } - if (aLoadInfo) { - // The underlying channel is created for a different URI. - // Original URI on the resulting channel has been set to |uri|. - aLoadInfo->SetResultPrincipalURI(uri); - } - *result = static_cast(channel); return NS_OK; } @@ -147,12 +141,6 @@ nsViewSourceHandler::NewSrcdocChannel(nsIURI *aURI, return rv; } - if (aLoadInfo) { - // The underlying channel is created for a different URI. - // Original URI on the resulting channel has been set to |aURI|. - aLoadInfo->SetResultPrincipalURI(aURI); - } - *outChannel = static_cast(channel.forget().take()); return NS_OK; } diff --git a/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp b/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp index 88cc42e985a3..2d6b3084b344 100644 --- a/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp +++ b/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp @@ -217,11 +217,6 @@ WyciwygChannelParent::RecvAsyncOpen(const URIParams& aOriginal, return IPC_OK(); } - nsCOMPtr loadInfo = mChannel->GetLoadInfo(); - if (loadInfo) { - loadInfo->SetResultPrincipalURI(original); - } - rv = mChannel->SetLoadFlags(aLoadFlags); if (NS_FAILED(rv)) { if (!SendCancelEarly(rv)) { @@ -242,6 +237,7 @@ WyciwygChannelParent::RecvAsyncOpen(const URIParams& aOriginal, return IPC_OK(); } + nsCOMPtr loadInfo = mChannel->GetLoadInfo(); if (loadInfo && loadInfo->GetEnforceSecurity()) { rv = mChannel->AsyncOpen2(this); } diff --git a/netwerk/streamconv/converters/nsMultiMixedConv.cpp b/netwerk/streamconv/converters/nsMultiMixedConv.cpp index 58326bcd8876..d0f62d919e26 100644 --- a/netwerk/streamconv/converters/nsMultiMixedConv.cpp +++ b/netwerk/streamconv/converters/nsMultiMixedConv.cpp @@ -877,10 +877,6 @@ nsMultiMixedConv::SendStart() mPartChannel->SetContentDisposition(mContentDisposition); - // Each part of a multipart/replace response can be used - // for the top level document. We must inform upper layers - // about this by setting the LOAD_REPLACE flag so that certain - // state assertions are evaluated as positive. nsLoadFlags loadFlags = 0; mPartChannel->GetLoadFlags(&loadFlags); loadFlags |= nsIChannel::LOAD_REPLACE; diff --git a/netwerk/test/unit/test_file_protocol.js b/netwerk/test/unit/test_file_protocol.js index baeac2f8c84c..2f1c5eb7f179 100644 --- a/netwerk/test/unit/test_file_protocol.js +++ b/netwerk/test/unit/test_file_protocol.js @@ -232,6 +232,9 @@ function test_load_replace() { file = do_get_file("data/system_root.lnk", false); var chan = new_file_channel(file); + // The LOAD_REPLACE flag should be set + do_check_eq(chan.loadFlags & chan.LOAD_REPLACE, chan.LOAD_REPLACE); + // The original URI path should differ from the URI path do_check_neq(chan.URI.path, chan.originalURI.path); diff --git a/services/sync/Weave.js b/services/sync/Weave.js index 1a1207dd8b18..2375ccc587a9 100644 --- a/services/sync/Weave.js +++ b/services/sync/Weave.js @@ -161,7 +161,6 @@ AboutWeaveLog.prototype = { let channel = Services.io.newChannelFromURIWithLoadInfo(uri, aLoadInfo); channel.originalURI = aURI; - aLoadInfo.resultPrincipalURI = aURI; // Ensure that the about page has the same privileges as a regular directory // view. That way links to files can be opened. make sure we use the correct diff --git a/testing/mochitest/BrowserTestUtils/content/content-about-page-utils.js b/testing/mochitest/BrowserTestUtils/content/content-about-page-utils.js index 17a106d957e4..bae1a653191d 100644 --- a/testing/mochitest/BrowserTestUtils/content/content-about-page-utils.js +++ b/testing/mochitest/BrowserTestUtils/content/content-about-page-utils.js @@ -26,7 +26,6 @@ AboutPage.prototype = { let channel = Services.io.newChannelFromURIWithLoadInfo(newURI, aLoadInfo); channel.originalURI = aURI; - aLoadInfo.resultPrincipalURI = aURI; if (this.uriFlags & Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT) { channel.owner = null; diff --git a/testing/talos/talos/tests/tabswitch/content/tabswitch-content-process.js b/testing/talos/talos/tests/tabswitch/content/tabswitch-content-process.js index 26a6d9b3a6bc..8f4e8b950897 100644 --- a/testing/talos/talos/tests/tabswitch/content/tabswitch-content-process.js +++ b/testing/talos/talos/tests/tabswitch/content/tabswitch-content-process.js @@ -14,7 +14,6 @@ class TabSwitchAboutModule { let uri = Services.io.newURI(CHROME_URI); let chan = Services.io.newChannelFromURIWithLoadInfo(uri, aLoadInfo); chan.originalURI = aURI; - aLoadInfo.resultPrincipalURI = aURI; return chan; } diff --git a/testing/talos/talos/tests/tabswitch/install.rdf b/testing/talos/talos/tests/tabswitch/install.rdf index 9883c5eeee0a..05a8f1655526 100644 --- a/testing/talos/talos/tests/tabswitch/install.rdf +++ b/testing/talos/talos/tests/tabswitch/install.rdf @@ -4,7 +4,7 @@ tab-switch-test@lassey.us 2 Tab Switch Test - 1.0.4 + 1.0.3 2 chrome://tabswitch/content/options.xul true diff --git a/testing/talos/talos/tests/tabswitch/tabswitch-signed.xpi b/testing/talos/talos/tests/tabswitch/tabswitch-signed.xpi index 34a4647725b662083560fdb0cdaf31e6d6755d74..cea60112ff1009c1613a4da1f7da59e810294349 100644 GIT binary patch delta 7906 zcma)h1yq#X_Wn@PohmIILx_Mhh;)MtDcub-G`uv5ggAf-(h>?tcZYNe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pfj$ChrFB2ZhMt?VE2= zh==b|eUH)p+VH>M?e|*+=S)3rcmoowoc$RzIdKS5$^{Jnbx-({!aIVCNo*{P{!>yUn8YhJWU-$bc!1Q3{&Hjdek{MkTk_uY?$TM z*F57RdeRco+X!Y9DZzXj*-c5wOsvfEE*#46k1(gVZ!AoR-XaWC{%B5o`a1P}JH2iIA= zrg1>WXjr<_*Lf~@WnO5?3U`g4EgYUh%~!m1VJq#1u1N!t3xd6H8V{@#Eq_X5bnY)?wjz6z{-Kv5mz&h%aeWtiYt%S;Y=m_gP#MjZh1sG^296Fyrqd`#YIAfdKbFbgC6BT}+lrkFEn~h96#iB+^vQr;o z4ySUNhiuoKq8}OdTMVU6Trf8AW;!--v}!MYUH!j0_4l6h`A7@eKK{AAAMJPc_%qLe z4Ri8p=M1k>Q+ddx|C95f_J1P$@1*}b0s!zh#sgTe{E6^~LI?b>BJi8}Yipt( zsehD&|A2qCnnLbRHu-B(_?!HF1t55_!K&GbV52WEpZ^{y{`(02<@Vdrp99vxNeIK` TMaRZ?EJ2Nr{S+zZ@1Or4yi+3W diff --git a/toolkit/components/mozprotocol/mozProtocolHandler.js b/toolkit/components/mozprotocol/mozProtocolHandler.js index 89935fcfc538..78e3e38a30a9 100644 --- a/toolkit/components/mozprotocol/mozProtocolHandler.js +++ b/toolkit/components/mozprotocol/mozProtocolHandler.js @@ -32,6 +32,7 @@ mozProtocolHandler.prototype = { newChannel2(uri, loadInfo) { let realURL = NetUtil.newURI(this.urlToLoad); let channel = Services.io.newChannelFromURIWithLoadInfo(realURL, loadInfo) + channel.loadFlags |= Ci.nsIChannel.LOAD_REPLACE; return channel; }, diff --git a/toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms_streamConverter.js b/toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms_streamConverter.js index c6939e497bdf..5d5e4854a98b 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms_streamConverter.js +++ b/toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms_streamConverter.js @@ -38,7 +38,6 @@ function registerConverter() { loadUsingSystemPrincipal: true, }); channel.originalURI = aRequest.QueryInterface(Ci.nsIChannel).URI; - channel.loadInfo.resultPrincipalURI = channel.originalURI; channel.loadGroup = aRequest.loadGroup; channel.owner = Services.scriptSecurityManager .createCodebasePrincipal(channel.URI, {}); diff --git a/toolkit/components/places/PageIconProtocolHandler.js b/toolkit/components/places/PageIconProtocolHandler.js index 7a8ea2d30cb2..fd70e75196b5 100644 --- a/toolkit/components/places/PageIconProtocolHandler.js +++ b/toolkit/components/places/PageIconProtocolHandler.js @@ -17,7 +17,6 @@ function makeDefaultFaviconChannel(uri, loadInfo) { let channel = Services.io.newChannelFromURIWithLoadInfo( PlacesUtils.favicons.defaultFavicon, loadInfo); channel.originalURI = uri; - loadInfo.resultPrincipalURI = uri; return channel; } diff --git a/toolkit/components/thumbnails/PageThumbsProtocol.js b/toolkit/components/thumbnails/PageThumbsProtocol.js index 5071e50eb2ba..f7fa015ea88a 100644 --- a/toolkit/components/thumbnails/PageThumbsProtocol.js +++ b/toolkit/components/thumbnails/PageThumbsProtocol.js @@ -88,7 +88,6 @@ Protocol.prototype = { let fileuri = Services.io.newFileURI(file); let channel = Services.io.newChannelFromURIWithLoadInfo(fileuri, aLoadInfo); channel.originalURI = aURI; - aLoadInfo.resultPrincipalURI = aURI; return channel; }, diff --git a/toolkit/mozapps/extensions/test/browser/browser_openDialog.js b/toolkit/mozapps/extensions/test/browser/browser_openDialog.js index 219e915ed681..60900e807526 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_openDialog.js +++ b/toolkit/mozapps/extensions/test/browser/browser_openDialog.js @@ -24,7 +24,6 @@ var CustomChromeProtocol = { let url = Services.io.newURI("chrome:" + aURI.path); let ch = Services.io.newChannelFromURIWithLoadInfo(url, aLoadInfo); ch.originalURI = aURI; - aLoadInfo.resultPrincipalURI = aURI; return ch; },