Backed out changeset 5efbaa9e5c01 (bug 1935088) for causing conflicts

This commit is contained in:
Alexandru Marc
2024-12-30 12:57:53 +02:00
parent 60a6ae234f
commit c814f3818a
6 changed files with 13 additions and 36 deletions

View File

@@ -24,7 +24,6 @@
#include "nsStreamUtils.h"
#include "nsStringStream.h"
#include "nsProxyRelease.h"
#include "ThirdPartyUtil.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
@@ -668,18 +667,7 @@ already_AddRefed<Promise> FetchRequest(nsIGlobalObject* aGlobal,
}
principal = doc->NodePrincipal();
cookieJarSettings = doc->CookieJarSettings();
// fetch the thirdparty context from the document
ThirdPartyUtil* thirdPartyUtil = ThirdPartyUtil::GetInstance();
if (!thirdPartyUtil) {
return nullptr;
}
if (thirdPartyUtil) {
bool thirdParty = false;
Unused << thirdPartyUtil->IsThirdPartyWindow(window->GetOuterWindow(),
nullptr, &thirdParty);
ipcArgs.isThirdPartyContext() = thirdParty;
}
} else {
principal = aGlobal->PrincipalOrNull();
if (NS_WARN_IF(!principal)) {

View File

@@ -678,9 +678,9 @@ nsresult FetchDriver::HttpFetch(
NS_ENSURE_SUCCESS(rv, rv);
}
if (mIsThirdPartyContext.isSome()) {
if (mIsThirdPartyWorker.isSome()) {
nsCOMPtr<nsILoadInfo> loadInfo = chan->LoadInfo();
rv = loadInfo->SetIsInThirdPartyContext(mIsThirdPartyContext.ref());
rv = loadInfo->SetIsInThirdPartyContext(mIsThirdPartyWorker.ref());
NS_ENSURE_SUCCESS(rv, rv);
}

View File

@@ -145,8 +145,8 @@ class FetchDriver final : public nsIChannelEventSink,
mAssociatedBrowsingContextID = aID;
}
void SetIsThirdPartyContext(const Maybe<bool> aIsThirdPartyWorker) {
mIsThirdPartyContext = aIsThirdPartyWorker;
void SetIsThirdPartyWorker(const Maybe<bool> aIsThirdPartyWorker) {
mIsThirdPartyWorker = aIsThirdPartyWorker;
}
void SetIsOn3PCBExceptionList(bool aIsOn3PCBExceptionList) {
@@ -187,8 +187,9 @@ class FetchDriver final : public nsIChannelEventSink,
bool mIsTrackingFetch;
// Indicates whether the fetch request is from a third-party context.
Maybe<bool> mIsThirdPartyContext;
// Indicates whether the fetch request is from a third-party worker. Nothing
// if the fetch request is not from a worker.
Maybe<bool> mIsThirdPartyWorker;
// Indicates whether the fetch request is on the 3PCB exception list.
bool mIsOn3PCBExceptionList;

View File

@@ -186,17 +186,11 @@ IPCResult FetchParent::RecvFetchOp(FetchOpArgs&& aArgs) {
} else {
MOZ_ASSERT(self->mRequest->GetKeepalive());
self->mResponsePromises =
fetchService->Fetch(AsVariant(FetchService::MainThreadFetchArgs({
self->mRequest.clonePtr(),
self->mPrincipalInfo,
self->mCookieJarSettings,
self->mNeedOnDataAvailable,
self->mCSPEventListener,
self->mAssociatedBrowsingContextID,
self->mBackgroundEventTarget,
self->mID,
self->mIsThirdPartyContext,
})));
fetchService->Fetch(AsVariant(FetchService::MainThreadFetchArgs(
{self->mRequest.clonePtr(), self->mPrincipalInfo,
self->mCookieJarSettings, self->mNeedOnDataAvailable,
self->mCSPEventListener, self->mAssociatedBrowsingContextID,
self->mBackgroundEventTarget, self->mID})));
}
bool isResolved =

View File

@@ -276,15 +276,10 @@ RefPtr<FetchServicePromises> FetchService::FetchInstance::Fetch() {
}
mFetchDriver->SetAssociatedBrowsingContextID(
args.mAssociatedBrowsingContextID);
mFetchDriver->SetIsThirdPartyContext(Some(args.mIsThirdPartyContext));
mFetchDriver->SetIsThirdPartyWorker(Some(args.mIsThirdPartyContext));
mFetchDriver->SetIsOn3PCBExceptionList(args.mIsOn3PCBExceptionList);
}
if (mArgsType == FetchArgsType::MainThreadFetch) {
auto& args = mArgs.as<MainThreadFetchArgs>();
mFetchDriver->SetIsThirdPartyContext(Some(args.mIsThirdPartyContext));
}
mFetchDriver->EnableNetworkInterceptControl();
mPromises = MakeRefPtr<FetchServicePromises>();

View File

@@ -124,7 +124,6 @@ class FetchService final : public nsIObserver {
uint64_t mAssociatedBrowsingContextID;
nsCOMPtr<nsISerialEventTarget> mEventTarget;
nsID mActorID;
bool mIsThirdPartyContext{false};
};
struct UnknownArgs {};