Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: net/socket/socks_client_socket_pool.cc

Issue 10026024: Attempting to re-land a small portion of this change... Simply add links from (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix willchan's nit Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/socks_client_socket_pool.h ('k') | net/socket/ssl_client_socket_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a7c7ecbe9b89fefcbbefdf332af979fad3503389 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
« no previous file with comments | « net/socket/socks_client_socket_pool.h ('k') | net/socket/ssl_client_socket_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698