summaryrefslogtreecommitdiffstats
path: root/net/socket/client_socket.cc
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-02 16:09:01 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-02 16:09:01 +0000
commit0f873e8291deea212112dc7d6b48b0f0450522c2 (patch)
treed888b57c8ff0e55d322e450d9df2d1f5eb36d283 /net/socket/client_socket.cc
parenteb7ce94497639ec1e9a7a1549dc941d8e28e98ba (diff)
downloadchromium_src-0f873e8291deea212112dc7d6b48b0f0450522c2.zip
chromium_src-0f873e8291deea212112dc7d6b48b0f0450522c2.tar.gz
chromium_src-0f873e8291deea212112dc7d6b48b0f0450522c2.tar.bz2
Fix ClientSocketHandle reuse_type(). Correctly track socket use.
In particular, we used to consider that a socket had been used whenever it got returned to the ClientSocketPool. But, with preconnect, that is no longer true. Luckily, we now have UseHistory in the transport sockets. So, I create a WasEverUsed() method in ClientSocket, plumb this into all sockets, and use that in ClientSocketPoolBaseHelper instead of tracking whether or not the socket had been returned to the client or not. This ultimately will have two implications. We will record the correct values in Net.HttpSocketType histograms and we will use the correct timeout for preconnect sockets in ClientSocketPoolBaseHelper::CleanupIdleSockets(). BUG=none TEST=none Review URL: http://codereview.chromium.org/3353004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket.cc')
-rw-r--r--net/socket/client_socket.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/socket/client_socket.cc b/net/socket/client_socket.cc
index aba0366..0edee70 100644
--- a/net/socket/client_socket.cc
+++ b/net/socket/client_socket.cc
@@ -93,5 +93,9 @@ void ClientSocket::UseHistory::set_omnibox_speculation() {
omnibox_speculation_ = true;
}
-} // namespace net
+bool ClientSocket::UseHistory::was_used_to_convey_data() const {
+ DCHECK(!was_used_to_convey_data_ || was_ever_connected_);
+ return was_used_to_convey_data_;
+}
+} // namespace net