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

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: Tweak SpdySession::IsReused (erf, got mixed in with a rebase) 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
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..390348a184e9621ef9612e32ee97a508529f9a39 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 socket that has never been used before (like a preconnected
+ // socket) with unread data may be reused. This may be, e.g., a SPDY
+ // SETTINGS frame.
+ bool IsReusable() const;
mmenke 2014/03/18 15:16:55 I think "IsUsable" may be more accurate, since it'
davidben 2014/03/25 19:50:18 Done.
+
// 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_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698