summaryrefslogtreecommitdiffstats
path: root/net/socket/client_socket_pool.h
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 17:17:26 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 17:17:26 +0000
commita796bcec176ca3875a55346800b3a60a83e2dd89 (patch)
tree2533c17673ff50f4f101e803c2dff3bf8f5cbf7b /net/socket/client_socket_pool.h
parent35818452760c23c570b7947e00a3b38e733ce58e (diff)
downloadchromium_src-a796bcec176ca3875a55346800b3a60a83e2dd89.zip
chromium_src-a796bcec176ca3875a55346800b3a60a83e2dd89.tar.gz
chromium_src-a796bcec176ca3875a55346800b3a60a83e2dd89.tar.bz2
Implement SOCKSClientSocketPool
This is the first layered pool, so there are several infrastructure changes in this change as well. Add a ConnectionTimeout method to pools so that layered pools can timeout each phase. Add a name method to pools to support per pool UMA histograms. Change SOCKS sockets to take a ClientSocketHandle instead of a ClientSocket BUG=30357 (blocks an SSL Pool) TEST=existing unit tests Review URL: http://codereview.chromium.org/668097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42231 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_pool.h')
-rw-r--r--net/socket/client_socket_pool.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/socket/client_socket_pool.h b/net/socket/client_socket_pool.h
index 16f408b..fb77ac4 100644
--- a/net/socket/client_socket_pool.h
+++ b/net/socket/client_socket_pool.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -58,7 +58,8 @@ class ClientSocketPool : public base::RefCounted<ClientSocketPool> {
// Called to cancel a RequestSocket call that returned ERR_IO_PENDING. The
// same handle parameter must be passed to this method as was passed to the
// RequestSocket call being cancelled. The associated CompletionCallback is
- // not run.
+ // not run. However, for performance, we will let one ConnectJob complete
+ // and go idle.
virtual void CancelRequest(const std::string& group_name,
const ClientSocketHandle* handle) = 0;
@@ -85,10 +86,16 @@ class ClientSocketPool : public base::RefCounted<ClientSocketPool> {
// Returns the maximum amount of time to wait before retrying a connect.
static const int kMaxConnectRetryIntervalMs = 250;
+ // The name of this pool, i.e. TCP, SOCKS.
+ virtual const std::string& name() const = 0;
+
protected:
ClientSocketPool() {}
virtual ~ClientSocketPool() {}
+ // Return the connection timeout for this pool.
+ virtual base::TimeDelta ConnectionTimeout() const = 0;
+
private:
friend class base::RefCounted<ClientSocketPool>;