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

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

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « net/quic/test_tools/quic_test_utils.cc ('k') | net/socket/ssl_client_socket_openssl.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/metrics/stats_counters.h"
12 #include "base/profiler/scoped_tracker.h" 11 #include "base/profiler/scoped_tracker.h"
13 #include "base/stl_util.h" 12 #include "base/stl_util.h"
14 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
15 #include "base/time/time.h" 14 #include "base/time/time.h"
16 #include "base/values.h" 15 #include "base/values.h"
17 #include "net/base/net_errors.h" 16 #include "net/base/net_errors.h"
18 #include "net/base/net_log.h" 17 #include "net/base/net_log.h"
19 18
20 using base::TimeDelta; 19 using base::TimeDelta;
21 20
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 return; 1236 return;
1238 } 1237 }
1239 1238
1240 if (pending_requests_.empty()) 1239 if (pending_requests_.empty())
1241 return; 1240 return;
1242 1241
1243 scoped_ptr<ConnectJob> backup_job = 1242 scoped_ptr<ConnectJob> backup_job =
1244 pool->connect_job_factory_->NewConnectJob( 1243 pool->connect_job_factory_->NewConnectJob(
1245 group_name, *pending_requests_.FirstMax().value(), pool); 1244 group_name, *pending_requests_.FirstMax().value(), pool);
1246 backup_job->net_log().AddEvent(NetLog::TYPE_BACKUP_CONNECT_JOB_CREATED); 1245 backup_job->net_log().AddEvent(NetLog::TYPE_BACKUP_CONNECT_JOB_CREATED);
1247 SIMPLE_STATS_COUNTER("socket.backup_created");
1248 int rv = backup_job->Connect(); 1246 int rv = backup_job->Connect();
1249 pool->connecting_socket_count_++; 1247 pool->connecting_socket_count_++;
1250 ConnectJob* raw_backup_job = backup_job.get(); 1248 ConnectJob* raw_backup_job = backup_job.get();
1251 AddJob(backup_job.Pass(), false); 1249 AddJob(backup_job.Pass(), false);
1252 if (rv != ERR_IO_PENDING) 1250 if (rv != ERR_IO_PENDING)
1253 pool->OnConnectJobComplete(rv, raw_backup_job); 1251 pool->OnConnectJobComplete(rv, raw_backup_job);
1254 } 1252 }
1255 1253
1256 void ClientSocketPoolBaseHelper::Group::SanityCheck() { 1254 void ClientSocketPoolBaseHelper::Group::SanityCheck() {
1257 DCHECK_LE(unassigned_job_count_, jobs_.size()); 1255 DCHECK_LE(unassigned_job_count_, jobs_.size());
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 pending_requests_.Erase(pointer); 1330 pending_requests_.Erase(pointer);
1333 // If there are no more requests, kill the backup timer. 1331 // If there are no more requests, kill the backup timer.
1334 if (pending_requests_.empty()) 1332 if (pending_requests_.empty())
1335 backup_job_timer_.Stop(); 1333 backup_job_timer_.Stop();
1336 return request.Pass(); 1334 return request.Pass();
1337 } 1335 }
1338 1336
1339 } // namespace internal 1337 } // namespace internal
1340 1338
1341 } // namespace net 1339 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.cc ('k') | net/socket/ssl_client_socket_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698