This is part of a larger refactoring: 1) Add new method and provide default implementations for the other Create* methods (this CL) so they can be removed downstream. 2) Implement new method in Chromium and remove the overrides of the other Create* methods from subclasses of PacketSocketFactory. 3) Remove other Create* methods from PacketSocketFactory and make the new Create method pure virtual. Make BasicPacketSocketFactory take user_agent and proxy_info in the constructor. 4) Move the slimmed-down packet_socket_factory into api/. Bug: webrtc:7447 Change-Id: I961fcc4451c9fb2bc7a049b8f57d5894209fd262 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150941 Reviewed-by: Niels Moller <nisse@webrtc.org> Commit-Queue: Patrik Höglund <phoglund@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29026}
51 lines
1.5 KiB
C++
51 lines
1.5 KiB
C++
/*
|
|
* Copyright 2017 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 "p2p/base/packet_socket_factory.h"
|
|
|
|
#include <string>
|
|
|
|
#include "rtc_base/checks.h"
|
|
|
|
namespace rtc {
|
|
|
|
PacketSocketTcpOptions::PacketSocketTcpOptions() = default;
|
|
|
|
PacketSocketTcpOptions::~PacketSocketTcpOptions() = default;
|
|
|
|
AsyncPacketSocket* PacketSocketFactory::CreateClientTcpSocket(
|
|
const SocketAddress& local_address,
|
|
const SocketAddress& remote_address,
|
|
const ProxyInfo& proxy_info,
|
|
const std::string& user_agent,
|
|
const PacketSocketTcpOptions& tcp_options) {
|
|
return CreateClientTcpSocket(local_address, remote_address, proxy_info,
|
|
user_agent, tcp_options.opts);
|
|
}
|
|
|
|
AsyncPacketSocket* PacketSocketFactory::CreateClientTcpSocket(
|
|
const SocketAddress& local_address,
|
|
const SocketAddress& remote_address,
|
|
const ProxyInfo& proxy_info,
|
|
const std::string& user_agent,
|
|
int opts) {
|
|
RTC_NOTREACHED();
|
|
return nullptr;
|
|
}
|
|
|
|
AsyncPacketSocket* PacketSocketFactory::CreateClientTcpSocket(
|
|
const SocketAddress& local_address,
|
|
const SocketAddress& remote_address) {
|
|
RTC_NOTREACHED();
|
|
return nullptr;
|
|
}
|
|
|
|
} // namespace rtc
|