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

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: mmenke comments Created 6 years, 9 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
« no previous file with comments | « no previous file | net/socket/client_socket_pool_base.cc » ('j') | no next file with comments »
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 8a0a1f3c102512a6945aecd0dc160921262d0274..8079cd4e5c74a80b5f7c1e802c7c009a4557829d 100644
--- a/net/socket/client_socket_pool_base.h
+++ b/net/socket/client_socket_pool_base.h
@@ -339,14 +339,19 @@ class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
struct IdleSocket {
IdleSocket() : socket(NULL) {}
+ // An idle socket can't be used 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 use the socket for a new request.
+ //
+ // Note that a socket that has never been used before (like a preconnected
+ // socket) may be used even with unread data. This may be, e.g., a SPDY
+ // SETTINGS frame.
+ bool IsUsable() 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698