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
3 // found in the LICENSE file.
5 #include "net/socket/client_socket_pool.h"
7 #include "base/logging.h"
11 // The maximum duration, in seconds, to keep unused idle persistent sockets
13 // TODO(ziadh): Change this timeout after getting histogram data on how long it
15 int64 g_unused_idle_socket_timeout_s
= 10;
17 // The maximum duration, in seconds, to keep used idle persistent sockets alive.
18 int64 g_used_idle_socket_timeout_s
= 300; // 5 minutes
25 base::TimeDelta
ClientSocketPool::unused_idle_socket_timeout() {
26 return base::TimeDelta::FromSeconds(g_unused_idle_socket_timeout_s
);
30 void ClientSocketPool::set_unused_idle_socket_timeout(base::TimeDelta timeout
) {
31 DCHECK_GT(timeout
.InSeconds(), 0);
32 g_unused_idle_socket_timeout_s
= timeout
.InSeconds();
36 base::TimeDelta
ClientSocketPool::used_idle_socket_timeout() {
37 return base::TimeDelta::FromSeconds(g_used_idle_socket_timeout_s
);
41 void ClientSocketPool::set_used_idle_socket_timeout(base::TimeDelta timeout
) {
42 DCHECK_GT(timeout
.InSeconds(), 0);
43 g_used_idle_socket_timeout_s
= timeout
.InSeconds();
46 ClientSocketPool::ClientSocketPool() {}
48 ClientSocketPool::~ClientSocketPool() {}