mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1215519 - Switch to DOMTimeStamp for RTCCertificate. r=bz
This commit is contained in:
parent
a0b634416e
commit
82cff83b93
@ -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",
|
||||
|
@ -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));
|
||||
|
@ -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.
|
||||
|
@ -8,5 +8,5 @@
|
||||
|
||||
[Pref="media.peerconnection.enabled"]
|
||||
interface RTCCertificate {
|
||||
readonly attribute Date expires;
|
||||
readonly attribute DOMTimeStamp expires;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user