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

Unified Diff: net/socket/client_socket_handle.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: Update 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
« 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
===================================================================
--- net/socket/client_socket_handle.cc (revision 219027)
+++ net/socket/client_socket_handle.cc (working copy)
@@ -18,7 +18,7 @@
ClientSocketHandle::ClientSocketHandle()
: is_initialized_(false),
pool_(NULL),
- layered_pool_(NULL),
+ higher_pool_(NULL),
is_reused_(false),
callback_(base::Bind(&ClientSocketHandle::OnIOComplete,
base::Unretained(this))),
@@ -53,10 +53,8 @@
group_name_.clear();
is_reused_ = false;
user_callback_.Reset();
- if (layered_pool_) {
- pool_->RemoveLayeredPool(layered_pool_);
- layered_pool_ = NULL;
- }
+ if (higher_pool_)
+ RemoveHigherLayeredPool(higher_pool_);
pool_ = NULL;
idle_time_ = base::TimeDelta();
init_time_ = base::TimeTicks();
@@ -82,24 +80,30 @@
}
bool ClientSocketHandle::IsPoolStalled() const {
+ if (!pool_)
+ return false;
return pool_->IsStalled();
}
-void ClientSocketHandle::AddLayeredPool(LayeredPool* layered_pool) {
- CHECK(layered_pool);
- CHECK(!layered_pool_);
+void ClientSocketHandle::AddHigherLayeredPool(HigherLayeredPool* higher_pool) {
+ CHECK(higher_pool);
+ CHECK(!higher_pool_);
+ // TODO(mmenke): |pool_| should only be NULL in tests. Maybe stop doing that
+ // so this be be made into a DCHECK, and the same can be done in
+ // RemoveHigherLayeredPool?
if (pool_) {
- pool_->AddLayeredPool(layered_pool);
- layered_pool_ = layered_pool;
+ pool_->AddHigherLayeredPool(higher_pool);
+ higher_pool_ = higher_pool;
}
}
-void ClientSocketHandle::RemoveLayeredPool(LayeredPool* layered_pool) {
- CHECK(layered_pool);
- CHECK(layered_pool_);
+void ClientSocketHandle::RemoveHigherLayeredPool(
+ HigherLayeredPool* higher_pool) {
+ CHECK(higher_pool_);
+ CHECK_EQ(higher_pool_, higher_pool);
if (pool_) {
- pool_->RemoveLayeredPool(layered_pool);
- layered_pool_ = NULL;
+ pool_->RemoveHigherLayeredPool(higher_pool);
+ higher_pool_ = NULL;
}
}
« 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