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

Unified Diff: net/socket/socket_posix.h

Issue 2593063003: Add Socket::ReadIfReady() (Closed)
Patch Set: Fix tests for real Created 3 years, 11 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/socket_posix.h
diff --git a/net/socket/socket_posix.h b/net/socket/socket_posix.h
index bf4b7e53d9b055793b3b6f6bb4bece7040268d2c..90f7f39956665527bd4a42cc603cf2cf2db67ef9 100644
--- a/net/socket/socket_posix.h
+++ b/net/socket/socket_posix.h
@@ -59,6 +59,14 @@ class NET_EXPORT_PRIVATE SocketPosix : public base::MessageLoopForIO::Watcher {
// errno, though errno is set if read or write events happen with error.
// TODO(byungchul): Need more robust way to pass system errno.
int Read(IOBuffer* buf, int buf_len, const CompletionCallback& callback);
+
+ // Reads as much data as possible into |buf| without blocking. If read is to
+ // be retried later, |callback| will be invoked when data is ready for
+ // reading.
+ // See socket.h for more information.
+ int ReadIfReady(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback);
int Write(IOBuffer* buf, int buf_len, const CompletionCallback& callback);
// Waits for next write event. This is called by TCPSocketPosix for TCP

Powered by Google App Engine
This is Rietveld 408576698