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

Unified Diff: net/socket/tcp_socket_posix.h

Issue 2593063003: Add Socket::ReadIfReady() (Closed)
Patch Set: Fix perf tests (removed invalid CHECKs) Created 3 years, 10 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/tcp_socket_posix.h
diff --git a/net/socket/tcp_socket_posix.h b/net/socket/tcp_socket_posix.h
index fda90fcfd95644b052dbc6ce40f391172c57d330..a01b2b9756d9194b2adb5456265e495086cf3722 100644
--- a/net/socket/tcp_socket_posix.h
+++ b/net/socket/tcp_socket_posix.h
@@ -60,6 +60,9 @@ class NET_EXPORT TCPSocketPosix {
// Multiple outstanding requests are not supported.
// Full duplex mode (reading and writing at the same time) is supported.
int Read(IOBuffer* buf, int buf_len, const CompletionCallback& callback);
+ int ReadIfReady(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback);
int Write(IOBuffer* buf, int buf_len, const CompletionCallback& callback);
int GetLocalAddress(IPEndPoint* address) const;
@@ -200,7 +203,9 @@ class NET_EXPORT TCPSocketPosix {
void ReadCompleted(const scoped_refptr<IOBuffer>& buf,
const CompletionCallback& callback,
int rv);
+ void ReadIfReadyCompleted(const CompletionCallback& callback, int rv);
int HandleReadCompleted(IOBuffer* buf, int rv);
+ void HandleReadCompletedHelper(int rv);
void WriteCompleted(const scoped_refptr<IOBuffer>& buf,
const CompletionCallback& callback,

Powered by Google App Engine
This is Rietveld 408576698