summaryrefslogtreecommitdiffstats
path: root/dom/fetch/FetchConsumer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/fetch/FetchConsumer.cpp')
-rw-r--r--dom/fetch/FetchConsumer.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/dom/fetch/FetchConsumer.cpp b/dom/fetch/FetchConsumer.cpp
index e82e5ec51..d2d07eaa2 100644
--- a/dom/fetch/FetchConsumer.cpp
+++ b/dom/fetch/FetchConsumer.cpp
@@ -284,6 +284,7 @@ template <class Derived>
/* static */ already_AddRefed<Promise>
FetchBodyConsumer<Derived>::Create(nsIGlobalObject* aGlobal,
FetchBody<Derived>* aBody,
+ AbortSignal* aSignal,
FetchConsumeType aType,
ErrorResult& aRv)
{
@@ -345,6 +346,10 @@ FetchBodyConsumer<Derived>::Create(nsIGlobalObject* aGlobal,
return nullptr;
}
+ if (aSignal) {
+ consumer->Follow(aSignal);
+ }
+
return promise.forget();
}
@@ -368,6 +373,8 @@ FetchBodyConsumer<Derived>::ReleaseObject()
#ifdef DEBUG
mBody = nullptr;
#endif
+
+ Unfollow();
}
template <class Derived>
@@ -684,6 +691,14 @@ FetchBodyConsumer<Derived>::Observe(nsISupports* aSubject,
return NS_OK;
}
+template <class Derived>
+void
+FetchBodyConsumer<Derived>::Aborted()
+{
+ AssertIsOnTargetThread();
+ ContinueConsumeBody(NS_ERROR_DOM_ABORT_ERR, 0, nullptr);
+}
+
template <class Derived>
NS_IMPL_ADDREF(FetchBodyConsumer<Derived>)