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

Unified Diff: net/socket/client_socket_handle.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/client_socket_handle.h ('k') | net/socket/client_socket_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket_handle.cc
diff --git a/net/socket/client_socket_handle.cc b/net/socket/client_socket_handle.cc
index 8cc0e90cc4bfd6a8e7dab71296b75c2c854aa051..ba30151aa09ff407f91f156c5b31b3d7dca97eb4 100644
--- a/net/socket/client_socket_handle.cc
+++ b/net/socket/client_socket_handle.cc
@@ -17,6 +17,8 @@ namespace net {
ClientSocketHandle::ClientSocketHandle()
: is_initialized_(false),
+ pool_(NULL),
+ layered_pool_(NULL),
is_reused_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(callback_(
base::Bind(&ClientSocketHandle::OnIOComplete,
@@ -52,6 +54,10 @@ void ClientSocketHandle::ResetInternal(bool cancel) {
group_name_.clear();
is_reused_ = false;
user_callback_.Reset();
+ if (layered_pool_) {
+ pool_->RemoveLayeredPool(layered_pool_);
+ layered_pool_ = NULL;
+ }
pool_ = NULL;
idle_time_ = base::TimeDelta();
init_time_ = base::TimeTicks();
@@ -75,6 +81,28 @@ LoadState ClientSocketHandle::GetLoadState() const {
return pool_->GetLoadState(group_name_, this);
}
+bool ClientSocketHandle::IsPoolStalled() const {
+ return pool_->IsStalled();
+}
+
+void ClientSocketHandle::AddLayeredPool(LayeredPool* layered_pool) {
+ CHECK(layered_pool);
+ CHECK(!layered_pool_);
+ if (pool_) {
+ pool_->AddLayeredPool(layered_pool);
+ layered_pool_ = layered_pool;
+ }
+}
+
+void ClientSocketHandle::RemoveLayeredPool(LayeredPool* layered_pool) {
+ CHECK(layered_pool);
+ CHECK(layered_pool_);
+ if (pool_) {
+ pool_->RemoveLayeredPool(layered_pool);
+ layered_pool_ = NULL;
+ }
+}
+
void ClientSocketHandle::OnIOComplete(int result) {
CompletionCallback callback = user_callback_;
user_callback_.Reset();
« no previous file with comments | « net/socket/client_socket_handle.h ('k') | net/socket/client_socket_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698