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

Unified Diff: net/socket/client_socket_pool_base.cc

Issue 11464028: Introduce ERR_NETWORK_CHANGED and allow URLFetcher to automatically retry on that error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed nits Created 8 years 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 0880724c94161f8a857829c5c8aac9ec08ed78a3..3e9cd824d7a00765548b1c32bbf6ce2af7a2ab62 100644
--- a/net/socket/client_socket_pool_base.cc
+++ b/net/socket/client_socket_pool_base.cc
@@ -189,7 +189,7 @@ ClientSocketPoolBaseHelper::~ClientSocketPoolBaseHelper() {
// Clean up any idle sockets and pending connect jobs. Assert that we have no
// remaining active sockets or pending requests. They should have all been
// cleaned up prior to |this| being destroyed.
- Flush();
+ FlushWithError(ERR_ABORTED);
DCHECK(group_map_.empty());
DCHECK(pending_callback_map_.empty());
DCHECK_EQ(0, connecting_socket_count_);
@@ -903,14 +903,14 @@ void ClientSocketPoolBaseHelper::OnConnectJobComplete(
}
void ClientSocketPoolBaseHelper::OnIPAddressChanged() {
- Flush();
+ FlushWithError(ERR_NETWORK_CHANGED);
}
-void ClientSocketPoolBaseHelper::Flush() {
+void ClientSocketPoolBaseHelper::FlushWithError(int error) {
pool_generation_number_++;
CancelAllConnectJobs();
CloseIdleSockets();
- AbortAllRequests();
+ CancelAllRequestsWithError(error);
}
bool ClientSocketPoolBaseHelper::IsStalled() const {
@@ -1031,7 +1031,7 @@ void ClientSocketPoolBaseHelper::CancelAllConnectJobs() {
DCHECK_EQ(0, connecting_socket_count_);
}
-void ClientSocketPoolBaseHelper::AbortAllRequests() {
+void ClientSocketPoolBaseHelper::CancelAllRequestsWithError(int error) {
for (GroupMap::iterator i = group_map_.begin(); i != group_map_.end();) {
Group* group = i->second;
@@ -1041,7 +1041,7 @@ void ClientSocketPoolBaseHelper::AbortAllRequests() {
it2 != pending_requests.end(); ++it2) {
scoped_ptr<const Request> request(*it2);
InvokeUserCallbackLater(
- request->handle(), request->callback(), ERR_ABORTED);
+ request->handle(), request->callback(), error);
}
// Delete group if no longer needed.
« 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