xref: /aosp_15_r20/external/webrtc/net/dcsctp/public/dcsctp_socket_factory.cc (revision d9f758449e529ab9291ac668be2861e7a55c2422)
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 "net/dcsctp/public/dcsctp_socket_factory.h"
12 
13 #include <memory>
14 #include <utility>
15 
16 #include "absl/strings/string_view.h"
17 #include "net/dcsctp/public/dcsctp_options.h"
18 #include "net/dcsctp/public/dcsctp_socket.h"
19 #include "net/dcsctp/public/packet_observer.h"
20 #include "net/dcsctp/socket/dcsctp_socket.h"
21 
22 namespace dcsctp {
23 
24 DcSctpSocketFactory::~DcSctpSocketFactory() = default;
25 
Create(absl::string_view log_prefix,DcSctpSocketCallbacks & callbacks,std::unique_ptr<PacketObserver> packet_observer,const DcSctpOptions & options)26 std::unique_ptr<DcSctpSocketInterface> DcSctpSocketFactory::Create(
27     absl::string_view log_prefix,
28     DcSctpSocketCallbacks& callbacks,
29     std::unique_ptr<PacketObserver> packet_observer,
30     const DcSctpOptions& options) {
31   return std::make_unique<DcSctpSocket>(log_prefix, callbacks,
32                                         std::move(packet_observer), options);
33 }
34 }  // namespace dcsctp
35