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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 | 474 |
475 NetLogTcpClientSocketPoolRequestedSocket(net_log, casted_params); | 475 NetLogTcpClientSocketPoolRequestedSocket(net_log, casted_params); |
476 | 476 |
477 return base_.RequestSocket(group_name, *casted_params, priority, handle, | 477 return base_.RequestSocket(group_name, *casted_params, priority, handle, |
478 callback, net_log); | 478 callback, net_log); |
479 } | 479 } |
480 | 480 |
481 void TransportClientSocketPool::NetLogTcpClientSocketPoolRequestedSocket( | 481 void TransportClientSocketPool::NetLogTcpClientSocketPoolRequestedSocket( |
482 const BoundNetLog& net_log, | 482 const BoundNetLog& net_log, |
483 const scoped_refptr<TransportSocketParams>* casted_params) { | 483 const scoped_refptr<TransportSocketParams>* casted_params) { |
484 if (net_log.IsLogging()) { | 484 if (net_log.GetCaptureMode().enabled()) { |
485 // TODO(eroman): Split out the host and port parameters. | 485 // TODO(eroman): Split out the host and port parameters. |
486 net_log.AddEvent( | 486 net_log.AddEvent( |
487 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKET, | 487 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKET, |
488 CreateNetLogHostPortPairCallback( | 488 CreateNetLogHostPortPairCallback( |
489 &casted_params->get()->destination().host_port_pair())); | 489 &casted_params->get()->destination().host_port_pair())); |
490 } | 490 } |
491 } | 491 } |
492 | 492 |
493 void TransportClientSocketPool::RequestSockets( | 493 void TransportClientSocketPool::RequestSockets( |
494 const std::string& group_name, | 494 const std::string& group_name, |
495 const void* params, | 495 const void* params, |
496 int num_sockets, | 496 int num_sockets, |
497 const BoundNetLog& net_log) { | 497 const BoundNetLog& net_log) { |
498 const scoped_refptr<TransportSocketParams>* casted_params = | 498 const scoped_refptr<TransportSocketParams>* casted_params = |
499 static_cast<const scoped_refptr<TransportSocketParams>*>(params); | 499 static_cast<const scoped_refptr<TransportSocketParams>*>(params); |
500 | 500 |
501 if (net_log.IsLogging()) { | 501 if (net_log.GetCaptureMode().enabled()) { |
502 // TODO(eroman): Split out the host and port parameters. | 502 // TODO(eroman): Split out the host and port parameters. |
503 net_log.AddEvent( | 503 net_log.AddEvent( |
504 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKETS, | 504 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKETS, |
505 CreateNetLogHostPortPairCallback( | 505 CreateNetLogHostPortPairCallback( |
506 &casted_params->get()->destination().host_port_pair())); | 506 &casted_params->get()->destination().host_port_pair())); |
507 } | 507 } |
508 | 508 |
509 base_.RequestSockets(group_name, *casted_params, num_sockets, net_log); | 509 base_.RequestSockets(group_name, *casted_params, num_sockets, net_log); |
510 } | 510 } |
511 | 511 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 HigherLayeredPool* higher_pool) { | 563 HigherLayeredPool* higher_pool) { |
564 base_.AddHigherLayeredPool(higher_pool); | 564 base_.AddHigherLayeredPool(higher_pool); |
565 } | 565 } |
566 | 566 |
567 void TransportClientSocketPool::RemoveHigherLayeredPool( | 567 void TransportClientSocketPool::RemoveHigherLayeredPool( |
568 HigherLayeredPool* higher_pool) { | 568 HigherLayeredPool* higher_pool) { |
569 base_.RemoveHigherLayeredPool(higher_pool); | 569 base_.RemoveHigherLayeredPool(higher_pool); |
570 } | 570 } |
571 | 571 |
572 } // namespace net | 572 } // namespace net |
OLD | NEW |