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

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

Issue 10546162: NetLogEventParameter to Callback refactoring 9. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove comment Created 8 years, 6 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 | « net/socket/tcp_server_socket_win.cc ('k') | no next file » | 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/transport_client_socket_pool.h" 5 #include "net/socket/transport_client_socket_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "base/time.h" 14 #include "base/time.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "net/base/ip_endpoint.h" 16 #include "net/base/ip_endpoint.h"
17 #include "net/base/net_log.h" 17 #include "net/base/net_log.h"
18 #include "net/base/net_errors.h" 18 #include "net/base/net_errors.h"
19 #include "net/socket/client_socket_factory.h" 19 #include "net/socket/client_socket_factory.h"
20 #include "net/socket/client_socket_handle.h" 20 #include "net/socket/client_socket_handle.h"
21 #include "net/socket/client_socket_pool_base.h" 21 #include "net/socket/client_socket_pool_base.h"
22 #include "net/socket/socket_net_log_params.h"
22 #include "net/socket/tcp_client_socket.h" 23 #include "net/socket/tcp_client_socket.h"
23 24
24 using base::TimeDelta; 25 using base::TimeDelta;
25 26
26 namespace net { 27 namespace net {
27 28
28 // TODO(willchan): Base this off RTT instead of statically setting it. Note we 29 // TODO(willchan): Base this off RTT instead of statically setting it. Note we
29 // choose a timeout that is different from the backup connect job timer so they 30 // choose a timeout that is different from the backup connect job timer so they
30 // don't synchronize. 31 // don't synchronize.
31 const int TransportConnectJob::kIPv6FallbackTimerInMs = 300; 32 const int TransportConnectJob::kIPv6FallbackTimerInMs = 300;
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 ClientSocketHandle* handle, 372 ClientSocketHandle* handle,
372 const CompletionCallback& callback, 373 const CompletionCallback& callback,
373 const BoundNetLog& net_log) { 374 const BoundNetLog& net_log) {
374 const scoped_refptr<TransportSocketParams>* casted_params = 375 const scoped_refptr<TransportSocketParams>* casted_params =
375 static_cast<const scoped_refptr<TransportSocketParams>*>(params); 376 static_cast<const scoped_refptr<TransportSocketParams>*>(params);
376 377
377 if (net_log.IsLoggingAllEvents()) { 378 if (net_log.IsLoggingAllEvents()) {
378 // TODO(eroman): Split out the host and port parameters. 379 // TODO(eroman): Split out the host and port parameters.
379 net_log.AddEvent( 380 net_log.AddEvent(
380 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKET, 381 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKET,
381 make_scoped_refptr(new NetLogStringParameter( 382 CreateNetLogHostPortPairCallback(
382 "host_and_port", 383 &casted_params->get()->destination().host_port_pair()));
383 casted_params->get()->destination().host_port_pair().ToString())));
384 } 384 }
385 385
386 return base_.RequestSocket(group_name, *casted_params, priority, handle, 386 return base_.RequestSocket(group_name, *casted_params, priority, handle,
387 callback, net_log); 387 callback, net_log);
388 } 388 }
389 389
390 void TransportClientSocketPool::RequestSockets( 390 void TransportClientSocketPool::RequestSockets(
391 const std::string& group_name, 391 const std::string& group_name,
392 const void* params, 392 const void* params,
393 int num_sockets, 393 int num_sockets,
394 const BoundNetLog& net_log) { 394 const BoundNetLog& net_log) {
395 const scoped_refptr<TransportSocketParams>* casted_params = 395 const scoped_refptr<TransportSocketParams>* casted_params =
396 static_cast<const scoped_refptr<TransportSocketParams>*>(params); 396 static_cast<const scoped_refptr<TransportSocketParams>*>(params);
397 397
398 if (net_log.IsLoggingAllEvents()) { 398 if (net_log.IsLoggingAllEvents()) {
399 // TODO(eroman): Split out the host and port parameters. 399 // TODO(eroman): Split out the host and port parameters.
400 net_log.AddEvent( 400 net_log.AddEvent(
401 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKETS, 401 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKETS,
402 make_scoped_refptr(new NetLogStringParameter( 402 CreateNetLogHostPortPairCallback(
403 "host_and_port", 403 &casted_params->get()->destination().host_port_pair()));
404 casted_params->get()->destination().host_port_pair().ToString())));
405 } 404 }
406 405
407 base_.RequestSockets(group_name, *casted_params, num_sockets, net_log); 406 base_.RequestSockets(group_name, *casted_params, num_sockets, net_log);
408 } 407 }
409 408
410 void TransportClientSocketPool::CancelRequest( 409 void TransportClientSocketPool::CancelRequest(
411 const std::string& group_name, 410 const std::string& group_name,
412 ClientSocketHandle* handle) { 411 ClientSocketHandle* handle) {
413 base_.CancelRequest(group_name, handle); 412 base_.CancelRequest(group_name, handle);
414 } 413 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 462
464 base::TimeDelta TransportClientSocketPool::ConnectionTimeout() const { 463 base::TimeDelta TransportClientSocketPool::ConnectionTimeout() const {
465 return base_.ConnectionTimeout(); 464 return base_.ConnectionTimeout();
466 } 465 }
467 466
468 ClientSocketPoolHistograms* TransportClientSocketPool::histograms() const { 467 ClientSocketPoolHistograms* TransportClientSocketPool::histograms() const {
469 return base_.histograms(); 468 return base_.histograms();
470 } 469 }
471 470
472 } // namespace net 471 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/tcp_server_socket_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698