Bug 1334421 - Don't use templated class for refcount macros in MediaParent. r?jib
The assert in
bug 1334421 mentions the MOZ_COUNT_{C|D}TOR macros, but the same
comment seems to apply to the NS_LogAddRef that's part of the
NS_INLINE_DECL_THREADSAFE_REFCOUNTING macro.
This fixes it for me.
MozReview-Commit-ID: CPjdO8YBbt0
--- a/dom/media/systemservices/MediaParent.h
+++ b/dom/media/systemservices/MediaParent.h
@@ -35,26 +35,37 @@ protected:
const bool& aOnlyPrivateBrowsing) = 0;
virtual void
ActorDestroy(ActorDestroyReason aWhy) = 0;
bool SendGetPrincipalKeyResponse(const uint32_t& aRequestId,
nsCString aKey);
};
+/**
+ * Dummy class to avoid a templated class being passed to the refcounting macro
+ * (see Bug 1334421 for what happens then)
+ */
+class RefCountedParent
+{
+public:
+ NS_INLINE_DECL_THREADSAFE_REFCOUNTING(RefCountedParent)
+
+protected:
+ virtual ~RefCountedParent() {}
+};
+
// Super = PMediaParent or NonE10s
template<class Super>
-class Parent : public Super
+class Parent : public RefCountedParent, public Super
{
typedef mozilla::ipc::IProtocol::ActorDestroyReason
ActorDestroyReason;
public:
- NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Parent<Super>)
-
virtual mozilla::ipc::IPCResult
RecvGetPrincipalKey(const uint32_t& aRequestId,
const mozilla::ipc::PrincipalInfo& aPrincipalInfo,
const bool& aPersist) override;
virtual mozilla::ipc::IPCResult RecvSanitizeOriginKeys(const uint64_t& aSinceWhen,
const bool& aOnlyPrivateBrowsing) override;
virtual void ActorDestroy(ActorDestroyReason aWhy) override;