OLD | NEW |
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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 | 499 |
500 NetLogTcpClientSocketPoolRequestedSocket(net_log, casted_params); | 500 NetLogTcpClientSocketPoolRequestedSocket(net_log, casted_params); |
501 | 501 |
502 return base_.RequestSocket(group_name, *casted_params, priority, handle, | 502 return base_.RequestSocket(group_name, *casted_params, priority, handle, |
503 callback, net_log); | 503 callback, net_log); |
504 } | 504 } |
505 | 505 |
506 void TransportClientSocketPool::NetLogTcpClientSocketPoolRequestedSocket( | 506 void TransportClientSocketPool::NetLogTcpClientSocketPoolRequestedSocket( |
507 const BoundNetLog& net_log, | 507 const BoundNetLog& net_log, |
508 const scoped_refptr<TransportSocketParams>* casted_params) { | 508 const scoped_refptr<TransportSocketParams>* casted_params) { |
509 if (net_log.GetCaptureMode().enabled()) { | 509 if (net_log.IsCapturing()) { |
510 // TODO(eroman): Split out the host and port parameters. | 510 // TODO(eroman): Split out the host and port parameters. |
511 net_log.AddEvent( | 511 net_log.AddEvent( |
512 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKET, | 512 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKET, |
513 CreateNetLogHostPortPairCallback( | 513 CreateNetLogHostPortPairCallback( |
514 &casted_params->get()->destination().host_port_pair())); | 514 &casted_params->get()->destination().host_port_pair())); |
515 } | 515 } |
516 } | 516 } |
517 | 517 |
518 void TransportClientSocketPool::RequestSockets( | 518 void TransportClientSocketPool::RequestSockets( |
519 const std::string& group_name, | 519 const std::string& group_name, |
520 const void* params, | 520 const void* params, |
521 int num_sockets, | 521 int num_sockets, |
522 const BoundNetLog& net_log) { | 522 const BoundNetLog& net_log) { |
523 const scoped_refptr<TransportSocketParams>* casted_params = | 523 const scoped_refptr<TransportSocketParams>* casted_params = |
524 static_cast<const scoped_refptr<TransportSocketParams>*>(params); | 524 static_cast<const scoped_refptr<TransportSocketParams>*>(params); |
525 | 525 |
526 if (net_log.GetCaptureMode().enabled()) { | 526 if (net_log.IsCapturing()) { |
527 // TODO(eroman): Split out the host and port parameters. | 527 // TODO(eroman): Split out the host and port parameters. |
528 net_log.AddEvent( | 528 net_log.AddEvent( |
529 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKETS, | 529 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKETS, |
530 CreateNetLogHostPortPairCallback( | 530 CreateNetLogHostPortPairCallback( |
531 &casted_params->get()->destination().host_port_pair())); | 531 &casted_params->get()->destination().host_port_pair())); |
532 } | 532 } |
533 | 533 |
534 base_.RequestSockets(group_name, *casted_params, num_sockets, net_log); | 534 base_.RequestSockets(group_name, *casted_params, num_sockets, net_log); |
535 } | 535 } |
536 | 536 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 HigherLayeredPool* higher_pool) { | 588 HigherLayeredPool* higher_pool) { |
589 base_.AddHigherLayeredPool(higher_pool); | 589 base_.AddHigherLayeredPool(higher_pool); |
590 } | 590 } |
591 | 591 |
592 void TransportClientSocketPool::RemoveHigherLayeredPool( | 592 void TransportClientSocketPool::RemoveHigherLayeredPool( |
593 HigherLayeredPool* higher_pool) { | 593 HigherLayeredPool* higher_pool) { |
594 base_.RemoveHigherLayeredPool(higher_pool); | 594 base_.RemoveHigherLayeredPool(higher_pool); |
595 } | 595 } |
596 | 596 |
597 } // namespace net | 597 } // namespace net |
OLD | NEW |