Bug 1324925 - Convert GMPTimestamp to epoch seconds in GMPDecryptorChild::ExpirationChange(). r?gerald
MozReview-Commit-ID: 8tSl2kIQc1w
--- a/dom/media/eme/MediaKeySession.cpp
+++ b/dom/media/eme/MediaKeySession.cpp
@@ -632,23 +632,23 @@ MediaKeySession::MakePromise(ErrorResult
NS_WARNING("Passed non-global to MediaKeys ctor!");
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
return DetailedPromise::Create(global, aRv, aName);
}
void
-MediaKeySession::SetExpiration(double aExpiration)
+MediaKeySession::SetExpiration(double aSecondsSinceEpoch)
{
EME_LOG("MediaKeySession[%p,'%s'] SetExpiry(%lf)",
this,
NS_ConvertUTF16toUTF8(mSessionId).get(),
- aExpiration);
- mExpiration = aExpiration;
+ aSecondsSinceEpoch);
+ mExpiration = aSecondsSinceEpoch;
}
EventHandlerNonNull*
MediaKeySession::GetOnkeystatuseschange()
{
return GetEventHandler(nsGkAtoms::onkeystatuseschange, EmptyString());
}
--- a/dom/media/gmp/GMPDecryptorChild.cpp
+++ b/dom/media/gmp/GMPDecryptorChild.cpp
@@ -124,20 +124,21 @@ GMPDecryptorChild::SessionMessage(const
CALL_ON_GMP_THREAD(SendSessionMessage,
nsCString(aSessionId, aSessionIdLength),
aMessageType, Move(msg));
}
void
GMPDecryptorChild::ExpirationChange(const char* aSessionId,
uint32_t aSessionIdLength,
- GMPTimestamp aExpiryTime)
+ GMPTimestamp aMillisecondsSinceEpoch)
{
CALL_ON_GMP_THREAD(SendExpirationChange,
- nsCString(aSessionId, aSessionIdLength), aExpiryTime);
+ nsCString(aSessionId, aSessionIdLength),
+ aMillisecondsSinceEpoch / 1e3);
}
void
GMPDecryptorChild::SessionClosed(const char* aSessionId,
uint32_t aSessionIdLength)
{
CALL_ON_GMP_THREAD(SendSessionClosed,
nsCString(aSessionId, aSessionIdLength));
--- a/dom/media/gmp/GMPDecryptorParent.cpp
+++ b/dom/media/gmp/GMPDecryptorParent.cpp
@@ -302,26 +302,26 @@ GMPDecryptorParent::RecvSessionMessage(c
return IPC_FAIL_NO_REASON(this);
}
mCallback->SessionMessage(aSessionId, ToMediaKeyMessageType(aMessageType), aMessage);
return IPC_OK();
}
mozilla::ipc::IPCResult
GMPDecryptorParent::RecvExpirationChange(const nsCString& aSessionId,
- const double& aExpiryTime)
+ const double& aSecondsSinceEpoch)
{
LOGD(("GMPDecryptorParent[%p]::RecvExpirationChange(sessionId='%s', expiry=%lf)",
- this, aSessionId.get(), aExpiryTime));
+ this, aSessionId.get(), aSecondsSinceEpoch));
if (!mIsOpen) {
NS_WARNING("Trying to use a dead GMP decrypter!");
return IPC_FAIL_NO_REASON(this);
}
- mCallback->ExpirationChange(aSessionId, aExpiryTime);
+ mCallback->ExpirationChange(aSessionId, aSecondsSinceEpoch);
return IPC_OK();
}
mozilla::ipc::IPCResult
GMPDecryptorParent::RecvSessionClosed(const nsCString& aSessionId)
{
LOGD(("GMPDecryptorParent[%p]::RecvSessionClosed(sessionId='%s')",
this, aSessionId.get()));
--- a/dom/media/gmp/PGMPDecryptor.ipdl
+++ b/dom/media/gmp/PGMPDecryptor.ipdl
@@ -66,17 +66,17 @@ parent:
async RejectPromise(uint32_t aPromiseId,
GMPDOMException aDOMExceptionCode,
nsCString aMessage);
async SessionMessage(nsCString aSessionId,
GMPSessionMessageType aMessageType,
uint8_t[] aMessage);
- async ExpirationChange(nsCString aSessionId, double aExpiryTime);
+ async ExpirationChange(nsCString aSessionId, double aSecondsSinceEpoch);
async SessionClosed(nsCString aSessionId);
async SessionError(nsCString aSessionId,
GMPDOMException aDOMExceptionCode,
uint32_t aSystemCode,
nsCString aMessage);