It does not make sense for DtlsTransport to own ICE, and this arrangement will not work when negotiating datagram or DTLS transport. During negotiation, both a DTLS transport and a datagram transport need to be ready to receive from the same ICE transport, depending on which protocol is chosen by the answerer. Once the answerer chooses a protocol, the transport that is not chosen must be deleted, but ICE must be left intact for use by the remaining transport. Bug: webrtc:9719 Change-Id: Ibab969b574c981e3834ced71f8ff88008cb26a6c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139340 Reviewed-by: Anton Sukhanov <sukhanov@webrtc.org> Reviewed-by: Steve Anton <steveanton@webrtc.org> Commit-Queue: Bjorn Mellem <mellem@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28113}
43 lines
1.4 KiB
C++
43 lines
1.4 KiB
C++
/*
|
|
* Copyright 2018 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 P2P_BASE_TRANSPORT_FACTORY_INTERFACE_H_
|
|
#define P2P_BASE_TRANSPORT_FACTORY_INTERFACE_H_
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "p2p/base/dtls_transport_internal.h"
|
|
#include "p2p/base/ice_transport_internal.h"
|
|
|
|
namespace cricket {
|
|
|
|
// This interface is used to create DTLS/ICE transports. The external transports
|
|
// can be injected into the JsepTransportController through it. For example, the
|
|
// FakeIceTransport/FakeDtlsTransport can be injected by setting a
|
|
// FakeTransportFactory which implements this interface to the
|
|
// JsepTransportController.
|
|
class TransportFactoryInterface {
|
|
public:
|
|
virtual ~TransportFactoryInterface() {}
|
|
|
|
virtual std::unique_ptr<IceTransportInternal> CreateIceTransport(
|
|
const std::string& transport_name,
|
|
int component) = 0;
|
|
|
|
virtual std::unique_ptr<DtlsTransportInternal> CreateDtlsTransport(
|
|
IceTransportInternal* ice,
|
|
const webrtc::CryptoOptions& crypto_options) = 0;
|
|
};
|
|
|
|
} // namespace cricket
|
|
|
|
#endif // P2P_BASE_TRANSPORT_FACTORY_INTERFACE_H_
|