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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 216 |
213 const rtc::scoped_refptr<rtc::RTCCertificate>& | 217 const rtc::scoped_refptr<rtc::RTCCertificate>& |
214 TransportController::certificate_for_testing() { | 218 TransportController::certificate_for_testing() { |
215 return certificate_; | 219 return certificate_; |
216 } | 220 } |
217 | 221 |
218 Transport* TransportController::CreateTransport_w( | 222 Transport* TransportController::CreateTransport_w( |
219 const std::string& transport_name) { | 223 const std::string& transport_name) { |
220 RTC_DCHECK(worker_thread_->IsCurrent()); | 224 RTC_DCHECK(worker_thread_->IsCurrent()); |
221 | 225 |
| 226 #ifdef HAVE_QUIC |
| 227 if (quic_) { |
| 228 return new QuicTransport(transport_name, port_allocator(), certificate_); |
| 229 } |
| 230 #endif // HAVE_QUIC |
222 Transport* transport = new DtlsTransport<P2PTransport>( | 231 Transport* transport = new DtlsTransport<P2PTransport>( |
223 transport_name, port_allocator(), certificate_); | 232 transport_name, port_allocator(), certificate_); |
224 return transport; | 233 return transport; |
225 } | 234 } |
226 | 235 |
227 Transport* TransportController::GetTransport_w( | 236 Transport* TransportController::GetTransport_w( |
228 const std::string& transport_name) { | 237 const std::string& transport_name) { |
229 RTC_DCHECK(worker_thread_->IsCurrent()); | 238 RTC_DCHECK(worker_thread_->IsCurrent()); |
230 | 239 |
231 auto iter = transports_.find(transport_name); | 240 auto iter = transports_.find(transport_name); |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 } | 654 } |
646 if (gathering_state_ != new_gathering_state) { | 655 if (gathering_state_ != new_gathering_state) { |
647 gathering_state_ = new_gathering_state; | 656 gathering_state_ = new_gathering_state; |
648 signaling_thread_->Post( | 657 signaling_thread_->Post( |
649 this, MSG_ICEGATHERINGSTATE, | 658 this, MSG_ICEGATHERINGSTATE, |
650 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); | 659 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); |
651 } | 660 } |
652 } | 661 } |
653 | 662 |
654 } // namespace cricket | 663 } // namespace cricket |
OLD | NEW |