Issue #1587 Part 12 (followup 2): Allow clearing of signal by setting to null.

This commit is contained in:
Moonchild 2020-07-25 17:31:58 +00:00 committed by Roy Tam
commit 70bf74e9d3
3 changed files with 7 additions and 2 deletions

View file

@ -499,6 +499,11 @@ FetchDriver::OnStartRequest(nsIRequest* aRequest,
return rv;
}
if (!mChannel) {
MOZ_ASSERT(!mObserver);
return NS_BINDING_ABORTED;
}
// We should only get to the following code once.
MOZ_ASSERT(!mPipeOutputStream);
MOZ_ASSERT(mObserver);

View file

@ -425,7 +425,7 @@ Request::Constructor(const GlobalObject& aGlobal,
}
if (aInit.mSignal.WasPassed()) {
signal = &aInit.mSignal.Value();
signal = aInit.mSignal.Value();
}
if (NS_IsMainThread()) {

View file

@ -53,7 +53,7 @@ dictionary RequestInit {
DOMString integrity;
[Func="AbortController::IsEnabled"]
AbortSignal signal;
AbortSignal? signal;
[Func="FetchObserver::IsEnabled"]
ObserverCallback observe;