Harald Alvestrand | 7061e51 | 2019-04-10 17:20:42 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include "api/dtls_transport_interface.h" |
| 12 | |
| 13 | namespace webrtc { |
| 14 | |
| 15 | DtlsTransportInformation::DtlsTransportInformation() |
| 16 | : state_(DtlsTransportState::kNew) {} |
| 17 | |
| 18 | DtlsTransportInformation::DtlsTransportInformation(DtlsTransportState state) |
| 19 | : state_(state) {} |
| 20 | |
| 21 | DtlsTransportInformation::DtlsTransportInformation( |
| 22 | DtlsTransportState state, |
| 23 | std::unique_ptr<rtc::SSLCertChain> remote_ssl_certificates) |
| 24 | : state_(state), |
| 25 | remote_ssl_certificates_(std::move(remote_ssl_certificates)) {} |
| 26 | |
| 27 | DtlsTransportInformation::DtlsTransportInformation( |
| 28 | const DtlsTransportInformation& c) |
| 29 | : state_(c.state()), |
| 30 | remote_ssl_certificates_(c.remote_ssl_certificates() |
| 31 | ? c.remote_ssl_certificates()->Clone() |
| 32 | : nullptr) {} |
| 33 | |
| 34 | DtlsTransportInformation& DtlsTransportInformation::operator=( |
| 35 | const DtlsTransportInformation& c) { |
| 36 | state_ = c.state(); |
| 37 | remote_ssl_certificates_ = c.remote_ssl_certificates() |
| 38 | ? c.remote_ssl_certificates()->Clone() |
| 39 | : nullptr; |
| 40 | return *this; |
| 41 | } |
| 42 | |
| 43 | } // namespace webrtc |