Chromium Code Reviews

Unified Diff: net/socket/client_socket_pool_base.h

Issue 169643006: Use sockets with unread data if they've never been used before. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rietveld, please behave. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | net/socket/client_socket_pool_base.cc » ('j') | net/socket/client_socket_pool_base.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket_pool_base.h
diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h
index 2c2ddb57abc532e329b2e1a30010a7a0f4e2acec..f73a93bf064aedc1c795335663c2c5160b8904b2 100644
--- a/net/socket/client_socket_pool_base.h
+++ b/net/socket/client_socket_pool_base.h
@@ -338,14 +338,19 @@ class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
struct IdleSocket {
IdleSocket() : socket(NULL) {}
+ // An idle socket can't be reused if it is disconnected or has been used
+ // before and has received data unexpectedly (hence no longer idle). The
+ // unread data would be mistaken for the beginning of the next response if
+ // we were to reuse the socket for a new request.
+ //
+ // Note that a preconnected socket (one that has never been used before)
mmenke 2014/02/25 17:01:53 Suggest rephrasing this to be "Note that a socket
davidben 2014/02/27 16:36:35 Done.
+ // with unread data may be reused. This may be, e.g., a SPDY SETTINGS
+ // frame.
+ bool IsReusable() const;
+
// An idle socket should be removed if it can't be reused, or has been idle
// for too long. |now| is the current time value (TimeTicks::Now()).
// |timeout| is the length of time to wait before timing out an idle socket.
- //
- // An idle socket can't be reused if it is disconnected or has received
- // data unexpectedly (hence no longer idle). The unread data would be
- // mistaken for the beginning of the next response if we were to reuse the
- // socket for a new request.
bool ShouldCleanup(base::TimeTicks now, base::TimeDelta timeout) const;
StreamSocket* socket;
« no previous file with comments | « no previous file | net/socket/client_socket_pool_base.cc » ('j') | net/socket/client_socket_pool_base.cc » ('J')

Powered by Google App Engine