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

Unified Diff: net/socket/socket_bio_adapter.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_bio_adapter.h
diff --git a/net/socket/socket_bio_adapter.h b/net/socket/socket_bio_adapter.h
index 235917a0891e94dbd9c0c278ea0ef879455ad2c7..f15c90c0178cb39cd19f62190a9cb8737f80d7de 100644
--- a/net/socket/socket_bio_adapter.h
+++ b/net/socket/socket_bio_adapter.h
@@ -53,12 +53,12 @@ class NET_EXPORT_PRIVATE SocketBIOAdapter {
class Delegate {
public:
// Called when the BIO is ready to handle BIO_read, after having previously
- // been blocked.
- virtual void OnReadReady() = 0;
+ // been blocked. |rv| is an error code if an error occurred or OK.
+ virtual void OnReadReady(int rv) = 0;
// Called when the BIO is ready to handle BIO_write, after having previously
- // been blocked.
- virtual void OnWriteReady() = 0;
+ // been blocked. |rv| is an error code if an error occurred or OK.
+ virtual void OnWriteReady(int rv) = 0;
protected:
virtual ~Delegate() {}
@@ -85,12 +85,13 @@ class NET_EXPORT_PRIVATE SocketBIOAdapter {
int BIORead(char* out, int len);
void HandleSocketReadResult(int result);
void OnSocketReadComplete(int result);
+ void OnSocketReadIfReadyComplete(int result);
int BIOWrite(const char* in, int len);
void SocketWrite();
void HandleSocketWriteResult(int result);
void OnSocketWriteComplete(int result);
- void CallOnReadReady();
+ void CallOnReadReady(int rv);
static SocketBIOAdapter* GetAdapter(BIO* bio);
static int BIOReadWrapper(BIO* bio, char* out, int len);

Powered by Google App Engine
This is Rietveld 408576698