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

--HG--
extra : rebase_source : a8116bf4cdcf3910dbcbf68ba7adb36e6c9d2e04
This commit is contained in:
Jean-Yves Avenard 2015-06-11 15:55:20 +10:00
Родитель 63af29a4ae
Коммит 0b224435dc
2 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -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; }

Просмотреть файл

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