sctp: Move SctpTransportFactory to a separate file
Bug: webrtc:12614 Change-Id: Ifc0e96ed3262e6ca057cd73d736a7ac081493f53 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214481 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Florent Castelli <orphis@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33663}
This commit is contained in:

committed by
Commit Bot

parent
588f9b3705
commit
6b0f19f9ef
@ -421,6 +421,8 @@ rtc_library("rtc_data") {
|
||||
sources = [
|
||||
"sctp/sctp_transport.cc",
|
||||
"sctp/sctp_transport.h",
|
||||
"sctp/sctp_transport_factory.cc",
|
||||
"sctp/sctp_transport_factory.h",
|
||||
"sctp/sctp_transport_internal.h",
|
||||
]
|
||||
} else {
|
||||
|
@ -286,21 +286,6 @@ class SctpTransport : public SctpTransportInternal,
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(SctpTransport);
|
||||
};
|
||||
|
||||
class SctpTransportFactory : public webrtc::SctpTransportFactoryInterface {
|
||||
public:
|
||||
explicit SctpTransportFactory(rtc::Thread* network_thread)
|
||||
: network_thread_(network_thread) {}
|
||||
|
||||
std::unique_ptr<SctpTransportInternal> CreateSctpTransport(
|
||||
rtc::PacketTransportInternal* transport) override {
|
||||
return std::unique_ptr<SctpTransportInternal>(
|
||||
new SctpTransport(network_thread_, transport));
|
||||
}
|
||||
|
||||
private:
|
||||
rtc::Thread* network_thread_;
|
||||
};
|
||||
|
||||
class SctpTransportMap;
|
||||
|
||||
} // namespace cricket
|
||||
|
25
media/sctp/sctp_transport_factory.cc
Normal file
25
media/sctp/sctp_transport_factory.cc
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright 2021 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "media/sctp/sctp_transport_factory.h"
|
||||
|
||||
namespace cricket {
|
||||
|
||||
SctpTransportFactory::SctpTransportFactory(rtc::Thread* network_thread)
|
||||
: network_thread_(network_thread) {}
|
||||
|
||||
std::unique_ptr<SctpTransportInternal>
|
||||
SctpTransportFactory::CreateSctpTransport(
|
||||
rtc::PacketTransportInternal* transport) {
|
||||
return std::unique_ptr<SctpTransportInternal>(
|
||||
new SctpTransport(network_thread_, transport));
|
||||
}
|
||||
|
||||
} // namespace cricket
|
35
media/sctp/sctp_transport_factory.h
Normal file
35
media/sctp/sctp_transport_factory.h
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2021 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef MEDIA_SCTP_SCTP_TRANSPORT_FACTORY_H_
|
||||
#define MEDIA_SCTP_SCTP_TRANSPORT_FACTORY_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "api/transport/sctp_transport_factory_interface.h"
|
||||
#include "media/sctp/sctp_transport.h"
|
||||
#include "rtc_base/thread.h"
|
||||
|
||||
namespace cricket {
|
||||
|
||||
class SctpTransportFactory : public webrtc::SctpTransportFactoryInterface {
|
||||
public:
|
||||
explicit SctpTransportFactory(rtc::Thread* network_thread);
|
||||
|
||||
std::unique_ptr<SctpTransportInternal> CreateSctpTransport(
|
||||
rtc::PacketTransportInternal* transport) override;
|
||||
|
||||
private:
|
||||
rtc::Thread* network_thread_;
|
||||
};
|
||||
|
||||
} // namespace cricket
|
||||
|
||||
#endif // MEDIA_SCTP_SCTP_TRANSPORT_FACTORY_H__
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include "api/transport/field_trial_based_config.h"
|
||||
#include "media/base/rtp_data_engine.h"
|
||||
#include "media/sctp/sctp_transport_factory.h"
|
||||
#include "rtc_base/helpers.h"
|
||||
#include "rtc_base/ref_counted_object.h"
|
||||
#include "rtc_base/task_utils/to_queued_task.h"
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "api/dtls_transport_interface.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/sctp_transport_interface.h"
|
||||
#include "media/sctp/sctp_transport.h"
|
||||
#include "media/sctp/sctp_transport_internal.h"
|
||||
#include "p2p/base/dtls_transport_internal.h"
|
||||
#include "pc/dtls_transport.h"
|
||||
|
Reference in New Issue
Block a user