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:
2021-12-14 09:20:33 +08:00
parent fce4bb7387
commit 968d2b4e71
28 changed files with 218 additions and 89 deletions
+34 -9
View File
@@ -76,6 +76,7 @@ HttpBaseChannel::HttpBaseChannel()
, mResponseTimeoutEnabled(true)
, mAllRedirectsSameOrigin(true)
, mAllRedirectsPassTimingAllowCheck(true)
, mResponseCouldBeSynthesized(false)
, mForceNoIntercept(false)
, mAllowStaleCacheContent(false)
, mSuspendCount(0)
@@ -1498,24 +1499,47 @@ HttpBaseChannel::SetRedirectionLimit(uint32_t value)
nsresult
HttpBaseChannel::OverrideSecurityInfo(nsISupports* aSecurityInfo)
{
MOZ_RELEASE_ASSERT(!mSecurityInfo,
"This can only be called when we don't have a security info object already");
MOZ_ASSERT(!mSecurityInfo,
"This can only be called when we don't have a security info object already");
MOZ_RELEASE_ASSERT(aSecurityInfo,
"This can only be called with a valid security info object");
MOZ_RELEASE_ASSERT(ShouldIntercept(),
"This can only be called on channels that can be intercepted");
MOZ_ASSERT(mResponseCouldBeSynthesized,
"This can only be called on channels that can be intercepted");
if (mSecurityInfo) {
LOG(("HttpBaseChannel::OverrideSecurityInfo mSecurityInfo is null! "
"[this=%p]\n", this));
return NS_ERROR_UNEXPECTED;
}
if (!mResponseCouldBeSynthesized) {
LOG(("HttpBaseChannel::OverrideSecurityInfo channel cannot be intercepted! "
"[this=%p]\n", this));
return NS_ERROR_UNEXPECTED;
}
mSecurityInfo = aSecurityInfo;
return NS_OK;
}
void
nsresult
HttpBaseChannel::OverrideURI(nsIURI* aRedirectedURI)
{
MOZ_RELEASE_ASSERT(mLoadFlags & LOAD_REPLACE,
"This can only happen if the LOAD_REPLACE flag is set");
MOZ_RELEASE_ASSERT(ShouldIntercept(),
"This can only be called on channels that can be intercepted");
MOZ_ASSERT(mLoadFlags & LOAD_REPLACE,
"This can only happen if the LOAD_REPLACE flag is set");
MOZ_ASSERT(ShouldIntercept(),
"This can only be called on channels that can be intercepted");
if (!(mLoadFlags & LOAD_REPLACE)) {
LOG(("HttpBaseChannel::OverrideURI LOAD_REPLACE flag not set! [this=%p]\n",
this));
return NS_ERROR_UNEXPECTED;
}
if (!mResponseCouldBeSynthesized) {
LOG(("HttpBaseChannel::OverrideURI channel cannot be intercepted! "
"[this=%p]\n", this));
return NS_ERROR_UNEXPECTED;
}
mURI = aRedirectedURI;
return NS_OK;
}
NS_IMETHODIMP
@@ -2013,6 +2037,7 @@ NS_IMETHODIMP
HttpBaseChannel::ForceNoIntercept()
{
mForceNoIntercept = true;
mResponseCouldBeSynthesized = false;
return NS_OK;
}