mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 05:37:11 +00:00
import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1153314 - Assign load group to IdP load channel, r=jib (2c78dcc17) - Bug 1048048 - add preload content policy types for scripts (r=baku) (8dc3c1db1) - Bug 1210941 P1 Create the LOAD_BYPASS_SERVICE_WORKER flag. r=jduell (59fcdd603) - Bug 1173378 - crash in mozilla::net::HttpBaseChannel::OverrideSecurityInfo(nsISupports*), r=ehsan (de9772c35) - Bug 1179399 - Add a flag to HttpBaseChannel indicating whether interception is occurring. r=mayhemer (58a874dc5) - Bug 1168084 - Persist view source tab options. r=mconley (c48d492b2) - Bug 1187399 - Add a js::DefaultHasher specialization for mozilla::UniquePtr<T> that proxies the UniquePtr's raw pointer to PointerHasher. r=terrence (bfeed9936) - Bug 1193459: Fix JS_DEPENDENT_TEMPLATE_HINT for clang-cl. r=jimb (9565eceaf) - pointer style (329deb0ec) - space and pointer style (844d8998a) - Bug 1172503 - Delete unwarranted optimization to fix "Assertion failure: !!desc.object() == objHasOwn, at js/src/vm/NativeObject.cpp:1990". r=evilpie. (a97fe0bd4) - pointer style (4c5f6eb6d)
This commit is contained in:
@@ -223,10 +223,15 @@ nsresult
|
||||
nsScriptLoader::CheckContentPolicy(nsIDocument* aDocument,
|
||||
nsISupports *aContext,
|
||||
nsIURI *aURI,
|
||||
const nsAString &aType)
|
||||
const nsAString &aType,
|
||||
bool aIsPreLoad)
|
||||
{
|
||||
nsContentPolicyType contentPolicyType = aIsPreLoad
|
||||
? nsIContentPolicy::TYPE_INTERNAL_SCRIPT_PRELOAD
|
||||
: nsIContentPolicy::TYPE_INTERNAL_SCRIPT;
|
||||
|
||||
int16_t shouldLoad = nsIContentPolicy::ACCEPT;
|
||||
nsresult rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_INTERNAL_SCRIPT,
|
||||
nsresult rv = NS_CheckContentLoadPolicy(contentPolicyType,
|
||||
aURI,
|
||||
aDocument->NodePrincipal(),
|
||||
aContext,
|
||||
@@ -249,7 +254,8 @@ nsresult
|
||||
nsScriptLoader::ShouldLoadScript(nsIDocument* aDocument,
|
||||
nsISupports* aContext,
|
||||
nsIURI* aURI,
|
||||
const nsAString &aType)
|
||||
const nsAString &aType,
|
||||
bool aIsPreLoad)
|
||||
{
|
||||
// Check that the containing page is allowed to load this URI.
|
||||
nsresult rv = nsContentUtils::GetSecurityManager()->
|
||||
@@ -259,7 +265,7 @@ nsScriptLoader::ShouldLoadScript(nsIDocument* aDocument,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// After the security manager, the content-policy stuff gets a veto
|
||||
rv = CheckContentPolicy(aDocument, aContext, aURI, aType);
|
||||
rv = CheckContentPolicy(aDocument, aContext, aURI, aType, aIsPreLoad);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
@@ -274,7 +280,7 @@ nsScriptLoader::StartLoad(nsScriptLoadRequest *aRequest, const nsAString &aType,
|
||||
nsISupports *context = aRequest->mElement.get()
|
||||
? static_cast<nsISupports *>(aRequest->mElement.get())
|
||||
: static_cast<nsISupports *>(mDocument);
|
||||
nsresult rv = ShouldLoadScript(mDocument, context, aRequest->mURI, aType);
|
||||
nsresult rv = ShouldLoadScript(mDocument, context, aRequest->mURI, aType, aRequest->IsPreload());
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
@@ -296,12 +302,16 @@ nsScriptLoader::StartLoad(nsScriptLoadRequest *aRequest, const nsAString &aType,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsContentPolicyType contentPolicyType = aRequest->IsPreload()
|
||||
? nsIContentPolicy::TYPE_INTERNAL_SCRIPT_PRELOAD
|
||||
: nsIContentPolicy::TYPE_INTERNAL_SCRIPT;
|
||||
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
rv = NS_NewChannel(getter_AddRefs(channel),
|
||||
aRequest->mURI,
|
||||
mDocument,
|
||||
nsILoadInfo::SEC_NORMAL,
|
||||
nsIContentPolicy::TYPE_INTERNAL_SCRIPT,
|
||||
contentPolicyType,
|
||||
loadGroup,
|
||||
prompter,
|
||||
nsIRequest::LOAD_NORMAL |
|
||||
@@ -628,7 +638,7 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
||||
if (elementCharset.Equals(preloadCharset) &&
|
||||
ourCORSMode == request->mCORSMode &&
|
||||
ourRefPolicy == request->mReferrerPolicy) {
|
||||
rv = CheckContentPolicy(mDocument, aElement, request->mURI, type);
|
||||
rv = CheckContentPolicy(mDocument, aElement, request->mURI, type, false);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
} else {
|
||||
// Drop the preload
|
||||
|
||||
Reference in New Issue
Block a user