1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +00:00

AK: Rename RetainPtr => RefPtr and Retained => NonnullRefPtr.

This commit is contained in:
Andreas Kling 2019-06-21 18:37:47 +02:00
parent 77b9fa89dd
commit 90b1354688
188 changed files with 562 additions and 562 deletions

View file

@ -23,7 +23,7 @@ Lockable<HashTable<IPv4Socket*>>& IPv4Socket::all_sockets()
return *s_table;
}
Retained<IPv4Socket> IPv4Socket::create(int type, int protocol)
NonnullRefPtr<IPv4Socket> IPv4Socket::create(int type, int protocol)
{
if (type == SOCK_STREAM)
return TCPSocket::create(protocol);

View file

@ -15,7 +15,7 @@ class TCPSocket;
class IPv4Socket : public Socket {
public:
static Retained<IPv4Socket> create(int type, int protocol);
static NonnullRefPtr<IPv4Socket> create(int type, int protocol);
virtual ~IPv4Socket() override;
static Lockable<HashTable<IPv4Socket*>>& all_sockets();
@ -88,7 +88,7 @@ class IPv4SocketHandle : public SocketHandle {
public:
IPv4SocketHandle() {}
IPv4SocketHandle(RetainPtr<IPv4Socket>&& socket)
IPv4SocketHandle(RefPtr<IPv4Socket>&& socket)
: SocketHandle(move(socket))
{
}

View file

@ -7,7 +7,7 @@
//#define DEBUG_LOCAL_SOCKET
Retained<LocalSocket> LocalSocket::create(int type)
NonnullRefPtr<LocalSocket> LocalSocket::create(int type)
{
return adopt(*new LocalSocket(type));
}

View file

@ -7,7 +7,7 @@ class FileDescription;
class LocalSocket final : public Socket {
public:
static Retained<LocalSocket> create(int type);
static NonnullRefPtr<LocalSocket> create(int type);
virtual ~LocalSocket() override;
virtual KResult bind(const sockaddr*, socklen_t) override;
@ -28,7 +28,7 @@ private:
virtual bool is_local() const override { return true; }
bool has_attached_peer(const FileDescription&) const;
RetainPtr<FileDescription> m_file;
RefPtr<FileDescription> m_file;
bool m_bound { false };
int m_accepted_fds_open { 0 };

View file

@ -209,7 +209,7 @@ void handle_icmp(const EthernetFrameHeader& eth, int frame_size)
{
LOCKER(IPv4Socket::all_sockets().lock());
for (RetainPtr<IPv4Socket> socket : IPv4Socket::all_sockets().resource()) {
for (RefPtr<IPv4Socket> socket : IPv4Socket::all_sockets().resource()) {
LOCKER(socket->lock());
if (socket->protocol() != (unsigned)IPv4Protocol::ICMP)
continue;

View file

@ -6,7 +6,7 @@
#include <Kernel/UnixTypes.h>
#include <LibC/errno_numbers.h>
KResultOr<Retained<Socket>> Socket::create(int domain, int type, int protocol)
KResultOr<NonnullRefPtr<Socket>> Socket::create(int domain, int type, int protocol)
{
(void)protocol;
switch (domain) {
@ -41,7 +41,7 @@ KResult Socket::listen(int backlog)
return KSuccess;
}
RetainPtr<Socket> Socket::accept()
RefPtr<Socket> Socket::accept()
{
LOCKER(m_lock);
if (m_pending.is_empty())

View file

@ -25,7 +25,7 @@ class FileDescription;
class Socket : public File {
public:
static KResultOr<Retained<Socket>> create(int domain, int type, int protocol);
static KResultOr<NonnullRefPtr<Socket>> create(int domain, int type, int protocol);
virtual ~Socket() override;
int domain() const { return m_domain; }
@ -33,7 +33,7 @@ public:
int protocol() const { return m_protocol; }
bool can_accept() const { return !m_pending.is_empty(); }
RetainPtr<Socket> accept();
RefPtr<Socket> accept();
bool is_connected() const { return m_connected; }
KResult listen(int backlog);
@ -89,14 +89,14 @@ private:
timeval m_receive_deadline { 0, 0 };
timeval m_send_deadline { 0, 0 };
Vector<RetainPtr<Socket>> m_pending;
Vector<RefPtr<Socket>> m_pending;
};
class SocketHandle {
public:
SocketHandle() {}
SocketHandle(RetainPtr<Socket>&& socket)
SocketHandle(RefPtr<Socket>&& socket)
: m_socket(move(socket))
{
if (m_socket)
@ -126,5 +126,5 @@ public:
const Socket& socket() const { return *m_socket; }
private:
RetainPtr<Socket> m_socket;
RefPtr<Socket> m_socket;
};

View file

@ -15,7 +15,7 @@ Lockable<HashMap<word, TCPSocket*>>& TCPSocket::sockets_by_port()
TCPSocketHandle TCPSocket::from_port(word port)
{
RetainPtr<TCPSocket> socket;
RefPtr<TCPSocket> socket;
{
LOCKER(sockets_by_port().lock());
auto it = sockets_by_port().resource().find(port);
@ -38,7 +38,7 @@ TCPSocket::~TCPSocket()
sockets_by_port().resource().remove(local_port());
}
Retained<TCPSocket> TCPSocket::create(int protocol)
NonnullRefPtr<TCPSocket> TCPSocket::create(int protocol)
{
return adopt(*new TCPSocket(protocol));
}

View file

@ -4,7 +4,7 @@
class TCPSocket final : public IPv4Socket {
public:
static Retained<TCPSocket> create(int protocol);
static NonnullRefPtr<TCPSocket> create(int protocol);
virtual ~TCPSocket() override;
enum class State {
@ -49,7 +49,7 @@ class TCPSocketHandle : public SocketHandle {
public:
TCPSocketHandle() {}
TCPSocketHandle(RetainPtr<TCPSocket>&& socket)
TCPSocketHandle(RefPtr<TCPSocket>&& socket)
: SocketHandle(move(socket))
{
}

View file

@ -15,7 +15,7 @@ Lockable<HashMap<word, UDPSocket*>>& UDPSocket::sockets_by_port()
UDPSocketHandle UDPSocket::from_port(word port)
{
RetainPtr<UDPSocket> socket;
RefPtr<UDPSocket> socket;
{
LOCKER(sockets_by_port().lock());
auto it = sockets_by_port().resource().find(port);
@ -38,7 +38,7 @@ UDPSocket::~UDPSocket()
sockets_by_port().resource().remove(local_port());
}
Retained<UDPSocket> UDPSocket::create(int protocol)
NonnullRefPtr<UDPSocket> UDPSocket::create(int protocol)
{
return adopt(*new UDPSocket(protocol));
}

View file

@ -6,7 +6,7 @@ class UDPSocketHandle;
class UDPSocket final : public IPv4Socket {
public:
static Retained<UDPSocket> create(int protocol);
static NonnullRefPtr<UDPSocket> create(int protocol);
virtual ~UDPSocket() override;
static UDPSocketHandle from_port(word);
@ -27,7 +27,7 @@ class UDPSocketHandle : public SocketHandle {
public:
UDPSocketHandle() {}
UDPSocketHandle(RetainPtr<UDPSocket>&& socket)
UDPSocketHandle(RefPtr<UDPSocket>&& socket)
: SocketHandle(move(socket))
{
}