Index: net/socket/socks_client_socket_pool.cc |
diff --git a/net/socket/socks_client_socket_pool.cc b/net/socket/socks_client_socket_pool.cc |
index ae963bfec5bd7afed1df7b61b95114502d94de93..b492be1849bc299742db467eef6548bafa9cfedb 100644 |
--- a/net/socket/socks_client_socket_pool.cc |
+++ b/net/socket/socks_client_socket_pool.cc |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -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 |