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

Unified Diff: net/socket/client_socket_handle.cc

Issue 8340012: Close idle connections / SPDY sessions when needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OVERRIDE Created 9 years, 2 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/socket/client_socket_handle.cc
diff --git a/net/socket/client_socket_handle.cc b/net/socket/client_socket_handle.cc
index 8309c3f4d58af3733a3b2cea6ea78277ee2c6d9e..41bd7315ebf1c31715ccec3a3f5a1cf3f93f898a 100644
--- a/net/socket/client_socket_handle.cc
+++ b/net/socket/client_socket_handle.cc
@@ -15,6 +15,8 @@ namespace net {
ClientSocketHandle::ClientSocketHandle()
: is_initialized_(false),
+ pool_(NULL),
+ layered_pool_(NULL),
is_reused_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(
callback_(this, &ClientSocketHandle::OnIOComplete)),
@@ -49,6 +51,10 @@ void ClientSocketHandle::ResetInternal(bool cancel) {
group_name_.clear();
is_reused_ = false;
user_callback_ = NULL;
+ if (layered_pool_) {
+ pool_->RemoveLayeredPool(layered_pool_);
+ layered_pool_ = NULL;
+ }
pool_ = NULL;
idle_time_ = base::TimeDelta();
init_time_ = base::TimeTicks();
@@ -72,6 +78,15 @@ LoadState ClientSocketHandle::GetLoadState() const {
return pool_->GetLoadState(group_name_, this);
}
+bool ClientSocketHandle::IsPoolStalled() const {
+ return pool_->IsStalled();
+}
+
+void ClientSocketHandle::AddLayeredPool(LayeredPool* layered_pool) {
mmenke 2011/10/27 18:52:37 DCHECK(!layered_pool), maybe?
+ pool_->AddLayeredPool(layered_pool);
+ layered_pool_ = layered_pool;
+}
+
void ClientSocketHandle::OnIOComplete(int result) {
OldCompletionCallback* callback = user_callback_;
user_callback_ = NULL;

Powered by Google App Engine
This is Rietveld 408576698