blob: 4834c9ada70f2eb355d6e045f8e664c8cfc5ae39 [file] [log] [blame]
* Copyright 2019 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 <memory>
#include <string>
#include "api/ice_transport_interface.h"
#include "p2p/base/p2p_transport_channel.h"
#include "rtc_base/thread.h"
namespace webrtc {
// The default ICE transport wraps the implementation of IceTransportInternal
// provided by P2PTransportChannel. This default transport is not thread safe
// and must be constructed, used and destroyed on the same network thread on
// which the internal P2PTransportChannel lives.
class DefaultIceTransport : public IceTransportInterface {
explicit DefaultIceTransport(
std::unique_ptr<cricket::P2PTransportChannel> internal);
cricket::IceTransportInternal* internal() override {
return internal_.get();
const rtc::ThreadChecker thread_checker_{};
std::unique_ptr<cricket::P2PTransportChannel> internal_
class DefaultIceTransportFactory : public IceTransportFactory {
DefaultIceTransportFactory() = default;
~DefaultIceTransportFactory() = default;
// Must be called on the network thread and returns a DefaultIceTransport.
rtc::scoped_refptr<IceTransportInterface> CreateIceTransport(
const std::string& transport_name,
int component,
IceTransportInit init) override;
} // namespace webrtc