| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/rtc_certificate.h" | 5 #include "content/renderer/media/rtc_certificate.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "content/renderer/media/peer_connection_identity_store.h" | 8 #include "content/renderer/media/peer_connection_identity_store.h" |
| 9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 RTCCertificate::RTCCertificate( | 13 RTCCertificate::RTCCertificate( |
| 14 const blink::WebRTCKeyParams& key_params, | |
| 15 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) | 14 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) |
| 16 : key_params_(key_params), certificate_(certificate) { | 15 : certificate_(certificate) { |
| 17 DCHECK(certificate_); | 16 DCHECK(certificate_); |
| 18 } | 17 } |
| 19 | 18 |
| 20 RTCCertificate::~RTCCertificate() { | 19 RTCCertificate::~RTCCertificate() { |
| 21 } | 20 } |
| 22 | 21 |
| 23 std::unique_ptr<blink::WebRTCCertificate> RTCCertificate::shallowCopy() const { | 22 std::unique_ptr<blink::WebRTCCertificate> RTCCertificate::shallowCopy() const { |
| 24 return base::WrapUnique(new RTCCertificate(key_params_, certificate_)); | 23 return base::WrapUnique(new RTCCertificate(certificate_)); |
| 25 } | |
| 26 | |
| 27 const blink::WebRTCKeyParams& RTCCertificate::keyParams() const { | |
| 28 return key_params_; | |
| 29 } | 24 } |
| 30 | 25 |
| 31 uint64_t RTCCertificate::expires() const { | 26 uint64_t RTCCertificate::expires() const { |
| 32 return certificate_->Expires(); | 27 return certificate_->Expires(); |
| 33 } | 28 } |
| 34 | 29 |
| 30 blink::WebRTCCertificatePEM RTCCertificate::toPEM() const { |
| 31 rtc::RTCCertificatePEM pem = certificate_->ToPEM(); |
| 32 return blink::WebRTCCertificatePEM(pem.private_key(), pem.certificate()); |
| 33 } |
| 34 |
| 35 bool RTCCertificate::equals(const blink::WebRTCCertificate& other) const { | 35 bool RTCCertificate::equals(const blink::WebRTCCertificate& other) const { |
| 36 return *certificate_ == | 36 return *certificate_ == |
| 37 *static_cast<const RTCCertificate&>(other).certificate_; | 37 *static_cast<const RTCCertificate&>(other).certificate_; |
| 38 } | 38 } |
| 39 | 39 |
| 40 const rtc::scoped_refptr<rtc::RTCCertificate>& | 40 const rtc::scoped_refptr<rtc::RTCCertificate>& |
| 41 RTCCertificate::rtcCertificate() const { | 41 RTCCertificate::rtcCertificate() const { |
| 42 return certificate_; | 42 return certificate_; |
| 43 } | 43 } |
| 44 | 44 |
| 45 } // namespace content | 45 } // namespace content |
| OLD | NEW |