OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_P2P_QUIC_QUICTRANSPORTCHANNEL_H_ | 11 #ifndef WEBRTC_P2P_QUIC_QUICTRANSPORTCHANNEL_H_ |
12 #define WEBRTC_P2P_QUIC_QUICTRANSPORTCHANNEL_H_ | 12 #define WEBRTC_P2P_QUIC_QUICTRANSPORTCHANNEL_H_ |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
| 17 #include "net/quic/quic_crypto_client_stream.h" |
17 #include "net/quic/quic_packet_writer.h" | 18 #include "net/quic/quic_packet_writer.h" |
18 #include "webrtc/base/optional.h" | 19 #include "webrtc/base/optional.h" |
19 #include "webrtc/base/scoped_ptr.h" | 20 #include "webrtc/base/scoped_ptr.h" |
20 #include "webrtc/p2p/base/transportchannelimpl.h" | 21 #include "webrtc/p2p/base/transportchannelimpl.h" |
21 #include "webrtc/p2p/quic/quicconnectionhelper.h" | 22 #include "webrtc/p2p/quic/quicconnectionhelper.h" |
22 #include "webrtc/p2p/quic/quicsession.h" | 23 #include "webrtc/p2p/quic/quicsession.h" |
23 | 24 |
24 namespace cricket { | 25 namespace cricket { |
25 | 26 |
26 enum QuicTransportState { | 27 enum QuicTransportState { |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 void SetRemoteIceMode(IceMode mode) override { | 148 void SetRemoteIceMode(IceMode mode) override { |
148 channel_->SetRemoteIceMode(mode); | 149 channel_->SetRemoteIceMode(mode); |
149 } | 150 } |
150 void MaybeStartGathering() override { channel_->MaybeStartGathering(); } | 151 void MaybeStartGathering() override { channel_->MaybeStartGathering(); } |
151 IceGatheringState gathering_state() const override { | 152 IceGatheringState gathering_state() const override { |
152 return channel_->gathering_state(); | 153 return channel_->gathering_state(); |
153 } | 154 } |
154 void AddRemoteCandidate(const Candidate& candidate) override { | 155 void AddRemoteCandidate(const Candidate& candidate) override { |
155 channel_->AddRemoteCandidate(candidate); | 156 channel_->AddRemoteCandidate(candidate); |
156 } | 157 } |
| 158 void RemoveRemoteCandidate(const Candidate& candidate) override { |
| 159 channel_->RemoveRemoteCandidate(candidate); |
| 160 } |
157 void SetIceConfig(const IceConfig& config) override { | 161 void SetIceConfig(const IceConfig& config) override { |
158 channel_->SetIceConfig(config); | 162 channel_->SetIceConfig(config); |
159 } | 163 } |
160 void Connect() override { | 164 void Connect() override { |
161 channel_->Connect(); | 165 channel_->Connect(); |
162 } | 166 } |
163 | 167 |
164 // QuicPacketWriter overrides. | 168 // QuicPacketWriter overrides. |
165 // Called from net::QuicConnection when |quic_| has packets to write. | 169 // Called from net::QuicConnection when |quic_| has packets to write. |
166 net::WriteResult WritePacket(const char* buffer, | 170 net::WriteResult WritePacket(const char* buffer, |
167 size_t buf_len, | 171 size_t buf_len, |
168 const net::IPAddressNumber& self_address, | 172 const net::IPAddress& self_address, |
169 const net::IPEndPoint& peer_address) override; | 173 const net::IPEndPoint& peer_address, |
| 174 net::PerPacketOptions* options) override; |
170 // Whether QuicTransportChannel buffers data when unable to write. If this is | 175 // Whether QuicTransportChannel buffers data when unable to write. If this is |
171 // set to false, then net::QuicConnection buffers unsent packets. | 176 // set to false, then net::QuicConnection buffers unsent packets. |
172 bool IsWriteBlockedDataBuffered() const override { return false; } | 177 bool IsWriteBlockedDataBuffered() const override { return false; } |
173 // Whether QuicTransportChannel is write blocked. If this returns true, | 178 // Whether QuicTransportChannel is write blocked. If this returns true, |
174 // outgoing QUIC packets are queued by net::QuicConnection until | 179 // outgoing QUIC packets are queued by net::QuicConnection until |
175 // QuicTransportChannel::OnCanWrite() is called. | 180 // QuicTransportChannel::OnCanWrite() is called. |
176 bool IsWriteBlocked() const override; | 181 bool IsWriteBlocked() const override; |
177 // Maximum size of the QUIC packet which can be written. | 182 // Maximum size of the QUIC packet which can be written. |
178 net::QuicByteCount GetMaxPacketSize( | 183 net::QuicByteCount GetMaxPacketSize( |
179 const net::IPEndPoint& peer_address) const override { | 184 const net::IPEndPoint& peer_address) const override { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_; | 276 rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_; |
272 // Fingerprint of the remote peer. This must be set before we start QUIC. | 277 // Fingerprint of the remote peer. This must be set before we start QUIC. |
273 rtc::Optional<RemoteFingerprint> remote_fingerprint_; | 278 rtc::Optional<RemoteFingerprint> remote_fingerprint_; |
274 | 279 |
275 RTC_DISALLOW_COPY_AND_ASSIGN(QuicTransportChannel); | 280 RTC_DISALLOW_COPY_AND_ASSIGN(QuicTransportChannel); |
276 }; | 281 }; |
277 | 282 |
278 } // namespace cricket | 283 } // namespace cricket |
279 | 284 |
280 #endif // WEBRTC_P2P_QUIC_QUICTRANSPORTCHANNEL_H_ | 285 #endif // WEBRTC_P2P_QUIC_QUICTRANSPORTCHANNEL_H_ |
OLD | NEW |