mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-06-01 09:19:26 +00:00
Make templated MediaPromise class inherit from ref-counted base
NS_INLINE_DECL_THREADSAFE_REFCOUNTING can't be used with templated classes.
This commit is contained in:
@@ -42,9 +42,18 @@ extern PRLogModuleInfo* gMediaPromiseLog;
|
||||
* When IsExclusive is true, the MediaPromise does a release-mode assertion that
|
||||
* there is at most one call to either Then(...) or ChainTo(...).
|
||||
*/
|
||||
|
||||
class MediaPromiseBase
|
||||
{
|
||||
public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaPromiseBase)
|
||||
protected:
|
||||
virtual ~MediaPromiseBase() {}
|
||||
};
|
||||
|
||||
template<typename T> class MediaPromiseHolder;
|
||||
template<typename ResolveValueT, typename RejectValueT, bool IsExclusive>
|
||||
class MediaPromise
|
||||
class MediaPromise : public MediaPromiseBase
|
||||
{
|
||||
public:
|
||||
typedef ResolveValueT ResolveValueType;
|
||||
@@ -75,8 +84,6 @@ public:
|
||||
Maybe<RejectValueType> mRejectValue;
|
||||
};
|
||||
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaPromise)
|
||||
|
||||
protected:
|
||||
// MediaPromise is the public type, and never constructed directly. Construct
|
||||
// a MediaPromise::Private, defined below.
|
||||
@@ -432,7 +439,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
~MediaPromise()
|
||||
virtual ~MediaPromise()
|
||||
{
|
||||
PROMISE_LOG("MediaPromise::~MediaPromise [this=%p]", this);
|
||||
MOZ_ASSERT(!IsPending());
|
||||
|
||||
Reference in New Issue
Block a user