OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 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 #ifndef WEBRTC_P2P_QUIC_QUICTRANSPORT_H_ |
| 12 #define WEBRTC_P2P_QUIC_QUICTRANSPORT_H_ |
| 13 |
| 14 #include <string> |
| 15 #include <map> |
| 16 |
| 17 #include "webrtc/p2p/base/transport.h" |
| 18 #include "webrtc/p2p/quic/quictransportchannel.h" |
| 19 |
| 20 namespace cricket { |
| 21 |
| 22 class P2PTransportChannel; |
| 23 class PortAllocator; |
| 24 |
| 25 // TODO(mikescarlett): Refactor to avoid code duplication with DtlsTransport. |
| 26 class QuicTransport : public Transport { |
| 27 public: |
| 28 QuicTransport(const std::string& name, |
| 29 PortAllocator* allocator, |
| 30 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate); |
| 31 |
| 32 ~QuicTransport() override; |
| 33 |
| 34 // Transport overrides. |
| 35 void SetLocalCertificate( |
| 36 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) override; |
| 37 bool GetLocalCertificate( |
| 38 rtc::scoped_refptr<rtc::RTCCertificate>* certificate) override; |
| 39 bool SetSslMaxProtocolVersion(rtc::SSLProtocolVersion version) override { |
| 40 return true; // Not needed by QUIC |
| 41 } |
| 42 bool GetSslRole(rtc::SSLRole* ssl_role) const override; |
| 43 |
| 44 protected: |
| 45 // Transport overrides. |
| 46 QuicTransportChannel* CreateTransportChannel(int component) override; |
| 47 void DestroyTransportChannel(TransportChannelImpl* channel) override; |
| 48 bool ApplyLocalTransportDescription(TransportChannelImpl* channel, |
| 49 std::string* error_desc) override; |
| 50 bool NegotiateTransportDescription(ContentAction action, |
| 51 std::string* error_desc) override; |
| 52 bool ApplyNegotiatedTransportDescription(TransportChannelImpl* channel, |
| 53 std::string* error_desc) override; |
| 54 |
| 55 private: |
| 56 rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_; |
| 57 rtc::SSLRole local_role_ = rtc::SSL_CLIENT; |
| 58 rtc::scoped_ptr<rtc::SSLFingerprint> remote_fingerprint_; |
| 59 }; |
| 60 |
| 61 } // namespace cricket |
| 62 |
| 63 #endif // WEBRTC_P2P_QUIC_QUICTRANSPORT_H_ |
OLD | NEW |