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

Unified Diff: net/socket/unix_domain_server_socket_posix.h

Issue 509133002: Raw SocketDescriptor variant of UnixDomainServerSocket::Accept (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
Index: net/socket/unix_domain_server_socket_posix.h
diff --git a/net/socket/unix_domain_server_socket_posix.h b/net/socket/unix_domain_server_socket_posix.h
index 85c743d2b8fcc6613afba713cec729687c13eb42..8b8dac253e7fbd9e15da163ec214630d625d19db 100644
--- a/net/socket/unix_domain_server_socket_posix.h
+++ b/net/socket/unix_domain_server_socket_posix.h
@@ -59,11 +59,23 @@ class NET_EXPORT UnixDomainServerSocket : public ServerSocket {
virtual int Accept(scoped_ptr<StreamSocket>* socket,
const CompletionCallback& callback) OVERRIDE;
+ // Accept an incoming connection on |listen_socket_|, but pass back
byungchul 2014/08/27 23:35:51 s/Accept/Accepts, s/pass/passes
Chris Masone 2014/08/28 17:53:16 Done.
+ // a raw SocketDescriptor instead of a a StreamSocket.
byungchul 2014/08/27 23:35:51 s/a a/a
Chris Masone 2014/08/28 17:53:16 Done.
+ int AcceptSocketDescriptor(SocketDescriptor* socket_descriptor,
+ const CompletionCallback& callback);
+
private:
- void AcceptCompleted(scoped_ptr<StreamSocket>* socket,
+ // A callback to wrap the setting of the out-parameter to Accept().
+ // This allows the internal machinery of that call to be implemented in
+ // a manner that's agnostic to the caller's desired output.
+ typedef base::Callback<void(scoped_ptr<SocketLibevent>)> SetterCallback;
+
+ int DoAccept(const SetterCallback& setter_callback,
+ const CompletionCallback& callback);
+ void AcceptCompleted(const SetterCallback& setter_callback,
const CompletionCallback& callback,
int rv);
- bool AuthenticateAndGetStreamSocket(scoped_ptr<StreamSocket>* socket);
+ bool AuthenticateAndGetStreamSocket(const SetterCallback& setter_callback);
scoped_ptr<SocketLibevent> listen_socket_;
const AuthCallback auth_callback_;

Powered by Google App Engine
This is Rietveld 408576698