OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2011 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 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 void MaybeStartGathering() override { channel_->MaybeStartGathering(); } | 180 void MaybeStartGathering() override { channel_->MaybeStartGathering(); } |
181 | 181 |
182 IceGatheringState gathering_state() const override { | 182 IceGatheringState gathering_state() const override { |
183 return channel_->gathering_state(); | 183 return channel_->gathering_state(); |
184 } | 184 } |
185 | 185 |
186 void AddRemoteCandidate(const Candidate& candidate) override { | 186 void AddRemoteCandidate(const Candidate& candidate) override { |
187 channel_->AddRemoteCandidate(candidate); | 187 channel_->AddRemoteCandidate(candidate); |
188 } | 188 } |
| 189 void RemoveRemoteCandidate(const Candidate& candidate) override { |
| 190 channel_->RemoveRemoteCandidate(candidate); |
| 191 } |
189 | 192 |
190 void SetIceConfig(const IceConfig& config) override { | 193 void SetIceConfig(const IceConfig& config) override { |
191 channel_->SetIceConfig(config); | 194 channel_->SetIceConfig(config); |
192 } | 195 } |
193 | 196 |
194 // Needed by DtlsTransport. | 197 // Needed by DtlsTransport. |
195 TransportChannelImpl* channel() { return channel_; } | 198 TransportChannelImpl* channel() { return channel_; } |
196 | 199 |
197 private: | 200 private: |
198 void OnReadableState(TransportChannel* channel); | 201 void OnReadableState(TransportChannel* channel); |
199 void OnWritableState(TransportChannel* channel); | 202 void OnWritableState(TransportChannel* channel); |
200 void OnReadPacket(TransportChannel* channel, const char* data, size_t size, | 203 void OnReadPacket(TransportChannel* channel, const char* data, size_t size, |
201 const rtc::PacketTime& packet_time, int flags); | 204 const rtc::PacketTime& packet_time, int flags); |
202 void OnSentPacket(TransportChannel* channel, | 205 void OnSentPacket(TransportChannel* channel, |
203 const rtc::SentPacket& sent_packet); | 206 const rtc::SentPacket& sent_packet); |
204 void OnReadyToSend(TransportChannel* channel); | 207 void OnReadyToSend(TransportChannel* channel); |
205 void OnReceivingState(TransportChannel* channel); | 208 void OnReceivingState(TransportChannel* channel); |
206 void OnDtlsEvent(rtc::StreamInterface* stream_, int sig, int err); | 209 void OnDtlsEvent(rtc::StreamInterface* stream_, int sig, int err); |
207 bool SetupDtls(); | 210 bool SetupDtls(); |
208 bool MaybeStartDtls(); | 211 bool MaybeStartDtls(); |
209 bool HandleDtlsPacket(const char* data, size_t size); | 212 bool HandleDtlsPacket(const char* data, size_t size); |
210 void OnGatheringState(TransportChannelImpl* channel); | 213 void OnGatheringState(TransportChannelImpl* channel); |
211 void OnCandidateGathered(TransportChannelImpl* channel, const Candidate& c); | 214 void OnCandidateGathered(TransportChannelImpl* channel, const Candidate& c); |
| 215 void OnCandidatesRemoved(TransportChannelImpl* channel, |
| 216 const Candidates& candidates); |
212 void OnRoleConflict(TransportChannelImpl* channel); | 217 void OnRoleConflict(TransportChannelImpl* channel); |
213 void OnRouteChange(TransportChannel* channel, const Candidate& candidate); | 218 void OnRouteChange(TransportChannel* channel, const Candidate& candidate); |
214 void OnConnectionRemoved(TransportChannelImpl* channel); | 219 void OnConnectionRemoved(TransportChannelImpl* channel); |
215 void Reconnect(); | 220 void Reconnect(); |
216 | 221 |
217 rtc::Thread* worker_thread_; // Everything should occur on this thread. | 222 rtc::Thread* worker_thread_; // Everything should occur on this thread. |
218 // Underlying channel, not owned by this class. | 223 // Underlying channel, not owned by this class. |
219 TransportChannelImpl* const channel_; | 224 TransportChannelImpl* const channel_; |
220 rtc::scoped_ptr<rtc::SSLStreamAdapter> dtls_; // The DTLS stream | 225 rtc::scoped_ptr<rtc::SSLStreamAdapter> dtls_; // The DTLS stream |
221 StreamInterfaceChannel* downward_; // Wrapper for channel_, owned by dtls_. | 226 StreamInterfaceChannel* downward_; // Wrapper for channel_, owned by dtls_. |
222 std::vector<int> srtp_ciphers_; // SRTP ciphers to use with DTLS. | 227 std::vector<int> srtp_ciphers_; // SRTP ciphers to use with DTLS. |
223 bool dtls_active_ = false; | 228 bool dtls_active_ = false; |
224 rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_; | 229 rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_; |
225 rtc::SSLRole ssl_role_; | 230 rtc::SSLRole ssl_role_; |
226 rtc::SSLProtocolVersion ssl_max_version_; | 231 rtc::SSLProtocolVersion ssl_max_version_; |
227 rtc::Buffer remote_fingerprint_value_; | 232 rtc::Buffer remote_fingerprint_value_; |
228 std::string remote_fingerprint_algorithm_; | 233 std::string remote_fingerprint_algorithm_; |
229 | 234 |
230 RTC_DISALLOW_COPY_AND_ASSIGN(DtlsTransportChannelWrapper); | 235 RTC_DISALLOW_COPY_AND_ASSIGN(DtlsTransportChannelWrapper); |
231 }; | 236 }; |
232 | 237 |
233 } // namespace cricket | 238 } // namespace cricket |
234 | 239 |
235 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORTCHANNEL_H_ | 240 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORTCHANNEL_H_ |
OLD | NEW |