import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 1199615 - Fixed toolkit/mozapps/update/ compilation on mingw. r=rstrong (3cc6911a9b)
- Bug 1240085 - Revert to CSS-pixel units for screenX, screenY, moveTo() APIs, and adjust the origin for secondary displays with differing resolution to avoid overlapping coordinate spaces. r=emk (be6bc0e6d9)
- Bug 1231681 - "Implement window.u2f interface". r=baku, r=dkeeler (22c54db98d)
- Bug 1234700 - Hide window.showModalDialog when e10s is enabled. r=jimm (0aaeee9d05)
- Bug 1247335 - patch 1 - Provide a desktop-pixel variant of SetPosition on nsIBaseWindow and its implementations. r=emk (90da9912ff)
- Bug 1247335 - patch 2 - Use desktop pixel coordinates when loading a nsXULWindow position. r=emk (e9343a7d58)
- Bug 1247335 - patch 3 - Check for potential DPI change after moving or resizing nsGlobalWindow. r=emk (072db418cd)
- deduplicate and reorder (e35b3edeab)
- Bug 1213514 - Don't bother checking for third party URLs at interception time unless if the user needs it; r=jdm (9effb82825)
- Bug 1206894 follow-up: Add a null check (d3cc337e32)
- Bug 1233962 P1 Call ResetInterception() if the controller is nullptr. r=jdm (34da2cb7cb)
- Bug 1233962 P2 Fix service worker xpcshell test to return a dispatcher from ChannelIntercepted(). r=jdm (d1f02f0b88)
- Bug 1236686 - Remove nsIFetchEventDispatcher; r=jdm (1b5a021186)
This commit is contained in:
2023-12-13 11:31:24 +08:00
parent 66045acec8
commit 940859860a
66 changed files with 2199 additions and 258 deletions
+15 -61
View File
@@ -5790,6 +5790,15 @@ nsDocShell::SetPosition(int32_t aX, int32_t aY)
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::SetPositionDesktopPix(int32_t aX, int32_t aY)
{
// Added to nsIBaseWindow in bug 1247335;
// implement if a use-case is found.
NS_ASSERTION(false, "implement me!");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsDocShell::GetPosition(int32_t* aX, int32_t* aY)
{
@@ -14231,7 +14240,8 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceReques
do_GetService(THIRDPARTYUTIL_CONTRACTID, &result);
NS_ENSURE_SUCCESS(result, result);
if (mCurrentURI) {
if (mCurrentURI &&
nsContentUtils::CookiesBehavior() == nsICookieService::BEHAVIOR_REJECT_FOREIGN) {
nsAutoCString uriSpec;
mCurrentURI->GetSpec(uriSpec);
if (!(uriSpec.EqualsLiteral("about:blank"))) {
@@ -14246,10 +14256,7 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceReques
return result;
}
if (isThirdPartyURI &&
(Preferences::GetInt("network.cookie.cookieBehavior",
nsICookieService::BEHAVIOR_ACCEPT) ==
nsICookieService::BEHAVIOR_REJECT_FOREIGN)) {
if (isThirdPartyURI) {
return NS_OK;
}
}
@@ -14275,55 +14282,8 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceReques
return NS_OK;
}
namespace {
class FetchEventDispatcher final : public nsIFetchEventDispatcher
{
public:
FetchEventDispatcher(nsIInterceptedChannel* aChannel,
nsIRunnable* aContinueRunnable)
: mChannel(aChannel)
, mContinueRunnable(aContinueRunnable)
{
}
NS_DECL_ISUPPORTS
NS_DECL_NSIFETCHEVENTDISPATCHER
private:
~FetchEventDispatcher()
{
}
nsCOMPtr<nsIInterceptedChannel> mChannel;
nsCOMPtr<nsIRunnable> mContinueRunnable;
};
NS_IMPL_ISUPPORTS(FetchEventDispatcher, nsIFetchEventDispatcher)
NS_IMETHODIMP
FetchEventDispatcher::Dispatch()
{
RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
if (!swm) {
mChannel->Cancel(NS_ERROR_INTERCEPTION_FAILED);
return NS_OK;
}
ErrorResult error;
swm->DispatchPreparedFetchEvent(mChannel, mContinueRunnable, error);
if (NS_WARN_IF(error.Failed())) {
return error.StealNSResult();
}
return NS_OK;
}
}
NS_IMETHODIMP
nsDocShell::ChannelIntercepted(nsIInterceptedChannel* aChannel,
nsIFetchEventDispatcher** aFetchDispatcher)
nsDocShell::ChannelIntercepted(nsIInterceptedChannel* aChannel)
{
RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
if (!swm) {
@@ -14355,18 +14315,12 @@ nsDocShell::ChannelIntercepted(nsIInterceptedChannel* aChannel,
OriginAttributes attrs(GetAppId(), GetIsInBrowserElement());
ErrorResult error;
nsCOMPtr<nsIRunnable> runnable =
swm->PrepareFetchEvent(attrs, doc, mInterceptedDocumentId, aChannel,
isReload, isSubresourceLoad, error);
swm->DispatchFetchEvent(attrs, doc, mInterceptedDocumentId, aChannel,
isReload, isSubresourceLoad, error);
if (NS_WARN_IF(error.Failed())) {
return error.StealNSResult();
}
MOZ_ASSERT(runnable);
RefPtr<FetchEventDispatcher> dispatcher =
new FetchEventDispatcher(aChannel, runnable);
dispatcher.forget(aFetchDispatcher);
return NS_OK;
}