OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/socket/client_socket_pool_base.h" | 5 #include "net/socket/client_socket_pool_base.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/metrics/stats_counters.h" | 10 #include "base/metrics/stats_counters.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 group->IsEmpty() && !group->HasBackupJob() && | 334 group->IsEmpty() && !group->HasBackupJob() && |
335 handle) { | 335 handle) { |
336 group->StartBackupSocketTimer(group_name, this); | 336 group->StartBackupSocketTimer(group_name, this); |
337 } | 337 } |
338 | 338 |
339 connecting_socket_count_++; | 339 connecting_socket_count_++; |
340 | 340 |
341 group->AddJob(connect_job.release()); | 341 group->AddJob(connect_job.release()); |
342 } else { | 342 } else { |
343 LogBoundConnectJobToRequest(connect_job->net_log().source(), request); | 343 LogBoundConnectJobToRequest(connect_job->net_log().source(), request); |
344 connect_job->GetAdditionalErrorState(handle); | 344 ClientSocket* error_socket = NULL; |
345 ClientSocket* error_socket = connect_job->ReleaseSocket(); | 345 if (!preconnecting) { |
| 346 DCHECK(handle); |
| 347 connect_job->GetAdditionalErrorState(handle); |
| 348 error_socket = connect_job->ReleaseSocket(); |
| 349 } |
346 if (error_socket) { | 350 if (error_socket) { |
347 HandOutSocket(error_socket, false /* not reused */, handle, | 351 HandOutSocket(error_socket, false /* not reused */, handle, |
348 base::TimeDelta(), group, request->net_log()); | 352 base::TimeDelta(), group, request->net_log()); |
349 } else if (group->IsEmpty()) { | 353 } else if (group->IsEmpty()) { |
350 RemoveGroup(group_name); | 354 RemoveGroup(group_name); |
351 } | 355 } |
352 } | 356 } |
353 | 357 |
354 return rv; | 358 return rv; |
355 } | 359 } |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 // Delete active jobs. | 1077 // Delete active jobs. |
1074 STLDeleteElements(&jobs_); | 1078 STLDeleteElements(&jobs_); |
1075 | 1079 |
1076 // Cancel pending backup job. | 1080 // Cancel pending backup job. |
1077 method_factory_.RevokeAll(); | 1081 method_factory_.RevokeAll(); |
1078 } | 1082 } |
1079 | 1083 |
1080 } // namespace internal | 1084 } // namespace internal |
1081 | 1085 |
1082 } // namespace net | 1086 } // namespace net |
OLD | NEW |