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

Unified Diff: net/http/http_proxy_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/http/http_proxy_client_socket_pool.h ('k') | net/socket/client_socket_handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_proxy_client_socket_pool.cc
diff --git a/net/http/http_proxy_client_socket_pool.cc b/net/http/http_proxy_client_socket_pool.cc
index 6b53e62f68e2c358343460e12fe21db0ebdf6827..67018779f3405c5c9b61109b6a21776a8f712fa7 100644
--- a/net/http/http_proxy_client_socket_pool.cc
+++ b/net/http/http_proxy_client_socket_pool.cc
@@ -397,9 +397,21 @@ HttpProxyClientSocketPool::HttpProxyClientSocketPool(
new HttpProxyConnectJobFactory(transport_pool,
ssl_pool,
host_resolver,
- net_log)) {}
+ net_log)) {
+ // We should always have a |transport_pool_| except in unit tests.
+ if (transport_pool_)
+ transport_pool_->AddLayeredPool(this);
+ if (ssl_pool_)
+ ssl_pool_->AddLayeredPool(this);
+}
-HttpProxyClientSocketPool::~HttpProxyClientSocketPool() {}
+HttpProxyClientSocketPool::~HttpProxyClientSocketPool() {
+ if (ssl_pool_)
+ ssl_pool_->RemoveLayeredPool(this);
+ // We should always have a |transport_pool_| except in unit tests.
+ if (transport_pool_)
+ transport_pool_->RemoveLayeredPool(this);
+}
int HttpProxyClientSocketPool::RequestSocket(
const std::string& group_name, const void* socket_params,
@@ -438,6 +450,12 @@ void HttpProxyClientSocketPool::Flush() {
base_.Flush();
}
+bool HttpProxyClientSocketPool::IsStalled() const {
+ return base_.IsStalled() ||
+ (transport_pool_ && transport_pool_->IsStalled()) ||
+ (ssl_pool_ && ssl_pool_->IsStalled());
+}
+
void HttpProxyClientSocketPool::CloseIdleSockets() {
base_.CloseIdleSockets();
}
@@ -456,6 +474,14 @@ LoadState HttpProxyClientSocketPool::GetLoadState(
return base_.GetLoadState(group_name, handle);
}
+void HttpProxyClientSocketPool::AddLayeredPool(LayeredPool* layered_pool) {
+ base_.AddLayeredPool(layered_pool);
+}
+
+void HttpProxyClientSocketPool::RemoveLayeredPool(LayeredPool* layered_pool) {
+ base_.RemoveLayeredPool(layered_pool);
+}
+
DictionaryValue* HttpProxyClientSocketPool::GetInfoAsValue(
const std::string& name,
const std::string& type,
@@ -486,4 +512,10 @@ ClientSocketPoolHistograms* HttpProxyClientSocketPool::histograms() const {
return base_.histograms();
}
+bool HttpProxyClientSocketPool::CloseOneIdleConnection() {
+ if (base_.CloseOneIdleSocket())
+ return true;
+ return base_.CloseOneIdleConnectionInLayeredPool();
+}
+
} // namespace net
« no previous file with comments | « net/http/http_proxy_client_socket_pool.h ('k') | net/socket/client_socket_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698