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 |
11 #include "webrtc/p2p/base/transportcontroller.h" | 11 #include "webrtc/p2p/base/transportcontroller.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 | 14 |
15 #include "webrtc/base/bind.h" | 15 #include "webrtc/base/bind.h" |
16 #include "webrtc/base/checks.h" | 16 #include "webrtc/base/checks.h" |
17 #include "webrtc/base/thread.h" | 17 #include "webrtc/base/thread.h" |
18 #include "webrtc/p2p/base/dtlstransport.h" | 18 #include "webrtc/p2p/base/dtlstransport.h" |
19 #include "webrtc/p2p/base/p2ptransport.h" | 19 #include "webrtc/p2p/base/p2ptransport.h" |
20 #include "webrtc/p2p/base/port.h" | 20 #include "webrtc/p2p/base/port.h" |
21 | 21 |
| 22 #ifdef HAVE_QUIC |
| 23 #include "webrtc/p2p/quic/quictransport.h" |
| 24 #endif // HAVE_QUIC |
| 25 |
22 namespace cricket { | 26 namespace cricket { |
23 | 27 |
24 enum { | 28 enum { |
25 MSG_ICECONNECTIONSTATE, | 29 MSG_ICECONNECTIONSTATE, |
26 MSG_RECEIVING, | 30 MSG_RECEIVING, |
27 MSG_ICEGATHERINGSTATE, | 31 MSG_ICEGATHERINGSTATE, |
28 MSG_CANDIDATESGATHERED, | 32 MSG_CANDIDATESGATHERED, |
29 }; | 33 }; |
30 | 34 |
31 struct CandidatesData : public rtc::MessageData { | 35 struct CandidatesData : public rtc::MessageData { |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 215 |
212 const rtc::scoped_refptr<rtc::RTCCertificate>& | 216 const rtc::scoped_refptr<rtc::RTCCertificate>& |
213 TransportController::certificate_for_testing() { | 217 TransportController::certificate_for_testing() { |
214 return certificate_; | 218 return certificate_; |
215 } | 219 } |
216 | 220 |
217 Transport* TransportController::CreateTransport_w( | 221 Transport* TransportController::CreateTransport_w( |
218 const std::string& transport_name) { | 222 const std::string& transport_name) { |
219 RTC_DCHECK(worker_thread_->IsCurrent()); | 223 RTC_DCHECK(worker_thread_->IsCurrent()); |
220 | 224 |
| 225 #ifdef HAVE_QUIC |
| 226 if (quic_) { |
| 227 return new QuicTransport(transport_name, port_allocator(), certificate_); |
| 228 } |
| 229 #endif // HAVE_QUIC |
221 Transport* transport = new DtlsTransport<P2PTransport>( | 230 Transport* transport = new DtlsTransport<P2PTransport>( |
222 transport_name, port_allocator(), certificate_); | 231 transport_name, port_allocator(), certificate_); |
223 return transport; | 232 return transport; |
224 } | 233 } |
225 | 234 |
226 Transport* TransportController::GetTransport_w( | 235 Transport* TransportController::GetTransport_w( |
227 const std::string& transport_name) { | 236 const std::string& transport_name) { |
228 RTC_DCHECK(worker_thread_->IsCurrent()); | 237 RTC_DCHECK(worker_thread_->IsCurrent()); |
229 | 238 |
230 auto iter = transports_.find(transport_name); | 239 auto iter = transports_.find(transport_name); |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 } | 653 } |
645 if (gathering_state_ != new_gathering_state) { | 654 if (gathering_state_ != new_gathering_state) { |
646 gathering_state_ = new_gathering_state; | 655 gathering_state_ = new_gathering_state; |
647 signaling_thread_->Post( | 656 signaling_thread_->Post( |
648 this, MSG_ICEGATHERINGSTATE, | 657 this, MSG_ICEGATHERINGSTATE, |
649 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); | 658 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); |
650 } | 659 } |
651 } | 660 } |
652 | 661 |
653 } // namespace cricket | 662 } // namespace cricket |
OLD | NEW |