| 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 return base::TimeDelta::FromSeconds(kTransportConnectJobTimeoutInSeconds); | 353 return base::TimeDelta::FromSeconds(kTransportConnectJobTimeoutInSeconds); |
| 354 } | 354 } |
| 355 | 355 |
| 356 TransportClientSocketPool::TransportClientSocketPool( | 356 TransportClientSocketPool::TransportClientSocketPool( |
| 357 int max_sockets, | 357 int max_sockets, |
| 358 int max_sockets_per_group, | 358 int max_sockets_per_group, |
| 359 ClientSocketPoolHistograms* histograms, | 359 ClientSocketPoolHistograms* histograms, |
| 360 HostResolver* host_resolver, | 360 HostResolver* host_resolver, |
| 361 ClientSocketFactory* client_socket_factory, | 361 ClientSocketFactory* client_socket_factory, |
| 362 NetLog* net_log) | 362 NetLog* net_log) |
| 363 : base_(max_sockets, max_sockets_per_group, histograms, | 363 : base_(NULL, max_sockets, max_sockets_per_group, histograms, |
| 364 ClientSocketPool::unused_idle_socket_timeout(), | 364 ClientSocketPool::unused_idle_socket_timeout(), |
| 365 ClientSocketPool::used_idle_socket_timeout(), | 365 ClientSocketPool::used_idle_socket_timeout(), |
| 366 new TransportConnectJobFactory(client_socket_factory, | 366 new TransportConnectJobFactory(client_socket_factory, |
| 367 host_resolver, net_log)) { | 367 host_resolver, net_log)) { |
| 368 base_.EnableConnectBackupJobs(); | 368 base_.EnableConnectBackupJobs(); |
| 369 } | 369 } |
| 370 | 370 |
| 371 TransportClientSocketPool::~TransportClientSocketPool() {} | 371 TransportClientSocketPool::~TransportClientSocketPool() {} |
| 372 | 372 |
| 373 int TransportClientSocketPool::RequestSocket( | 373 int TransportClientSocketPool::RequestSocket( |
| 374 const std::string& group_name, | 374 const std::string& group_name, |
| 375 const void* params, | 375 const void* params, |
| 376 RequestPriority priority, | 376 RequestPriority priority, |
| 377 ClientSocketHandle* handle, | 377 ClientSocketHandle* handle, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 const std::string& group_name, | 421 const std::string& group_name, |
| 422 StreamSocket* socket, | 422 StreamSocket* socket, |
| 423 int id) { | 423 int id) { |
| 424 base_.ReleaseSocket(group_name, socket, id); | 424 base_.ReleaseSocket(group_name, socket, id); |
| 425 } | 425 } |
| 426 | 426 |
| 427 void TransportClientSocketPool::FlushWithError(int error) { | 427 void TransportClientSocketPool::FlushWithError(int error) { |
| 428 base_.FlushWithError(error); | 428 base_.FlushWithError(error); |
| 429 } | 429 } |
| 430 | 430 |
| 431 bool TransportClientSocketPool::IsStalled() const { | |
| 432 return base_.IsStalled(); | |
| 433 } | |
| 434 | |
| 435 void TransportClientSocketPool::CloseIdleSockets() { | 431 void TransportClientSocketPool::CloseIdleSockets() { |
| 436 base_.CloseIdleSockets(); | 432 base_.CloseIdleSockets(); |
| 437 } | 433 } |
| 438 | 434 |
| 439 int TransportClientSocketPool::IdleSocketCount() const { | 435 int TransportClientSocketPool::IdleSocketCount() const { |
| 440 return base_.idle_socket_count(); | 436 return base_.idle_socket_count(); |
| 441 } | 437 } |
| 442 | 438 |
| 443 int TransportClientSocketPool::IdleSocketCountInGroup( | 439 int TransportClientSocketPool::IdleSocketCountInGroup( |
| 444 const std::string& group_name) const { | 440 const std::string& group_name) const { |
| 445 return base_.IdleSocketCountInGroup(group_name); | 441 return base_.IdleSocketCountInGroup(group_name); |
| 446 } | 442 } |
| 447 | 443 |
| 448 LoadState TransportClientSocketPool::GetLoadState( | 444 LoadState TransportClientSocketPool::GetLoadState( |
| 449 const std::string& group_name, const ClientSocketHandle* handle) const { | 445 const std::string& group_name, const ClientSocketHandle* handle) const { |
| 450 return base_.GetLoadState(group_name, handle); | 446 return base_.GetLoadState(group_name, handle); |
| 451 } | 447 } |
| 452 | 448 |
| 453 void TransportClientSocketPool::AddLayeredPool(LayeredPool* layered_pool) { | |
| 454 base_.AddLayeredPool(layered_pool); | |
| 455 } | |
| 456 | |
| 457 void TransportClientSocketPool::RemoveLayeredPool(LayeredPool* layered_pool) { | |
| 458 base_.RemoveLayeredPool(layered_pool); | |
| 459 } | |
| 460 | |
| 461 base::DictionaryValue* TransportClientSocketPool::GetInfoAsValue( | 449 base::DictionaryValue* TransportClientSocketPool::GetInfoAsValue( |
| 462 const std::string& name, | 450 const std::string& name, |
| 463 const std::string& type, | 451 const std::string& type, |
| 464 bool include_nested_pools) const { | 452 bool include_nested_pools) const { |
| 465 return base_.GetInfoAsValue(name, type); | 453 return base_.GetInfoAsValue(name, type); |
| 466 } | 454 } |
| 467 | 455 |
| 468 base::TimeDelta TransportClientSocketPool::ConnectionTimeout() const { | 456 base::TimeDelta TransportClientSocketPool::ConnectionTimeout() const { |
| 469 return base_.ConnectionTimeout(); | 457 return base_.ConnectionTimeout(); |
| 470 } | 458 } |
| 471 | 459 |
| 472 ClientSocketPoolHistograms* TransportClientSocketPool::histograms() const { | 460 ClientSocketPoolHistograms* TransportClientSocketPool::histograms() const { |
| 473 return base_.histograms(); | 461 return base_.histograms(); |
| 474 } | 462 } |
| 475 | 463 |
| 464 bool TransportClientSocketPool::IsStalled() const { |
| 465 return base_.IsStalled(); |
| 466 } |
| 467 |
| 468 void TransportClientSocketPool::AddHigherLayeredPool( |
| 469 HigherLayeredPool* higher_pool) { |
| 470 base_.AddHigherLayeredPool(higher_pool); |
| 471 } |
| 472 |
| 473 void TransportClientSocketPool::RemoveHigherLayeredPool( |
| 474 HigherLayeredPool* higher_pool) { |
| 475 base_.RemoveHigherLayeredPool(higher_pool); |
| 476 } |
| 477 |
| 476 } // namespace net | 478 } // namespace net |
| OLD | NEW |