diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-02-04 11:48:13 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 12:29:29 +0200 |
commit | 369ad75fc81847c2b7ce11b92e9f5b3e4d894cfe (patch) | |
tree | 45c51214ae2e36724305965c4cc52acfad20567a /dom/media | |
parent | 37e3135bc5cf853f94e9d0d9ba706277a25db928 (diff) | |
download | UXP-369ad75fc81847c2b7ce11b92e9f5b3e4d894cfe.tar UXP-369ad75fc81847c2b7ce11b92e9f5b3e4d894cfe.tar.gz UXP-369ad75fc81847c2b7ce11b92e9f5b3e4d894cfe.tar.lz UXP-369ad75fc81847c2b7ce11b92e9f5b3e4d894cfe.tar.xz UXP-369ad75fc81847c2b7ce11b92e9f5b3e4d894cfe.zip |
Issue #26 - Part 2b: Stub out GMPDecryptorProxy functions.
If EME isn't built, these functions would have no use and the callback
structures are unavailable. Stubbing these out will still allow the
callers to work unchanged, but in effect simply always return without
dispatching a promised task.
This fixes the dependency issue from part 2a.
Diffstat (limited to 'dom/media')
-rw-r--r-- | dom/media/gmp/GMPDecryptorParent.cpp | 29 | ||||
-rw-r--r-- | dom/media/gmp/GMPDecryptorProxy.h | 7 |
2 files changed, 35 insertions, 1 deletions
diff --git a/dom/media/gmp/GMPDecryptorParent.cpp b/dom/media/gmp/GMPDecryptorParent.cpp index 1f8b9a7a8..4f5402160 100644 --- a/dom/media/gmp/GMPDecryptorParent.cpp +++ b/dom/media/gmp/GMPDecryptorParent.cpp @@ -43,11 +43,13 @@ GMPDecryptorParent::~GMPDecryptorParent() bool GMPDecryptorParent::RecvSetDecryptorId(const uint32_t& aId) { +#ifdef MOZ_EME if (!mIsOpen) { NS_WARNING("Trying to use a dead GMP decrypter!"); return false; } mCallback->SetDecryptorId(aId); +#endif return true; } @@ -202,6 +204,7 @@ bool GMPDecryptorParent::RecvSetSessionId(const uint32_t& aCreateSessionId, const nsCString& aSessionId) { +#ifdef MOZ_EME LOGD(("GMPDecryptorParent[%p]::RecvSetSessionId(token=%u, sessionId='%s')", this, aCreateSessionId, aSessionId.get())); @@ -210,6 +213,7 @@ GMPDecryptorParent::RecvSetSessionId(const uint32_t& aCreateSessionId, return false; } mCallback->SetSessionId(aCreateSessionId, aSessionId); +#endif return true; } @@ -217,6 +221,7 @@ bool GMPDecryptorParent::RecvResolveLoadSessionPromise(const uint32_t& aPromiseId, const bool& aSuccess) { +#ifdef MOZ_EME LOGD(("GMPDecryptorParent[%p]::RecvResolveLoadSessionPromise(promiseId=%u)", this, aPromiseId)); @@ -225,12 +230,14 @@ GMPDecryptorParent::RecvResolveLoadSessionPromise(const uint32_t& aPromiseId, return false; } mCallback->ResolveLoadSessionPromise(aPromiseId, aSuccess); +#endif return true; } bool GMPDecryptorParent::RecvResolvePromise(const uint32_t& aPromiseId) { +#ifdef MOZ_EME LOGD(("GMPDecryptorParent[%p]::RecvResolvePromise(promiseId=%u)", this, aPromiseId)); @@ -239,6 +246,7 @@ GMPDecryptorParent::RecvResolvePromise(const uint32_t& aPromiseId) return false; } mCallback->ResolvePromise(aPromiseId); +#endif return true; } @@ -266,6 +274,7 @@ GMPDecryptorParent::RecvRejectPromise(const uint32_t& aPromiseId, const GMPDOMException& aException, const nsCString& aMessage) { +#ifdef MOZ_EME LOGD(("GMPDecryptorParent[%p]::RecvRejectPromise(promiseId=%u, exception=%d, msg='%s')", this, aPromiseId, aException, aMessage.get())); @@ -274,10 +283,11 @@ GMPDecryptorParent::RecvRejectPromise(const uint32_t& aPromiseId, return false; } mCallback->RejectPromise(aPromiseId, GMPExToNsresult(aException), aMessage); +#endif return true; } - +#ifdef MOZ_EME static dom::MediaKeyMessageType ToMediaKeyMessageType(GMPSessionMessageType aMessageType) { switch (aMessageType) { @@ -288,12 +298,14 @@ ToMediaKeyMessageType(GMPSessionMessageType aMessageType) { default: return dom::MediaKeyMessageType::License_request; }; }; +#endif bool GMPDecryptorParent::RecvSessionMessage(const nsCString& aSessionId, const GMPSessionMessageType& aMessageType, nsTArray<uint8_t>&& aMessage) { +#ifdef MOZ_EME LOGD(("GMPDecryptorParent[%p]::RecvSessionMessage(sessionId='%s', type=%d, msg='%s')", this, aSessionId.get(), aMessageType, ToBase64(aMessage).get())); @@ -302,6 +314,7 @@ GMPDecryptorParent::RecvSessionMessage(const nsCString& aSessionId, return false; } mCallback->SessionMessage(aSessionId, ToMediaKeyMessageType(aMessageType), aMessage); +#endif return true; } @@ -309,6 +322,7 @@ bool GMPDecryptorParent::RecvExpirationChange(const nsCString& aSessionId, const double& aExpiryTime) { +#ifdef MOZ_EME LOGD(("GMPDecryptorParent[%p]::RecvExpirationChange(sessionId='%s', expiry=%lf)", this, aSessionId.get(), aExpiryTime)); @@ -317,12 +331,14 @@ GMPDecryptorParent::RecvExpirationChange(const nsCString& aSessionId, return false; } mCallback->ExpirationChange(aSessionId, aExpiryTime); +#endif return true; } bool GMPDecryptorParent::RecvSessionClosed(const nsCString& aSessionId) { +#ifdef MOZ_EME LOGD(("GMPDecryptorParent[%p]::RecvSessionClosed(sessionId='%s')", this, aSessionId.get())); @@ -331,6 +347,7 @@ GMPDecryptorParent::RecvSessionClosed(const nsCString& aSessionId) return false; } mCallback->SessionClosed(aSessionId); +#endif return true; } @@ -340,6 +357,7 @@ GMPDecryptorParent::RecvSessionError(const nsCString& aSessionId, const uint32_t& aSystemCode, const nsCString& aMessage) { +#ifdef MOZ_EME LOGD(("GMPDecryptorParent[%p]::RecvSessionError(sessionId='%s', exception=%d, sysCode=%d, msg='%s')", this, aSessionId.get(), aException, aSystemCode, aMessage.get())); @@ -352,9 +370,11 @@ GMPDecryptorParent::RecvSessionError(const nsCString& aSessionId, GMPExToNsresult(aException), aSystemCode, aMessage); +#endif return true; } +#ifdef MOZ_EME static dom::MediaKeyStatus ToMediaKeyStatus(GMPMediaKeyStatus aStatus) { switch (aStatus) { @@ -368,11 +388,13 @@ ToMediaKeyStatus(GMPMediaKeyStatus aStatus) { default: return dom::MediaKeyStatus::Internal_error; } } +#endif bool GMPDecryptorParent::RecvBatchedKeyStatusChanged(const nsCString& aSessionId, InfallibleTArray<GMPKeyInformation>&& aKeyInfos) { +#ifdef MOZ_EME LOGD(("GMPDecryptorParent[%p]::RecvBatchedKeyStatusChanged(sessionId='%s', KeyInfos len='%d')", this, aSessionId.get(), aKeyInfos.Length())); @@ -392,9 +414,11 @@ GMPDecryptorParent::RecvBatchedKeyStatusChanged(const nsCString& aSessionId, } mCallback->BatchedKeyStatusChanged(aSessionId, cdmKeyInfos); } +#endif return true; } +#ifdef MOZ_EME DecryptStatus ToDecryptStatus(GMPErr aError) { @@ -405,12 +429,14 @@ ToDecryptStatus(GMPErr aError) default: return GenericErr; } } +#endif bool GMPDecryptorParent::RecvDecrypted(const uint32_t& aId, const GMPErr& aErr, InfallibleTArray<uint8_t>&& aBuffer) { +#ifdef MOZ_EME LOGV(("GMPDecryptorParent[%p]::RecvDecrypted(id=%d, err=%d)", this, aId, aErr)); @@ -419,6 +445,7 @@ GMPDecryptorParent::RecvDecrypted(const uint32_t& aId, return false; } mCallback->Decrypted(aId, ToDecryptStatus(aErr), aBuffer); +#endif return true; } diff --git a/dom/media/gmp/GMPDecryptorProxy.h b/dom/media/gmp/GMPDecryptorProxy.h index 0ef31fd92..ed16755f8 100644 --- a/dom/media/gmp/GMPDecryptorProxy.h +++ b/dom/media/gmp/GMPDecryptorProxy.h @@ -6,7 +6,9 @@ #ifndef GMPDecryptorProxy_h_ #define GMPDecryptorProxy_h_ +#ifdef MOZ_EME #include "mozilla/DecryptorProxyCallback.h" +#endif #include "GMPCallbackBase.h" #include "gmp-decryption.h" #include "nsString.h" @@ -15,8 +17,13 @@ namespace mozilla { class CryptoSample; } // namespace mozilla +#ifdef MOZ_EME class GMPDecryptorProxyCallback : public DecryptorProxyCallback, public GMPCallbackBase { +#else +class GMPDecryptorProxyCallback : public GMPCallbackBase { +#endif + public: virtual ~GMPDecryptorProxyCallback() {} }; |