Harald Alvestrand | 9846262 | 2019-01-30 13:57:03 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef API_ICE_TRANSPORT_FACTORY_H_ |
| 12 | #define API_ICE_TRANSPORT_FACTORY_H_ |
| 13 | |
| 14 | #include "api/ice_transport_interface.h" |
| 15 | #include "api/scoped_refptr.h" |
Mirko Bonadei | 66e7679 | 2019-04-02 09:33:59 | [diff] [blame] | 16 | #include "rtc_base/system/rtc_export.h" |
Harald Alvestrand | 9846262 | 2019-01-30 13:57:03 | [diff] [blame] | 17 | |
| 18 | namespace cricket { |
| 19 | class PortAllocator; |
Qingsi Wang | 25ec888 | 2019-11-15 20:33:05 | [diff] [blame] | 20 | } // namespace cricket |
Harald Alvestrand | 9846262 | 2019-01-30 13:57:03 | [diff] [blame] | 21 | |
| 22 | namespace webrtc { |
| 23 | |
| 24 | // Static factory for an IceTransport object that can be created |
| 25 | // without using a webrtc::PeerConnection. |
| 26 | // The returned object must be accessed and destroyed on the thread that |
| 27 | // created it. |
| 28 | // The PortAllocator must outlive the created IceTransportInterface object. |
Steve Anton | 6fdfec1 | 2019-07-01 21:07:33 | [diff] [blame] | 29 | // TODO(steveanton): Remove in favor of the overload that takes |
| 30 | // IceTransportInit. |
Mirko Bonadei | 66e7679 | 2019-04-02 09:33:59 | [diff] [blame] | 31 | RTC_EXPORT rtc::scoped_refptr<IceTransportInterface> CreateIceTransport( |
Harald Alvestrand | 9846262 | 2019-01-30 13:57:03 | [diff] [blame] | 32 | cricket::PortAllocator* port_allocator); |
| 33 | |
Steve Anton | 6fdfec1 | 2019-07-01 21:07:33 | [diff] [blame] | 34 | // Static factory for an IceTransport object that can be created |
| 35 | // without using a webrtc::PeerConnection. |
| 36 | // The returned object must be accessed and destroyed on the thread that |
| 37 | // created it. |
| 38 | // |init.port_allocator()| is required and must outlive the created |
| 39 | // IceTransportInterface object. |
| 40 | // |init.async_resolver_factory()| and |init.event_log()| are optional, but if |
| 41 | // provided must outlive the created IceTransportInterface object. |
| 42 | RTC_EXPORT rtc::scoped_refptr<IceTransportInterface> CreateIceTransport( |
| 43 | IceTransportInit); |
| 44 | |
Harald Alvestrand | 9846262 | 2019-01-30 13:57:03 | [diff] [blame] | 45 | } // namespace webrtc |
| 46 | |
| 47 | #endif // API_ICE_TRANSPORT_FACTORY_H_ |