зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1304623 - Create a pref to control the default referrer policy - part 3. r=bkelly
MozReview-Commit-ID: 1A6IHPeNYBQ
This commit is contained in:
Родитель
8cd72c67ca
Коммит
0aaea58b69
|
@ -855,7 +855,7 @@ function _loadURIWithFlags(browser, uri, params) {
|
|||
let flags = params.flags || 0;
|
||||
let referrer = params.referrerURI;
|
||||
let referrerPolicy = ('referrerPolicy' in params ? params.referrerPolicy :
|
||||
Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT);
|
||||
Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
|
||||
let postData = params.postData;
|
||||
|
||||
let currentRemoteType = browser.remoteType;
|
||||
|
@ -1196,7 +1196,7 @@ var gBrowserInit = {
|
|||
}
|
||||
}
|
||||
let referrerPolicy = (window.arguments[5] != undefined ?
|
||||
window.arguments[5] : Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT);
|
||||
window.arguments[5] : Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
|
||||
let userContextId = (window.arguments[6] != undefined ?
|
||||
window.arguments[6] : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID);
|
||||
loadURI(uriToLoad, referrerURI, window.arguments[3] || null,
|
||||
|
@ -5014,7 +5014,7 @@ nsBrowserAccess.prototype = {
|
|||
}
|
||||
|
||||
let referrer = aOpener ? makeURI(aOpener.location.href) : null;
|
||||
let referrerPolicy = Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT;
|
||||
let referrerPolicy = Ci.nsIHttpChannel.REFERRER_POLICY_UNSET;
|
||||
if (aOpener && aOpener.document) {
|
||||
referrerPolicy = aOpener.document.referrerPolicy;
|
||||
}
|
||||
|
|
|
@ -4846,7 +4846,7 @@
|
|||
|
||||
let newTab = this.loadOneTab(data.href, {
|
||||
referrerURI: (data.referrer ? makeURI(data.referrer) : null),
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
postData: null,
|
||||
allowThirdPartyFixup: true,
|
||||
relatedToCurrent: true,
|
||||
|
|
|
@ -62,7 +62,7 @@ add_task(function* () {
|
|||
yield BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, function* (browser1) {
|
||||
// Set up the grouped SHEntry setup
|
||||
let tab2 = gBrowser.loadOneTab("data:text/html,b", {
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
allowThirdPartyFixup: true,
|
||||
relatedToCurrent: true,
|
||||
isPrerendered: true,
|
||||
|
|
|
@ -90,7 +90,7 @@ function openUILink(url, event, aIgnoreButton, aIgnoreAlt, aAllowThirdPartyFixup
|
|||
allowThirdPartyFixup: aAllowThirdPartyFixup,
|
||||
postData: aPostData,
|
||||
referrerURI: aReferrerURI,
|
||||
referrerPolicy: Components.interfaces.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Components.interfaces.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
initiatingDoc: event ? event.target.ownerDocument : null,
|
||||
};
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI
|
|||
allowThirdPartyFixup: aAllowThirdPartyFixup,
|
||||
postData: aPostData,
|
||||
referrerURI: aReferrerURI,
|
||||
referrerPolicy: Components.interfaces.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Components.interfaces.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ function openLinkIn(url, where, params) {
|
|||
var aCharset = params.charset;
|
||||
var aReferrerURI = params.referrerURI;
|
||||
var aReferrerPolicy = ('referrerPolicy' in params ?
|
||||
params.referrerPolicy : Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT);
|
||||
params.referrerPolicy : Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
|
||||
var aRelatedToCurrent = params.relatedToCurrent;
|
||||
var aAllowMixedContent = params.allowMixedContent;
|
||||
var aInBackground = params.inBackground;
|
||||
|
|
|
@ -201,7 +201,7 @@ ContentRestoreInternal.prototype = {
|
|||
Utils.makeURI(loadArguments.referrer) : null;
|
||||
let referrerPolicy = ('referrerPolicy' in loadArguments
|
||||
? loadArguments.referrerPolicy
|
||||
: Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT);
|
||||
: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
|
||||
let postData = loadArguments.postData ?
|
||||
Utils.makeInputStream(loadArguments.postData) : null;
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ add_task(function* () {
|
|||
|
||||
// Create a new hidden prerendered tab to swap to.
|
||||
let tab2 = gBrowser.loadOneTab(URIs[2], {
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
allowThirdPartyFixup: true,
|
||||
relatedToCurrent: true,
|
||||
isPrerendered: true,
|
||||
|
@ -106,7 +106,7 @@ add_task(function* () {
|
|||
|
||||
// Create a new hidden prerendered tab to swap to
|
||||
let tab3 = gBrowser.loadOneTab(URIs[4], {
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
allowThirdPartyFixup: true,
|
||||
relatedToCurrent: true,
|
||||
isPrerendered: true,
|
||||
|
|
|
@ -60,7 +60,7 @@ BrowserElementWebNavigation.prototype = {
|
|||
loadURI(uri, flags, referrer, postData, headers) {
|
||||
// No equivalent in the current BrowserElement API
|
||||
this.loadURIWithOptions(uri, flags, referrer,
|
||||
Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
postData, headers, null);
|
||||
},
|
||||
|
||||
|
|
|
@ -559,8 +559,7 @@ var saveToFile = Task.async(function* (context, reply) {
|
|||
persist.savePrivacyAwareURI(sourceURI,
|
||||
null,
|
||||
document.documentURIObject,
|
||||
Ci.nsIHttpChannel
|
||||
.REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE,
|
||||
Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
null,
|
||||
null,
|
||||
targetFileURI,
|
||||
|
|
|
@ -1262,7 +1262,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
|
|||
bool inheritPrincipal = false;
|
||||
bool principalIsExplicit = false;
|
||||
bool sendReferrer = true;
|
||||
uint32_t referrerPolicy = mozilla::net::RP_Default;
|
||||
uint32_t referrerPolicy = mozilla::net::RP_Unset;
|
||||
bool isSrcdoc = false;
|
||||
nsCOMPtr<nsISHEntry> shEntry;
|
||||
nsXPIDLString target;
|
||||
|
@ -4697,7 +4697,7 @@ nsDocShell::LoadURI(const char16_t* aURI,
|
|||
nsIInputStream* aHeaderStream)
|
||||
{
|
||||
return LoadURIWithOptions(aURI, aLoadFlags, aReferringURI,
|
||||
mozilla::net::RP_Default, aPostStream,
|
||||
mozilla::net::RP_Unset, aPostStream,
|
||||
aHeaderStream, nullptr);
|
||||
}
|
||||
|
||||
|
@ -5363,7 +5363,7 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return InternalLoad(errorPageURI, nullptr, false, nullptr,
|
||||
mozilla::net::RP_Default,
|
||||
mozilla::net::RP_Unset,
|
||||
nsContentUtils::GetSystemPrincipal(), nullptr,
|
||||
INTERNAL_LOAD_FLAGS_NONE, EmptyString(),
|
||||
nullptr, NullString(), nullptr, nullptr, LOAD_ERROR_PAGE,
|
||||
|
@ -12230,7 +12230,7 @@ nsDocShell::AddToSessionHistory(nsIURI* aURI, nsIChannel* aChannel,
|
|||
nsCOMPtr<nsIURI> originalURI;
|
||||
bool loadReplace = false;
|
||||
nsCOMPtr<nsIURI> referrerURI;
|
||||
uint32_t referrerPolicy = mozilla::net::RP_Default;
|
||||
uint32_t referrerPolicy = mozilla::net::RP_Unset;
|
||||
nsCOMPtr<nsISupports> cacheKey;
|
||||
nsCOMPtr<nsIPrincipal> triggeringPrincipal = aTriggeringPrincipal;
|
||||
nsCOMPtr<nsIPrincipal> principalToInherit = aPrincipalToInherit;
|
||||
|
|
|
@ -16,7 +16,7 @@ nsDocShellLoadInfo::nsDocShellLoadInfo()
|
|||
, mInheritPrincipal(false)
|
||||
, mPrincipalIsExplicit(false)
|
||||
, mSendReferrer(true)
|
||||
, mReferrerPolicy(mozilla::net::RP_Default)
|
||||
, mReferrerPolicy(mozilla::net::RP_Unset)
|
||||
, mLoadType(nsIDocShellLoadInfo::loadNormal)
|
||||
, mIsSrcdocLoad(false)
|
||||
{
|
||||
|
|
|
@ -264,7 +264,7 @@ interface nsIWebNavigation : nsISupports
|
|||
* URI will be inferred internally.
|
||||
* @param aReferrerPolicy
|
||||
* One of the REFERRER_POLICY_* constants from nsIHttpChannel.
|
||||
* Normal case is REFERRER_POLICY_DEFAULT.
|
||||
* Normal case is REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE.
|
||||
* @param aPostData
|
||||
* If the URI corresponds to a HTTP request, then this stream is
|
||||
* appended directly to the HTTP request headers. It may be prefixed
|
||||
|
|
|
@ -24,7 +24,7 @@ static uint32_t gEntryID = 0;
|
|||
nsSHEntry::nsSHEntry()
|
||||
: mShared(new nsSHEntryShared())
|
||||
, mLoadReplace(false)
|
||||
, mReferrerPolicy(mozilla::net::RP_Default)
|
||||
, mReferrerPolicy(mozilla::net::RP_Unset)
|
||||
, mLoadType(0)
|
||||
, mID(gEntryID++)
|
||||
, mScrollPositionX(0)
|
||||
|
|
|
@ -23,7 +23,7 @@ add_task(function* () {
|
|||
yield BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, function* (browser1) {
|
||||
// Set up the grouped SHEntry setup
|
||||
let tab2 = gBrowser.loadOneTab("data:text/html,b", {
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
allowThirdPartyFixup: true,
|
||||
relatedToCurrent: true,
|
||||
isPrerendered: true,
|
||||
|
|
|
@ -28,7 +28,7 @@ add_task(function* () {
|
|||
yield BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, function* (browser1) {
|
||||
// Set up the grouped SHEntry setup
|
||||
let tab2 = gBrowser.loadOneTab("data:text/html,b", {
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
allowThirdPartyFixup: true,
|
||||
relatedToCurrent: true,
|
||||
isPrerendered: true,
|
||||
|
|
|
@ -17,7 +17,7 @@ add_task(function* () {
|
|||
yield BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, function* (browser1) {
|
||||
// Set up the grouped SHEntry setup
|
||||
let tab2 = gBrowser.loadOneTab("data:text/html,b", {
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
allowThirdPartyFixup: true,
|
||||
relatedToCurrent: true,
|
||||
isPrerendered: true,
|
||||
|
|
|
@ -109,7 +109,7 @@ Location::CheckURL(nsIURI* aURI, nsIDocShellLoadInfo** aLoadInfo)
|
|||
|
||||
nsCOMPtr<nsIPrincipal> triggeringPrincipal;
|
||||
nsCOMPtr<nsIURI> sourceURI;
|
||||
net::ReferrerPolicy referrerPolicy = net::RP_Default;
|
||||
net::ReferrerPolicy referrerPolicy = net::RP_Unset;
|
||||
|
||||
if (JSContext *cx = nsContentUtils::GetCurrentJSContext()) {
|
||||
// No cx means that there's no JS running, or at least no JS that
|
||||
|
|
|
@ -165,7 +165,7 @@ nsContentAreaDragDropDataProvider::SaveURIToFile(nsAString& inSourceURIString,
|
|||
|
||||
// referrer policy can be anything since the referrer is nullptr
|
||||
return persist->SavePrivacyAwareURI(sourceURI, nullptr, nullptr,
|
||||
mozilla::net::RP_Default,
|
||||
mozilla::net::RP_Unset,
|
||||
nullptr, nullptr,
|
||||
inDestFile, isPrivate);
|
||||
}
|
||||
|
|
|
@ -8514,9 +8514,7 @@ nsContentUtils::SetFetchReferrerURIWithPolicy(nsIPrincipal* aPrincipal,
|
|||
referrerURI = principalURI;
|
||||
}
|
||||
|
||||
net::ReferrerPolicy referrerPolicy = (aReferrerPolicy != net::RP_Unset) ?
|
||||
aReferrerPolicy : net::RP_Default;
|
||||
return aChannel->SetReferrerWithPolicy(referrerURI, referrerPolicy);
|
||||
return aChannel->SetReferrerWithPolicy(referrerURI, aReferrerPolicy);
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -8530,6 +8528,9 @@ nsContentUtils::GetReferrerPolicyFromHeader(const nsAString& aHeader)
|
|||
net::ReferrerPolicy referrerPolicy = mozilla::net::RP_Unset;
|
||||
while (tokenizer.hasMoreTokens()) {
|
||||
token = tokenizer.nextToken();
|
||||
if (token.IsEmpty()) {
|
||||
continue;
|
||||
}
|
||||
net::ReferrerPolicy policy = net::ReferrerPolicyFromString(token);
|
||||
if (policy != net::RP_Unset) {
|
||||
referrerPolicy = policy;
|
||||
|
|
|
@ -1279,7 +1279,7 @@ static already_AddRefed<mozilla::dom::NodeInfo> nullNodeInfo;
|
|||
nsIDocument::nsIDocument()
|
||||
: nsINode(nullNodeInfo),
|
||||
mReferrerPolicySet(false),
|
||||
mReferrerPolicy(mozilla::net::RP_Default),
|
||||
mReferrerPolicy(mozilla::net::RP_Unset),
|
||||
mBlockAllMixedContent(false),
|
||||
mBlockAllMixedContentPreloads(false),
|
||||
mUpgradeInsecureRequests(false),
|
||||
|
@ -2468,7 +2468,7 @@ nsDocument::ApplySettingsFromCSP(bool aSpeculative)
|
|||
if (csp) {
|
||||
// Set up any Referrer Policy specified by CSP
|
||||
bool hasReferrerPolicy = false;
|
||||
uint32_t referrerPolicy = mozilla::net::RP_Default;
|
||||
uint32_t referrerPolicy = mozilla::net::RP_Unset;
|
||||
rv = csp->GetReferrerPolicy(&referrerPolicy, &hasReferrerPolicy);
|
||||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
if (hasReferrerPolicy) {
|
||||
|
|
|
@ -91,7 +91,7 @@ public:
|
|||
mLineNo(1),
|
||||
mCORSMode(aCORSMode),
|
||||
mIntegrity(aIntegrity),
|
||||
mReferrerPolicy(mozilla::net::RP_Default)
|
||||
mReferrerPolicy(mozilla::net::RP_Unset)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -3304,7 +3304,7 @@ nsresult nsPluginHost::NewPluginURLStream(const nsString& aURL,
|
|||
// errors about malformed requests if we include it in POSTs. See
|
||||
// bug 724465.
|
||||
nsCOMPtr<nsIURI> referer;
|
||||
net::ReferrerPolicy referrerPolicy = net::RP_Default;
|
||||
net::ReferrerPolicy referrerPolicy = net::RP_Unset;
|
||||
|
||||
nsCOMPtr<nsIObjectLoadingContent> olc = do_QueryInterface(element);
|
||||
if (olc)
|
||||
|
|
|
@ -346,9 +346,9 @@ NS_IMETHODIMP
|
|||
nsCSPContext::GetReferrerPolicy(uint32_t* outPolicy, bool* outIsSet)
|
||||
{
|
||||
*outIsSet = false;
|
||||
*outPolicy = mozilla::net::RP_Default;
|
||||
*outPolicy = mozilla::net::RP_Unset;
|
||||
nsAutoString refpol;
|
||||
mozilla::net::ReferrerPolicy previousPolicy = mozilla::net::RP_Default;
|
||||
mozilla::net::ReferrerPolicy previousPolicy = mozilla::net::RP_Unset;
|
||||
for (uint32_t i = 0; i < mPolicies.Length(); i++) {
|
||||
mPolicies[i]->getReferrerPolicy(refpol);
|
||||
// only set the referrer policy if not delievered through a CSPRO and
|
||||
|
|
|
@ -2603,7 +2603,7 @@ XMLHttpRequestMainThread::InitiateFetch(nsIInputStream* aUploadStream,
|
|||
nsCOMPtr<nsPIDOMWindowInner> owner = GetOwner();
|
||||
nsCOMPtr<nsIDocument> doc = owner ? owner->GetExtantDoc() : nullptr;
|
||||
mozilla::net::ReferrerPolicy referrerPolicy = doc ?
|
||||
doc->GetReferrerPolicy() : mozilla::net::RP_Default;
|
||||
doc->GetReferrerPolicy() : mozilla::net::RP_Unset;
|
||||
nsContentUtils::SetFetchReferrerURIWithPolicy(mPrincipal, doc,
|
||||
httpChannel, referrerPolicy);
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ nsXMLPrettyPrinter::PrettyPrint(nsIDocument* aDocument,
|
|||
rv = nsSyncLoadService::LoadDocument(xslUri, nsIContentPolicy::TYPE_XSLT,
|
||||
nsContentUtils::GetSystemPrincipal(),
|
||||
nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
|
||||
nullptr, true, mozilla::net::RP_Default,
|
||||
nullptr, true, mozilla::net::RP_Unset,
|
||||
getter_AddRefs(xslDocument));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
|
|
@ -1037,7 +1037,7 @@ NS_IMETHODIMP
|
|||
txMozillaXSLTProcessor::LoadStyleSheet(nsIURI* aUri,
|
||||
nsIDocument* aLoaderDocument)
|
||||
{
|
||||
mozilla::net::ReferrerPolicy refpol = mozilla::net::RP_Default;
|
||||
mozilla::net::ReferrerPolicy refpol = mozilla::net::RP_Unset;
|
||||
if (mStylesheetDocument) {
|
||||
refpol = mStylesheetDocument->GetReferrerPolicy();
|
||||
}
|
||||
|
|
|
@ -1069,7 +1069,7 @@ TX_XSLTFunctionAvailable(nsIAtom* aName, int32_t aNameSpaceID)
|
|||
{
|
||||
RefPtr<txStylesheetCompiler> compiler =
|
||||
new txStylesheetCompiler(EmptyString(),
|
||||
mozilla::net::RP_Default, nullptr);
|
||||
mozilla::net::RP_Unset, nullptr);
|
||||
NS_ENSURE_TRUE(compiler, false);
|
||||
|
||||
nsAutoPtr<FunctionCall> fnCall;
|
||||
|
|
|
@ -630,7 +630,7 @@ nsWebBrowserPersist::SerializeNextFile()
|
|||
// The Referrer Policy doesn't matter here since the referrer is
|
||||
// nullptr.
|
||||
rv = SaveURIInternal(uri, nullptr, nullptr,
|
||||
mozilla::net::RP_Default, nullptr, nullptr,
|
||||
mozilla::net::RP_Unset, nullptr, nullptr,
|
||||
fileAsURI, true, mIsPrivate);
|
||||
// If SaveURIInternal fails, then it will have called EndDownload,
|
||||
// which means that |data| is no longer valid memory. We MUST bail.
|
||||
|
|
|
@ -2009,8 +2009,7 @@ imgLoader::LoadImageXPCOM(nsIURI* aURI,
|
|||
nsresult rv = LoadImage(aURI,
|
||||
aInitialDocumentURI,
|
||||
aReferrerURI,
|
||||
refpol == mozilla::net::RP_Unset ?
|
||||
mozilla::net::RP_Default : refpol,
|
||||
refpol,
|
||||
aLoadingPrincipal,
|
||||
aLoadGroup,
|
||||
aObserver,
|
||||
|
@ -2365,7 +2364,7 @@ imgLoader::LoadImageWithChannel(nsIChannel* channel,
|
|||
? loadInfo->InternalContentPolicyType()
|
||||
: nsIContentPolicy::TYPE_INTERNAL_IMAGE;
|
||||
|
||||
if (ValidateEntry(entry, uri, nullptr, nullptr, RP_Default,
|
||||
if (ValidateEntry(entry, uri, nullptr, nullptr, RP_Unset,
|
||||
nullptr, aObserver, aCX, requestFlags,
|
||||
policyType, false, nullptr,
|
||||
nullptr, imgIRequest::CORS_NONE)) {
|
||||
|
@ -2454,7 +2453,7 @@ imgLoader::LoadImageWithChannel(nsIChannel* channel,
|
|||
// can set aHadInsecureRedirect to false here.
|
||||
rv = request->Init(originalURI, uri, /* aHadInsecureRedirect = */ false,
|
||||
channel, channel, entry, aCX, nullptr,
|
||||
imgIRequest::CORS_NONE, RP_Default);
|
||||
imgIRequest::CORS_NONE, RP_Unset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
RefPtr<ProxyListener> pl =
|
||||
|
|
|
@ -57,7 +57,7 @@ imgRequest::imgRequest(imgLoader* aLoader, const ImageCacheKey& aCacheKey)
|
|||
, mValidator(nullptr)
|
||||
, mInnerWindowId(0)
|
||||
, mCORSMode(imgIRequest::CORS_NONE)
|
||||
, mReferrerPolicy(mozilla::net::RP_Default)
|
||||
, mReferrerPolicy(mozilla::net::RP_Unset)
|
||||
, mImageErrorCode(NS_OK)
|
||||
, mMutex("imgRequest")
|
||||
, mProgressTracker(new ProgressTracker())
|
||||
|
|
|
@ -2210,7 +2210,7 @@ nsImageFrame::LoadIcon(const nsAString& aSpec,
|
|||
relevant for cookies, so does not
|
||||
apply to icons. */
|
||||
nullptr, /* referrer (not relevant for icons) */
|
||||
mozilla::net::RP_Default,
|
||||
mozilla::net::RP_Unset,
|
||||
nullptr, /* principal (not relevant for icons) */
|
||||
loadGroup,
|
||||
gIconLoad,
|
||||
|
|
|
@ -372,7 +372,7 @@ public:
|
|||
const nsCString& aCharset,
|
||||
nsICSSLoaderObserver* aObserver,
|
||||
CORSMode aCORSMode = CORS_NONE,
|
||||
ReferrerPolicy aReferrerPolicy = mozilla::net::RP_Default,
|
||||
ReferrerPolicy aReferrerPolicy = mozilla::net::RP_Unset,
|
||||
const nsAString& aIntegrity = EmptyString());
|
||||
|
||||
/**
|
||||
|
@ -500,7 +500,7 @@ private:
|
|||
RefPtr<StyleSheet>* aSheet,
|
||||
nsICSSLoaderObserver* aObserver,
|
||||
CORSMode aCORSMode = CORS_NONE,
|
||||
ReferrerPolicy aReferrerPolicy = mozilla::net::RP_Default,
|
||||
ReferrerPolicy aReferrerPolicy = mozilla::net::RP_Unset,
|
||||
const nsAString& aIntegrity = EmptyString());
|
||||
|
||||
// Post a load event for aObserver to be notified about aSheet. The
|
||||
|
|
|
@ -869,10 +869,10 @@ nsLayoutStylesheetCache::BuildPreferenceSheet(RefPtr<StyleSheet>* aSheet,
|
|||
{
|
||||
if (mBackendType == StyleBackendType::Gecko) {
|
||||
*aSheet = new CSSStyleSheet(eAgentSheetFeatures, CORS_NONE,
|
||||
mozilla::net::RP_Default);
|
||||
mozilla::net::RP_Unset);
|
||||
} else {
|
||||
*aSheet = new ServoStyleSheet(eAgentSheetFeatures, CORS_NONE,
|
||||
mozilla::net::RP_Default, dom::SRIMetadata());
|
||||
mozilla::net::RP_Unset, dom::SRIMetadata());
|
||||
}
|
||||
|
||||
StyleSheet* sheet = *aSheet;
|
||||
|
|
|
@ -66,7 +66,7 @@ static nsITimer* gFlushTimer = nullptr;
|
|||
nsHtml5TreeOpExecutor::nsHtml5TreeOpExecutor()
|
||||
: nsHtml5DocumentBuilder(false)
|
||||
, mPreloadedURLs(23) // Mean # of preloadable resources per page on dmoz
|
||||
, mSpeculationReferrerPolicy(mozilla::net::RP_Default)
|
||||
, mSpeculationReferrerPolicy(mozilla::net::RP_Unset)
|
||||
{
|
||||
// zeroing operator new for everything else
|
||||
}
|
||||
|
@ -1058,7 +1058,7 @@ nsHtml5TreeOpExecutor::AddSpeculationCSP(const nsAString& aCSP)
|
|||
|
||||
// Record "speculated" referrer policy for preloads
|
||||
bool hasReferrerPolicy = false;
|
||||
uint32_t referrerPolicy = mozilla::net::RP_Default;
|
||||
uint32_t referrerPolicy = mozilla::net::RP_Unset;
|
||||
rv = preloadCsp->GetReferrerPolicy(&referrerPolicy, &hasReferrerPolicy);
|
||||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
if (hasReferrerPolicy) {
|
||||
|
|
|
@ -1871,7 +1871,7 @@ nsDownloadManager::RetryDownload(nsDownload* dl)
|
|||
|
||||
// referrer policy can be anything since referrer is nullptr
|
||||
rv = wbp->SavePrivacyAwareURI(dl->mSource, nullptr,
|
||||
nullptr, mozilla::net::RP_Default,
|
||||
nullptr, mozilla::net::RP_Unset,
|
||||
nullptr, nullptr,
|
||||
dl->mTarget, dl->mPrivate);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
|
|
@ -69,7 +69,7 @@ RemoteWebNavigation.prototype = {
|
|||
},
|
||||
loadURI(aURI, aLoadFlags, aReferrer, aPostData, aHeaders) {
|
||||
this.loadURIWithOptions(aURI, aLoadFlags, aReferrer,
|
||||
Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
aPostData, aHeaders, null);
|
||||
},
|
||||
loadURIWithOptions(aURI, aLoadFlags, aReferrer, aReferrerPolicy,
|
||||
|
|
|
@ -391,7 +391,7 @@ var ViewSourceContent = {
|
|||
docShell.QueryInterface(Ci.nsIWebNavigation)
|
||||
.loadURIWithOptions(content.location.href,
|
||||
Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CLASSIFIER,
|
||||
null, Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
null, Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
null, null, null);
|
||||
}
|
||||
}
|
||||
|
@ -770,7 +770,7 @@ var ViewSourceContent = {
|
|||
|
||||
// all our content is held by the data:URI and URIs are internally stored as utf-8 (see nsIURI.idl)
|
||||
let loadFlags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
|
||||
let referrerPolicy = Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT;
|
||||
let referrerPolicy = Ci.nsIHttpChannel.REFERRER_POLICY_UNSET;
|
||||
let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
|
||||
webNav.loadURIWithOptions(uri, loadFlags,
|
||||
null, referrerPolicy, // referrer
|
||||
|
|
|
@ -559,7 +559,7 @@ function internalPersist(persistArgs) {
|
|||
persist.savePrivacyAwareURI(persistArgs.sourceURI,
|
||||
persistArgs.sourceCacheKey,
|
||||
persistArgs.sourceReferrer,
|
||||
Components.interfaces.nsIHttpChannel.REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE,
|
||||
Components.interfaces.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
persistArgs.sourcePostData,
|
||||
null,
|
||||
targetFileURL,
|
||||
|
|
|
@ -133,7 +133,7 @@
|
|||
if (!aURI)
|
||||
aURI = "about:blank";
|
||||
|
||||
var aReferrerPolicy = Components.interfaces.nsIHttpChannel.REFERRER_POLICY_DEFAULT;
|
||||
var aReferrerPolicy = Components.interfaces.nsIHttpChannel.REFERRER_POLICY_UNSET;
|
||||
|
||||
// Check for loadURIWithFlags(uri, { ... });
|
||||
var params = arguments[1];
|
||||
|
|
|
@ -868,7 +868,7 @@ function _persistImage(sourceURL, localFileName, successCallback) {
|
|||
persist.progressListener = new _persistProgressListener(successCallback);
|
||||
|
||||
persist.saveURI(sourceURI, null,
|
||||
null, Ci.nsIHttpChannel.REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE,
|
||||
null, Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
null, null, targetURI, null);
|
||||
}
|
||||
|
||||
|
|
|
@ -310,7 +310,7 @@ nsMenuItemIconX::LoadIcon(nsIURI* aIconURI)
|
|||
}
|
||||
|
||||
nsresult rv = loader->LoadImage(aIconURI, nullptr, nullptr,
|
||||
mozilla::net::RP_Default,
|
||||
mozilla::net::RP_Unset,
|
||||
nullptr, loadGroup, this,
|
||||
nullptr, nullptr, nsIRequest::LOAD_NORMAL, nullptr,
|
||||
nsIContentPolicy::TYPE_INTERNAL_IMAGE, EmptyString(),
|
||||
|
|
Загрузка…
Ссылка в новой задаче