diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-02 16:09:01 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-02 16:09:01 +0000 |
commit | 0f873e8291deea212112dc7d6b48b0f0450522c2 (patch) | |
tree | d888b57c8ff0e55d322e450d9df2d1f5eb36d283 /jingle/notifier/base | |
parent | eb7ce94497639ec1e9a7a1549dc941d8e28e98ba (diff) | |
download | chromium_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 'jingle/notifier/base')
-rw-r--r-- | jingle/notifier/base/fake_ssl_client_socket.cc | 4 | ||||
-rw-r--r-- | jingle/notifier/base/fake_ssl_client_socket.h | 1 | ||||
-rw-r--r-- | jingle/notifier/base/fake_ssl_client_socket_unittest.cc | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/jingle/notifier/base/fake_ssl_client_socket.cc b/jingle/notifier/base/fake_ssl_client_socket.cc index a89a594..cd5d5f5 100644 --- a/jingle/notifier/base/fake_ssl_client_socket.cc +++ b/jingle/notifier/base/fake_ssl_client_socket.cc @@ -324,4 +324,8 @@ void FakeSSLClientSocket::SetOmniboxSpeculation() { transport_socket_->SetOmniboxSpeculation(); } +bool FakeSSLClientSocket::WasEverUsed() const { + return transport_socket_->WasEverUsed(); +} + } // namespace notifier diff --git a/jingle/notifier/base/fake_ssl_client_socket.h b/jingle/notifier/base/fake_ssl_client_socket.h index bcf09f8..d70d4d3 100644 --- a/jingle/notifier/base/fake_ssl_client_socket.h +++ b/jingle/notifier/base/fake_ssl_client_socket.h @@ -59,6 +59,7 @@ class FakeSSLClientSocket : public net::ClientSocket { virtual const net::BoundNetLog& NetLog() const; virtual void SetSubresourceSpeculation(); virtual void SetOmniboxSpeculation(); + virtual bool WasEverUsed() const; private: enum HandshakeState { diff --git a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc index 2ca3adf..3b7aa50 100644 --- a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc +++ b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc @@ -59,6 +59,7 @@ class MockClientSocket : public net::ClientSocket { MOCK_CONST_METHOD0(NetLog, const net::BoundNetLog&()); MOCK_METHOD0(SetSubresourceSpeculation, void()); MOCK_METHOD0(SetOmniboxSpeculation, void()); + MOCK_CONST_METHOD0(WasEverUsed, bool()); }; // Break up |data| into a bunch of chunked MockReads/Writes and push @@ -336,4 +337,3 @@ TEST_F(FakeSSLClientSocketTest, MalformedServerHello) { } // namespace } // namespace notifier - |