Bug 1171330: P9. Remove "Diamond Problem" with MediaDecoder inheritance. r=cpearce

This commit is contained in:
Jean-Yves Avenard 2015-06-11 15:55:20 +10:00
parent b1d742f6c3
commit 542fd87d53
2 changed files with 7 additions and 3 deletions

View File

@ -43,7 +43,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
@ -146,6 +146,11 @@ 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; }
#ifdef MOZ_EME
virtual nsresult SetCDMProxy(CDMProxy* aProxy) { return NS_ERROR_NOT_IMPLEMENTED; }
virtual CDMProxy* GetCDMProxy() { return nullptr; }

View File

@ -264,8 +264,7 @@ struct SeekTarget {
MediaDecoderEventVisibility mEventVisibility;
};
class MediaDecoder : public nsIObserver,
public AbstractMediaDecoder
class MediaDecoder : public AbstractMediaDecoder
{
public:
struct SeekResolveValue {