Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Unified Diff: net/socket/socket_libevent.h

Issue 509133002: Raw SocketDescriptor variant of UnixDomainServerSocket::Accept (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix usage of Close(), add a read() to unittest Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/socket/socket_libevent.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/socket_libevent.h
diff --git a/net/socket/socket_libevent.h b/net/socket/socket_libevent.h
index 98eaf92de0c3afd8466e77aaccaedfd404245ecc..59509512bcac6021961267349d6c22580b30f7f0 100644
--- a/net/socket/socket_libevent.h
+++ b/net/socket/socket_libevent.h
@@ -23,7 +23,8 @@ class IPEndPoint;
// Socket class to provide asynchronous read/write operations on top of the
// posix socket api. It supports AF_INET, AF_INET6, and AF_UNIX addresses.
-class SocketLibevent : public base::MessageLoopForIO::Watcher {
+class NET_EXPORT_PRIVATE SocketLibevent
+ : public base::MessageLoopForIO::Watcher {
public:
SocketLibevent();
virtual ~SocketLibevent();
@@ -34,6 +35,8 @@ class SocketLibevent : public base::MessageLoopForIO::Watcher {
// Takes ownership of |socket|.
int AdoptConnectedSocket(SocketDescriptor socket,
const SockaddrStorage& peer_address);
+ // Releases ownership of |socket_fd_| to caller.
+ SocketDescriptor ReleaseConnectedSocket();
int Bind(const SockaddrStorage& address);
@@ -93,6 +96,8 @@ class SocketLibevent : public base::MessageLoopForIO::Watcher {
int DoWrite(IOBuffer* buf, int buf_len);
void WriteCompleted();
+ void StopWatchingAndCleanUp();
+
SocketDescriptor socket_fd_;
base::MessageLoopForIO::FileDescriptorWatcher accept_socket_watcher_;
« no previous file with comments | « no previous file | net/socket/socket_libevent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698