Chromium Code Reviews| Index: webrtc/base/rtccertificate.cc |
| diff --git a/webrtc/base/rtccertificate.cc b/webrtc/base/rtccertificate.cc |
| index a176d9080b2cc02dacced71778f453d88b81a414..b4ad65a097e2c476c55af60b9f1de4a7659ce203 100644 |
| --- a/webrtc/base/rtccertificate.cc |
| +++ b/webrtc/base/rtccertificate.cc |
| @@ -28,13 +28,16 @@ RTCCertificate::RTCCertificate(SSLIdentity* identity) |
| RTCCertificate::~RTCCertificate() { |
| } |
| -uint64_t RTCCertificate::expires_timestamp_ns() const { |
| - // TODO(hbos): Update once SSLIdentity/SSLCertificate supports expires field. |
| +uint64_t RTCCertificate::Expires() const { |
| + int64_t expires = ssl_certificate().CertificateExpirationTime(); |
| + if (expires != -1) |
| + return static_cast<uint64_t>(expires * 1000); // s -> ms |
|
torbjorng (webrtc)
2015/12/03 13:05:18
nit: if uint64_t vs int64_t typing different reall
hbos
2015/12/03 16:03:48
Done. (It would work implicitly anyway just wanted
|
| + // If the expiration time could not be retrieved return an expired timestamp. |
|
torbjorng (webrtc)
2015/12/03 13:05:18
Might add why 0 is expired (i.e., say that this is
hbos
2015/12/03 16:03:48
Done.
|
| return 0; |
| } |
| bool RTCCertificate::HasExpired() const { |
| - return expires_timestamp_ns() <= TimeNanos(); |
| + return Expires() <= TimeMicros(); |
|
torbjorng (webrtc)
2015/12/03 13:05:18
Isn't Expires in ms and TimeMicros in ms/1000?
hbos
2015/12/03 16:03:48
Yes, oops, clumsy.
|
| } |
| const SSLCertificate& RTCCertificate::ssl_certificate() const { |