tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

sctp_transport_factory.cc (1348B)


      1 /*
      2 *  Copyright 2021 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 #include "media/sctp/sctp_transport_factory.h"
     12 
     13 #include <memory>
     14 
     15 #include "api/environment/environment.h"
     16 #include "media/sctp/sctp_transport_internal.h"
     17 #include "p2p/dtls/dtls_transport_internal.h"
     18 #include "rtc_base/system/unused.h"
     19 #include "rtc_base/thread.h"
     20 
     21 #ifdef WEBRTC_HAVE_DCSCTP
     22 #include "media/sctp/dcsctp_transport.h"  // nogncheck
     23 #endif
     24 
     25 namespace webrtc {
     26 
     27 SctpTransportFactory::SctpTransportFactory(Thread* network_thread)
     28    : network_thread_(network_thread) {
     29  RTC_UNUSED(network_thread_);
     30 }
     31 
     32 std::unique_ptr<SctpTransportInternal>
     33 SctpTransportFactory::CreateSctpTransport(const Environment& env,
     34                                          DtlsTransportInternal* transport) {
     35  std::unique_ptr<SctpTransportInternal> result;
     36 #ifdef WEBRTC_HAVE_DCSCTP
     37  result = std::unique_ptr<SctpTransportInternal>(
     38      new DcSctpTransport(env, network_thread_, transport));
     39 #endif
     40  return result;
     41 }
     42 
     43 }  // namespace webrtc