summaryrefslogtreecommitdiffstats
path: root/net/socket/socks_client_socket_pool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/socket/socks_client_socket_pool.cc')
-rw-r--r--net/socket/socks_client_socket_pool.cc27
1 files changed, 26 insertions, 1 deletions
diff --git a/net/socket/socks_client_socket_pool.cc b/net/socket/socks_client_socket_pool.cc
index ae963bf..a7c7ecb 100644
--- a/net/socket/socks_client_socket_pool.cc
+++ b/net/socket/socks_client_socket_pool.cc
@@ -199,9 +199,16 @@ SOCKSClientSocketPool::SOCKSClientSocketPool(
new SOCKSConnectJobFactory(transport_pool,
host_resolver,
net_log)) {
+ // We should always have a |transport_pool_| except in unit tests.
+ if (transport_pool_)
+ transport_pool_->AddLayeredPool(this);
}
-SOCKSClientSocketPool::~SOCKSClientSocketPool() {}
+SOCKSClientSocketPool::~SOCKSClientSocketPool() {
+ // We should always have a |transport_pool_| except in unit tests.
+ if (transport_pool_)
+ transport_pool_->RemoveLayeredPool(this);
+}
int SOCKSClientSocketPool::RequestSocket(
const std::string& group_name, const void* socket_params,
@@ -239,6 +246,10 @@ void SOCKSClientSocketPool::Flush() {
base_.Flush();
}
+bool SOCKSClientSocketPool::IsStalled() const {
+ return base_.IsStalled() || transport_pool_->IsStalled();
+}
+
void SOCKSClientSocketPool::CloseIdleSockets() {
base_.CloseIdleSockets();
}
@@ -257,6 +268,14 @@ LoadState SOCKSClientSocketPool::GetLoadState(
return base_.GetLoadState(group_name, handle);
}
+void SOCKSClientSocketPool::AddLayeredPool(LayeredPool* layered_pool) {
+ base_.AddLayeredPool(layered_pool);
+}
+
+void SOCKSClientSocketPool::RemoveLayeredPool(LayeredPool* layered_pool) {
+ base_.RemoveLayeredPool(layered_pool);
+}
+
DictionaryValue* SOCKSClientSocketPool::GetInfoAsValue(
const std::string& name,
const std::string& type,
@@ -280,4 +299,10 @@ ClientSocketPoolHistograms* SOCKSClientSocketPool::histograms() const {
return base_.histograms();
};
+bool SOCKSClientSocketPool::CloseOneIdleConnection() {
+ if (base_.CloseOneIdleSocket())
+ return true;
+ return base_.CloseOneIdleConnectionInLayeredPool();
+}
+
} // namespace net