OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 // (transport_name, candidates) | 113 // (transport_name, candidates) |
114 sigslot::signal2<const std::string&, const Candidates&> | 114 sigslot::signal2<const std::string&, const Candidates&> |
115 SignalCandidatesGathered; | 115 SignalCandidatesGathered; |
116 | 116 |
117 sigslot::signal1<const Candidates&> SignalCandidatesRemoved; | 117 sigslot::signal1<const Candidates&> SignalCandidatesRemoved; |
118 | 118 |
119 // for unit test | 119 // for unit test |
120 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate_for_testing(); | 120 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate_for_testing(); |
121 | 121 |
| 122 sigslot::signal1<rtc::SSLHandshakeError> SignalDtlsHandshakeError; |
| 123 |
122 protected: | 124 protected: |
123 // Protected and virtual so we can override it in unit tests. | 125 // Protected and virtual so we can override it in unit tests. |
124 virtual Transport* CreateTransport_n(const std::string& transport_name); | 126 virtual Transport* CreateTransport_n(const std::string& transport_name); |
125 | 127 |
126 // For unit tests | 128 // For unit tests |
127 const std::map<std::string, Transport*>& transports() { return transports_; } | 129 const std::map<std::string, Transport*>& transports() { return transports_; } |
128 Transport* GetTransport_n(const std::string& transport_name); | 130 Transport* GetTransport_n(const std::string& transport_name); |
129 | 131 |
130 private: | 132 private: |
131 void OnMessage(rtc::Message* pmsg) override; | 133 void OnMessage(rtc::Message* pmsg) override; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 void OnChannelCandidateGathered_n(TransportChannelImpl* channel, | 197 void OnChannelCandidateGathered_n(TransportChannelImpl* channel, |
196 const Candidate& candidate); | 198 const Candidate& candidate); |
197 void OnChannelCandidatesRemoved(const Candidates& candidates); | 199 void OnChannelCandidatesRemoved(const Candidates& candidates); |
198 void OnChannelCandidatesRemoved_n(TransportChannelImpl* channel, | 200 void OnChannelCandidatesRemoved_n(TransportChannelImpl* channel, |
199 const Candidates& candidates); | 201 const Candidates& candidates); |
200 void OnChannelRoleConflict_n(TransportChannelImpl* channel); | 202 void OnChannelRoleConflict_n(TransportChannelImpl* channel); |
201 void OnChannelStateChanged_n(TransportChannelImpl* channel); | 203 void OnChannelStateChanged_n(TransportChannelImpl* channel); |
202 | 204 |
203 void UpdateAggregateStates_n(); | 205 void UpdateAggregateStates_n(); |
204 | 206 |
| 207 void OnDtlsHandshakeError(rtc::SSLHandshakeError error); |
| 208 |
205 rtc::Thread* const signaling_thread_ = nullptr; | 209 rtc::Thread* const signaling_thread_ = nullptr; |
206 rtc::Thread* const network_thread_ = nullptr; | 210 rtc::Thread* const network_thread_ = nullptr; |
207 typedef std::map<std::string, Transport*> TransportMap; | 211 typedef std::map<std::string, Transport*> TransportMap; |
208 TransportMap transports_; | 212 TransportMap transports_; |
209 | 213 |
210 std::vector<RefCountedChannel> channels_; | 214 std::vector<RefCountedChannel> channels_; |
211 | 215 |
212 PortAllocator* const port_allocator_ = nullptr; | 216 PortAllocator* const port_allocator_ = nullptr; |
213 rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_12; | 217 rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_12; |
214 | 218 |
215 // Aggregate state for TransportChannelImpls. | 219 // Aggregate state for TransportChannelImpls. |
216 IceConnectionState connection_state_ = kIceConnectionConnecting; | 220 IceConnectionState connection_state_ = kIceConnectionConnecting; |
217 bool receiving_ = false; | 221 bool receiving_ = false; |
218 IceGatheringState gathering_state_ = kIceGatheringNew; | 222 IceGatheringState gathering_state_ = kIceGatheringNew; |
219 | 223 |
220 // TODO(deadbeef): Move the fields below down to the transports themselves | 224 // TODO(deadbeef): Move the fields below down to the transports themselves |
221 IceConfig ice_config_; | 225 IceConfig ice_config_; |
222 IceRole ice_role_ = ICEROLE_CONTROLLING; | 226 IceRole ice_role_ = ICEROLE_CONTROLLING; |
223 uint64_t ice_tiebreaker_ = rtc::CreateRandomId64(); | 227 uint64_t ice_tiebreaker_ = rtc::CreateRandomId64(); |
224 rtc::scoped_refptr<rtc::RTCCertificate> certificate_; | 228 rtc::scoped_refptr<rtc::RTCCertificate> certificate_; |
225 rtc::AsyncInvoker invoker_; | 229 rtc::AsyncInvoker invoker_; |
226 // True if QUIC is used instead of DTLS. | 230 // True if QUIC is used instead of DTLS. |
227 bool quic_ = false; | 231 bool quic_ = false; |
228 }; | 232 }; |
229 | 233 |
230 } // namespace cricket | 234 } // namespace cricket |
231 | 235 |
232 #endif // WEBRTC_P2P_BASE_TRANSPORTCONTROLLER_H_ | 236 #endif // WEBRTC_P2P_BASE_TRANSPORTCONTROLLER_H_ |
OLD | NEW |