Bug 1215519 - Switch to DOMTimeStamp for RTCCertificate. r=bz

This commit is contained in:
Martin Thomson 2015-10-21 10:08:40 -07:00
parent a0b634416e
commit 82cff83b93
4 changed files with 7 additions and 9 deletions

View File

@ -451,7 +451,7 @@ RTCPeerConnection.prototype = {
"RTCPeerConnection does not currently support multiple certificates",
"NotSupportedError");
}
let cert = certificates.find(c => c.expires.getTime() > Date.now());
let cert = certificates.find(c => c.expires > Date.now());
if (!cert) {
throw new this._win.DOMException(
"Unable to create RTCPeerConnection with an expired certificate",

View File

@ -107,15 +107,15 @@
expires: 1 // smallest possible expiration window
}))
.then(cert => {
ok(cert.expires instanceof Date, 'cert has expiration time');
info('Expires at ' + cert.expires);
ok(!isNaN(cert.expires), 'cert has expiration time');
info('Expires at ' + new Date(cert.expires));
expiredCert = cert;
})
.then(() => checkBadParameters())
.then(() => {
var delay = expiredCert.expires.getTime() - Date.now();
var delay = expiredCert.expires - Date.now();
// Hopefully this delay is never needed.
if (delay > 0) {
return new Promise(r => setTimeout(r, delay));

View File

@ -18,10 +18,8 @@
#include "mozilla/ErrorResult.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/RefPtr.h"
#include "mozilla/dom/Date.h"
#include "mozilla/dom/CryptoKey.h"
#include "mtransport/dtlsidentity.h"
#include "js/Date.h"
#include "js/StructuredClone.h"
#include "js/TypeDecls.h"
@ -55,9 +53,9 @@ public:
// WebIDL expires attribute. Note: JS dates are milliseconds since epoch;
// NSPR PRTime is in microseconds since the same epoch.
JS::ClippedTime Expires() const
uint64_t Expires() const
{
return JS::TimeClip(mExpires / PR_USEC_PER_MSEC);
return mExpires / PR_USEC_PER_MSEC;
}
// Accessors for use by PeerConnectionImpl.

View File

@ -8,5 +8,5 @@
[Pref="media.peerconnection.enabled"]
interface RTCCertificate {
readonly attribute Date expires;
readonly attribute DOMTimeStamp expires;
};