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

Unified Diff: net/socket/client_socket_pool_base.cc

Issue 2104013: Revert r47395. Looks like it still crashes =/ (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 7 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_pool_base.h ('k') | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket_pool_base.cc
diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc
index b008c54378c3d8f2b1db98bdc602439c92fd1483..99011bed65aa8e7b70ce60879d7f7ee8ea7c5ab0 100644
--- a/net/socket/client_socket_pool_base.cc
+++ b/net/socket/client_socket_pool_base.cc
@@ -112,7 +112,8 @@ ClientSocketPoolBaseHelper::ClientSocketPoolBaseHelper(
int max_sockets_per_group,
base::TimeDelta unused_idle_socket_timeout,
base::TimeDelta used_idle_socket_timeout,
- ConnectJobFactory* connect_job_factory)
+ ConnectJobFactory* connect_job_factory,
+ NetworkChangeNotifier* network_change_notifier)
: idle_socket_count_(0),
connecting_socket_count_(0),
handed_out_socket_count_(0),
@@ -123,10 +124,14 @@ ClientSocketPoolBaseHelper::ClientSocketPoolBaseHelper(
used_idle_socket_timeout_(used_idle_socket_timeout),
may_have_stalled_group_(false),
connect_job_factory_(connect_job_factory),
+ network_change_notifier_(network_change_notifier),
backup_jobs_enabled_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {
DCHECK_LE(0, max_sockets_per_group);
DCHECK_LE(max_sockets_per_group, max_sockets);
+
+ if (network_change_notifier_)
+ network_change_notifier_->AddObserver(this);
}
ClientSocketPoolBaseHelper::~ClientSocketPoolBaseHelper() {
@@ -138,6 +143,9 @@ ClientSocketPoolBaseHelper::~ClientSocketPoolBaseHelper() {
CloseIdleSockets();
CHECK(group_map_.empty());
DCHECK_EQ(0, connecting_socket_count_);
+
+ if (network_change_notifier_)
+ network_change_notifier_->RemoveObserver(this);
}
// InsertRequestIntoQueue inserts the request into the queue based on
@@ -602,6 +610,10 @@ void ClientSocketPoolBaseHelper::OnConnectJobComplete(
}
}
+void ClientSocketPoolBaseHelper::OnIPAddressChanged() {
+ CloseIdleSockets();
+}
+
void ClientSocketPoolBaseHelper::RemoveConnectJob(const ConnectJob *job,
Group* group) {
CHECK_GT(connecting_socket_count_, 0);
« no previous file with comments | « net/socket/client_socket_pool_base.h ('k') | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698