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

Unified Diff: net/http/http_proxy_client_socket_pool.cc

Issue 18796003: When an idle socket is added back to a socket pool, check for stalled jobs in lower pools (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Response to comments Created 7 years, 4 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
Index: net/http/http_proxy_client_socket_pool.cc
===================================================================
--- net/http/http_proxy_client_socket_pool.cc (revision 218769)
+++ net/http/http_proxy_client_socket_pool.cc (working copy)
@@ -425,7 +425,7 @@
NetLog* net_log)
: transport_pool_(transport_pool),
ssl_pool_(ssl_pool),
- base_(max_sockets, max_sockets_per_group, histograms,
+ base_(this, max_sockets, max_sockets_per_group, histograms,
ClientSocketPool::unused_idle_socket_timeout(),
ClientSocketPool::used_idle_socket_timeout(),
new HttpProxyConnectJobFactory(transport_pool,
@@ -434,17 +434,12 @@
net_log)) {
// We should always have a |transport_pool_| except in unit tests.
if (transport_pool_)
- transport_pool_->AddLayeredPool(this);
+ base_.AddLowerLayeredPool(transport_pool_);
if (ssl_pool_)
- ssl_pool_->AddLayeredPool(this);
+ base_.AddLowerLayeredPool(ssl_pool_);
}
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(
@@ -485,12 +480,6 @@
base_.FlushWithError(error);
}
-bool HttpProxyClientSocketPool::IsStalled() const {
- return base_.IsStalled() ||
- (transport_pool_ && transport_pool_->IsStalled()) ||
- (ssl_pool_ && ssl_pool_->IsStalled());
-}
-
void HttpProxyClientSocketPool::CloseIdleSockets() {
base_.CloseIdleSockets();
}
@@ -509,14 +498,6 @@
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);
-}
-
base::DictionaryValue* HttpProxyClientSocketPool::GetInfoAsValue(
const std::string& name,
const std::string& type,
@@ -547,10 +528,24 @@
return base_.histograms();
}
+bool HttpProxyClientSocketPool::IsStalled() const {
+ return base_.IsStalled();
+}
+
+void HttpProxyClientSocketPool::AddHigherLayeredPool(
+ HigherLayeredPool* higher_pool) {
+ base_.AddHigherLayeredPool(higher_pool);
+}
+
+void HttpProxyClientSocketPool::RemoveHigherLayeredPool(
+ HigherLayeredPool* higher_pool) {
+ base_.RemoveHigherLayeredPool(higher_pool);
+}
+
bool HttpProxyClientSocketPool::CloseOneIdleConnection() {
if (base_.CloseOneIdleSocket())
return true;
- return base_.CloseOneIdleConnectionInLayeredPool();
+ return base_.CloseOneIdleConnectionInHigherLayeredPool();
}
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698