diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 21:27:22 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 21:27:22 +0000 |
commit | e1b54dce4ee550b5a301be380a7c4188c7a62f3f (patch) | |
tree | 1b4cbe0ffeeb133ec301fa846310eecfc872323c /net/socket/client_socket_pool_base.h | |
parent | 6450c6e0b529029790ca3ae00aeae89f4340ff51 (diff) | |
download | chromium_src-e1b54dce4ee550b5a301be380a7c4188c7a62f3f.zip chromium_src-e1b54dce4ee550b5a301be380a7c4188c7a62f3f.tar.gz chromium_src-e1b54dce4ee550b5a301be380a7c4188c7a62f3f.tar.bz2 |
Prefer used idle sockets over unused idle sockets.
* Pick used idle sockets LIFO.
* In absence of used idle sockets, pick unused idle sockets FIFO.
BUG=57491
TEST=ClientSocketPoolBaseTest.PreferUsedSocketToUnusedSocket
Review URL: http://codereview.chromium.org/3539013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61710 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_pool_base.h')
-rw-r--r-- | net/socket/client_socket_pool_base.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h index 77eed2f..a39eeaa 100644 --- a/net/socket/client_socket_pool_base.h +++ b/net/socket/client_socket_pool_base.h @@ -24,6 +24,7 @@ #pragma once #include <deque> +#include <list> #include <map> #include <set> #include <string> @@ -323,14 +324,14 @@ class ClientSocketPoolBaseHelper void DecrementActiveSocketCount() { active_socket_count_--; } const std::set<const ConnectJob*>& jobs() const { return jobs_; } - const std::deque<IdleSocket>& idle_sockets() const { return idle_sockets_; } + const std::list<IdleSocket>& idle_sockets() const { return idle_sockets_; } const RequestQueue& pending_requests() const { return pending_requests_; } int active_socket_count() const { return active_socket_count_; } RequestQueue* mutable_pending_requests() { return &pending_requests_; } - std::deque<IdleSocket>* mutable_idle_sockets() { return &idle_sockets_; } + std::list<IdleSocket>* mutable_idle_sockets() { return &idle_sockets_; } private: - std::deque<IdleSocket> idle_sockets_; + std::list<IdleSocket> idle_sockets_; std::set<const ConnectJob*> jobs_; RequestQueue pending_requests_; int active_socket_count_; // number of active sockets used by clients |