diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-21 21:30:50 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-21 21:33:09 +0000 |
commit | cffd7f9052e03bc914679322d2ffea8559029e33 (patch) | |
tree | 8797994f9404299be35895b62570bc43dead4988 /net/socket/socket_test_util.cc | |
parent | be21aaa41c7ecf6e84cabde42bc9688acaa1b93b (diff) | |
download | chromium_src-cffd7f9052e03bc914679322d2ffea8559029e33.zip chromium_src-cffd7f9052e03bc914679322d2ffea8559029e33.tar.gz chromium_src-cffd7f9052e03bc914679322d2ffea8559029e33.tar.bz2 |
Change the lifespan of SSlConnectJobMessengers so that they are created
only when needed, and deleted as soon as they are no longer necessary.
Add methods to SSLClientSocketPool that are passed to the SSLConnectJob
and SSLConnectJobMessenger as callbacks. These allow the SSLConnectJob
to tell the SSLClientSocketPool to create a messenger for the job when
appropriate, and the SSLConnectJobMessenger to tell the
SSLCLientSocketPool to remove a messenger when appropriate. An
SSLConnectJob will now only create an SSLConnectJobMessenger if its
socket's session is not already in the session cache. The messenger
will then ask to be removed when there are no remaining pending or
connecting sockets in the messenger.
Written by Mackenzie Shelley <mshelley@chromium.org>
Original review URL: https://codereview.chromium.org/384873002/
R=rsleevi@chromium.org
TBR=mek@chromium.org
BUG=398967
Review URL: https://codereview.chromium.org/476313004
Cr-Commit-Position: refs/heads/master@{#291192}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291192 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/socket_test_util.cc')
-rw-r--r-- | net/socket/socket_test_util.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc index 3498c13..b847a299 100644 --- a/net/socket/socket_test_util.cc +++ b/net/socket/socket_test_util.cc @@ -764,6 +764,11 @@ const BoundNetLog& MockClientSocket::NetLog() const { return net_log_; } +std::string MockClientSocket::GetSessionCacheKey() const { + NOTIMPLEMENTED(); + return std::string(); +} + bool MockClientSocket::InSessionCache() const { NOTIMPLEMENTED(); return false; @@ -1322,6 +1327,7 @@ MockSSLClientSocket::MockSSLClientSocket( // tests. transport_socket->socket()->NetLog()), transport_(transport_socket.Pass()), + host_port_pair_(host_port_pair), data_(data), is_npn_state_set_(false), new_npn_value_(false), @@ -1389,6 +1395,12 @@ bool MockSSLClientSocket::GetSSLInfo(SSLInfo* ssl_info) { return true; } +std::string MockSSLClientSocket::GetSessionCacheKey() const { + // For the purposes of these tests, |host_and_port| will serve as the + // cache key. + return host_port_pair_.ToString(); +} + bool MockSSLClientSocket::InSessionCache() const { return data_->is_in_session_cache; } |