mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 986439 - Don't use nsNullPrincipalURI for referrer. r=bz
This commit is contained in:
parent
73eabdd963
commit
5dc254ead5
@ -6,5 +6,6 @@
|
||||
|
||||
EXPORTS += [
|
||||
'nsJSPrincipals.h',
|
||||
'nsNullPrincipal.h',
|
||||
]
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsJSPrincipals.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsPrincipal.h"
|
||||
#include "nsIContentSecurityPolicy.h"
|
||||
|
||||
class nsIURI;
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "nsNetCID.h"
|
||||
#include "nsError.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsPrincipal.h"
|
||||
#include "nsScriptSecurityManager.h"
|
||||
#include "pratom.h"
|
||||
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include "nsIMozBrowserFrame.h"
|
||||
#include "nsIPermissionManager.h"
|
||||
#include "nsISHistory.h"
|
||||
#include "nsNullPrincipal.h"
|
||||
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsView.h"
|
||||
@ -535,7 +536,17 @@ nsFrameLoader::ReallyStartLoadingInternal()
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
loadInfo->SetReferrer(referrer);
|
||||
// Use referrer as long as it is not an nsNullPrincipalURI.
|
||||
// We could add a method such as GetReferrerURI to principals to make this
|
||||
// cleaner, but given that we need to start using Source Browsing Context for
|
||||
// referrer (see Bug 960639) this may be wasted effort at this stage.
|
||||
if (referrer) {
|
||||
bool isNullPrincipalScheme;
|
||||
rv = referrer->SchemeIs(NS_NULLPRINCIPAL_SCHEME, &isNullPrincipalScheme);
|
||||
if (NS_SUCCEEDED(rv) && !isNullPrincipalScheme) {
|
||||
loadInfo->SetReferrer(referrer);
|
||||
}
|
||||
}
|
||||
|
||||
// Default flags:
|
||||
int32_t flags = nsIWebNavigation::LOAD_FLAGS_NONE;
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "nsContentUtils.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsNullPrincipal.h"
|
||||
#include "ScriptSettings.h"
|
||||
|
||||
static nsresult
|
||||
@ -145,7 +146,18 @@ nsLocation::CheckURL(nsIURI* aURI, nsIDocShellLoadInfo** aLoadInfo)
|
||||
sourceURI = docCurrentURI;
|
||||
}
|
||||
else {
|
||||
sourceURI = principalURI;
|
||||
// Use principalURI as long as it is not an nsNullPrincipalURI.
|
||||
// We could add a method such as GetReferrerURI to principals to make this
|
||||
// cleaner, but given that we need to start using Source Browsing Context
|
||||
// for referrer (see Bug 960639) this may be wasted effort at this stage.
|
||||
if (principalURI) {
|
||||
bool isNullPrincipalScheme;
|
||||
rv = principalURI->SchemeIs(NS_NULLPRINCIPAL_SCHEME,
|
||||
&isNullPrincipalScheme);
|
||||
if (NS_SUCCEEDED(rv) && !isNullPrincipalScheme) {
|
||||
sourceURI = principalURI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
owner = do_QueryInterface(ssm->GetCxSubjectPrincipal(cx));
|
||||
|
Loading…
Reference in New Issue
Block a user