#include "services/network/tcp_server_socket.h"
#include <optional>
#include <utility>
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/numerics/safe_conversions.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/log/net_log.h"
#include "net/socket/tcp_server_socket.h"
#include "services/network/tcp_connected_socket.h"
namespace network {
TCPServerSocket::TCPServerSocket(
Delegate* delegate,
net::NetLog* net_log,
const net::NetworkTrafficAnnotationTag& traffic_annotation)
: … { … }
TCPServerSocket::TCPServerSocket(
std::unique_ptr<net::ServerSocket> server_socket,
int backlog,
Delegate* delegate,
const net::NetworkTrafficAnnotationTag& traffic_annotation)
: … { … }
TCPServerSocket::~TCPServerSocket() { … }
base::expected<net::IPEndPoint, int32_t> TCPServerSocket::Listen(
const net::IPEndPoint& local_addr,
int backlog,
std::optional<bool> ipv6_only) { … }
void TCPServerSocket::Accept(
mojo::PendingRemote<mojom::SocketObserver> observer,
AcceptCallback callback) { … }
#if BUILDFLAG(IS_CHROMEOS)
void TCPServerSocket::AttachConnectionTracker(
mojo::PendingRemote<mojom::SocketConnectionTracker> connection_tracker) {
connection_tracker_ = std::move(connection_tracker);
}
#endif
void TCPServerSocket::SetSocketForTest(
std::unique_ptr<net::ServerSocket> socket) { … }
TCPServerSocket::PendingAccept::PendingAccept(
AcceptCallback callback,
mojo::PendingRemote<mojom::SocketObserver> observer)
: … { … }
TCPServerSocket::PendingAccept::~PendingAccept() { … }
void TCPServerSocket::OnAcceptCompleted(int result) { … }
void TCPServerSocket::ProcessNextAccept() { … }
}