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

Side by Side Diff: net/socket/client_socket_pool_base.cc

Issue 6293005: Fix preconnect crash on synchronous socket error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698