Bug 1871374 - add keepalive setters and getters in InternalRequest. r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D204896
This commit is contained in:
sunil mayya 2024-03-20 13:14:52 +00:00
Родитель 85b00417e6
Коммит af4b1f34a6
4 изменённых файлов: 8 добавлений и 14 удалений

Просмотреть файл

@ -263,6 +263,10 @@ class InternalRequest final : public AtomicSafeRefCounted<InternalRequest> {
mIntegrity.Assign(aIntegrity);
}
bool GetKeepalive() const { return mKeepalive; }
void SetKeepalive(const bool aKeepalive) { mKeepalive = aKeepalive; }
bool MozErrors() const { return mMozErrors; }
void SetMozErrors() { mMozErrors = true; }
@ -454,6 +458,7 @@ class InternalRequest final : public AtomicSafeRefCounted<InternalRequest> {
RequestRedirect mRedirectMode;
RequestPriority mPriorityMode = RequestPriority::Auto;
nsString mIntegrity;
bool mKeepalive = false;
bool mMozErrors = false;
nsCString mFragment;
bool mSkipServiceWorker = false;

Просмотреть файл

@ -517,7 +517,7 @@ SafeRefPtr<Request> Request::Constructor(nsIGlobalObject* aGlobal,
}
if (aInit.mKeepalive.WasPassed()) {
// place holder to set keepalive
request->SetKeepalive(aInit.mKeepalive.Value());
}
if (aInit.mMozErrors.WasPassed() && aInit.mMozErrors.Value()) {

Просмотреть файл

@ -59,7 +59,7 @@ class Request final : public FetchBody<Request>, public nsWrapperCache {
aIntegrity = mRequest->GetIntegrity();
}
bool Keepalive() const { return false; }
bool Keepalive() const { return mRequest->GetKeepalive(); }
bool MozErrors() const { return mRequest->MozErrors(); }

Просмотреть файл

@ -1,12 +1,10 @@
prefs: [dom.fetchKeepalive.enabled:true]
[request-keepalive.any.sharedworker.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[keepalive flag with stream body]
expected: FAIL
[keepalive flag]
expected: FAIL
[request-keepalive.any.worker.html]
expected:
@ -14,21 +12,12 @@
[keepalive flag with stream body]
expected: FAIL
[keepalive flag]
expected: FAIL
[request-keepalive.any.serviceworker.html]
[keepalive flag with stream body]
expected: FAIL
[keepalive flag]
expected: FAIL
[request-keepalive.any.html]
[keepalive flag with stream body]
expected: FAIL
[keepalive flag]
expected: FAIL