From 1be0ced0e4fef44a52342685c0a15a64ed255461 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Thu, 29 Oct 2020 08:02:05 +0000 Subject: [PATCH] Bug 1660555 - Make |AbortFollower| actually inherit from |nsISupports|. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D92323 --- dom/abort/AbortSignal.h | 4 +--- dom/fetch/Fetch.cpp | 4 +++- dom/fetch/Fetch.h | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dom/abort/AbortSignal.h b/dom/abort/AbortSignal.h index 1408866c472e..4f56e7c5f8f0 100644 --- a/dom/abort/AbortSignal.h +++ b/dom/abort/AbortSignal.h @@ -19,10 +19,8 @@ class AbortSignalImpl; // This class must be implemented by objects who want to follow a // AbortSignalImpl. -class AbortFollower { +class AbortFollower : public nsISupports { public: - NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING - virtual void RunAbortAlgorithm() = 0; void Follow(AbortSignalImpl* aSignal); diff --git a/dom/fetch/Fetch.cpp b/dom/fetch/Fetch.cpp index aeea6c80c4b6..a04f02665cfc 100644 --- a/dom/fetch/Fetch.cpp +++ b/dom/fetch/Fetch.cpp @@ -141,7 +141,7 @@ class AbortSignalProxy final : public AbortFollower { }; public: - NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AbortSignalProxy, override) + NS_DECL_THREADSAFE_ISUPPORTS AbortSignalProxy(AbortSignalImpl* aSignalImpl, nsIEventTarget* aMainThreadEventTarget) @@ -180,6 +180,8 @@ class AbortSignalProxy final : public AbortFollower { } }; +NS_IMPL_ISUPPORTS0(AbortSignalProxy) + class WorkerFetchResolver final : public FetchDriverObserver { // Thread-safe: RefPtr mPromiseProxy; diff --git a/dom/fetch/Fetch.h b/dom/fetch/Fetch.h index 4aca8ead0224..cbde04303fc6 100644 --- a/dom/fetch/Fetch.h +++ b/dom/fetch/Fetch.h @@ -122,8 +122,9 @@ nsresult ExtractByteStreamFromBody(const fetch::ResponseBodyInit& aBodyInit, template class FetchBody : public BodyStreamHolder, public AbortFollower { public: - using BodyStreamHolder::AddRef; - using BodyStreamHolder::Release; + using BodyStreamHolder::QueryInterface; + + NS_INLINE_DECL_REFCOUNTING_INHERITED(FetchBody, BodyStreamHolder) bool GetBodyUsed(ErrorResult& aRv) const;