summaryrefslogtreecommitdiffstats
path: root/dom/media/gmp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-03-16 13:54:20 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-03-16 13:54:20 +0100
commite9261d329b443e588de408ff85917ac29d4ab62d (patch)
tree1473967835c95d7f37b7ed683fb9363f33ddbeea /dom/media/gmp
parentcece1cb715b43fd99ec3dda926abe30181a8f5dd (diff)
downloadUXP-e9261d329b443e588de408ff85917ac29d4ab62d.tar
UXP-e9261d329b443e588de408ff85917ac29d4ab62d.tar.gz
UXP-e9261d329b443e588de408ff85917ac29d4ab62d.tar.lz
UXP-e9261d329b443e588de408ff85917ac29d4ab62d.tar.xz
UXP-e9261d329b443e588de408ff85917ac29d4ab62d.zip
Fix build bustage.
Diffstat (limited to 'dom/media/gmp')
-rw-r--r--dom/media/gmp/widevine-adapter/WidevineDecryptor.cpp19
-rw-r--r--dom/media/gmp/widevine-adapter/WidevineUtils.h4
2 files changed, 21 insertions, 2 deletions
diff --git a/dom/media/gmp/widevine-adapter/WidevineDecryptor.cpp b/dom/media/gmp/widevine-adapter/WidevineDecryptor.cpp
index f89888a72..4d3408804 100644
--- a/dom/media/gmp/widevine-adapter/WidevineDecryptor.cpp
+++ b/dom/media/gmp/widevine-adapter/WidevineDecryptor.cpp
@@ -102,7 +102,7 @@ WidevineDecryptor::CreateSession(uint32_t aCreateSessionToken,
} else {
// Invalid init data type
const char* errorMsg = "Invalid init data type when creating session.";
- OnRejectPromise(aPromiseId, kNotSupportedError, 0, errorMsg, sizeof(errorMsg));
+ OnRejectPromise(aPromiseId, kExceptionNotSupportedError, 0, errorMsg, sizeof(errorMsg));
return;
}
mPromiseIdToNewSessionTokens[aPromiseId] = aCreateSessionToken;
@@ -338,6 +338,21 @@ WidevineDecryptor::OnResolvePromise(uint32_t aPromiseId)
mCallback->ResolvePromise(aPromiseId);
}
+static GMPDOMException
+ConvertCDMExceptionToGMPDOMException(cdm::Exception aException)
+{
+ switch (aException) {
+ case kExceptionNotSupportedError: return kGMPNotSupportedError;
+ case kExceptionInvalidStateError: return kGMPInvalidStateError;
+ case kExceptionTypeError: return kGMPTypeError;
+ case kExceptionQuotaExceededError: return kGMPQuotaExceededError;
+ case kUnknownError: return kGMPInvalidModificationError; // Note: Unique placeholder.
+ case kClientError: return kGMPAbortError; // Note: Unique placeholder.
+ case kOutputError: return kGMPSecurityError; // Note: Unique placeholder.
+ };
+ return kGMPInvalidStateError; // Note: Unique placeholder.
+}
+
// Align with spec, the Exceptions used by CDM to reject promises .
// https://w3c.github.io/encrypted-media/#exceptions
cdm::Exception
@@ -376,7 +391,7 @@ WidevineDecryptor::OnRejectPromise(uint32_t aPromiseId,
Log("Decryptor::OnRejectPromise(aPromiseId=%d, err=%d, sysCode=%u, msg=%s)",
aPromiseId, (int)aException, aSystemCode, aErrorMessage);
mCallback->RejectPromise(aPromiseId,
- ToGMPDOMException(aException),
+ ConvertCDMExceptionToGMPDOMException(aException),
!aErrorMessageSize ? "" : aErrorMessage,
aErrorMessageSize);
}
diff --git a/dom/media/gmp/widevine-adapter/WidevineUtils.h b/dom/media/gmp/widevine-adapter/WidevineUtils.h
index ca65ff881..2f6137fe3 100644
--- a/dom/media/gmp/widevine-adapter/WidevineUtils.h
+++ b/dom/media/gmp/widevine-adapter/WidevineUtils.h
@@ -51,6 +51,10 @@ public:
explicit CDMWrapper(cdm::ContentDecryptionModule_9* aCDM,
WidevineDecryptor* aDecryptor);
cdm::ContentDecryptionModule_9* GetCDM() const { return mCDM; }
+ void OnStorageId(uint32_t aVersion, const uint8_t* aStorageId,
+ uint32_t aStorageIdSize) {
+ mCDM->OnStorageId(aVersion, aStorageId, aStorageIdSize);
+ }
private:
~CDMWrapper();
cdm::ContentDecryptionModule_9* mCDM;