diff --git a/dom/media/AbstractMediaDecoder.h b/dom/media/AbstractMediaDecoder.h index 18e71a56ca..49e24fb903 100644 --- a/dom/media/AbstractMediaDecoder.h +++ b/dom/media/AbstractMediaDecoder.h @@ -41,7 +41,7 @@ enum class MediaDecoderEventVisibility : int8_t { * The AbstractMediaDecoder class describes the public interface for a media decoder * and is used by the MediaReader classes. */ -class AbstractMediaDecoder : public nsISupports +class AbstractMediaDecoder : public nsIObserver { public: // Returns the monitor for other threads to synchronise access to @@ -150,6 +150,10 @@ public: AbstractMediaDecoder* mDecoder; }; + // Classes directly inheriting from AbstractMediaDecoder do not support + // Observe and it should never be called directly. + NS_IMETHOD Observe(nsISupports *aSubject, const char * aTopic, const char16_t * aData) override + { MOZ_CRASH("Forbidden method"); return NS_OK; } }; class MetadataContainer diff --git a/dom/media/MediaDecoder.h b/dom/media/MediaDecoder.h index 0db5822387..3e469eb71d 100644 --- a/dom/media/MediaDecoder.h +++ b/dom/media/MediaDecoder.h @@ -264,8 +264,7 @@ struct SeekTarget { MediaDecoderEventVisibility mEventVisibility; }; -class MediaDecoder : public nsIObserver, - public AbstractMediaDecoder +class MediaDecoder : public AbstractMediaDecoder { public: struct SeekResolveValue {