summaryrefslogtreecommitdiffstats
path: root/net/socket/client_socket_handle.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_handle.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_handle.h')
-rw-r--r--net/socket/client_socket_handle.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/socket/client_socket_handle.h b/net/socket/client_socket_handle.h
index 782ad48..f750c7b 100644
--- a/net/socket/client_socket_handle.h
+++ b/net/socket/client_socket_handle.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.
@@ -62,7 +62,7 @@ class ClientSocketHandle {
const SocketParams& socket_params,
RequestPriority priority,
CompletionCallback* callback,
- PoolType* pool,
+ const scoped_refptr<PoolType>& pool,
const BoundNetLog& net_log);
// An initialized handle can be reset, which causes it to return to the
@@ -85,6 +85,9 @@ class ClientSocketHandle {
// Returns the time tick when Init() was called.
base::TimeTicks init_time() const { return init_time_; }
+ // Returns the time between Init() and when is_initialized() becomes true.
+ base::TimeDelta setup_time() const { return setup_time_; }
+
// Used by ClientSocketPool to initialize the ClientSocketHandle.
void set_is_reused(bool is_reused) { is_reused_ = is_reused; }
void set_socket(ClientSocket* s) { socket_.reset(s); }
@@ -139,6 +142,7 @@ class ClientSocketHandle {
CompletionCallback* user_callback_;
base::TimeDelta idle_time_;
base::TimeTicks init_time_;
+ base::TimeDelta setup_time_;
DISALLOW_COPY_AND_ASSIGN(ClientSocketHandle);
};
@@ -149,7 +153,7 @@ int ClientSocketHandle::Init(const std::string& group_name,
const SocketParams& socket_params,
RequestPriority priority,
CompletionCallback* callback,
- PoolType* pool,
+ const scoped_refptr<PoolType>& pool,
const BoundNetLog& net_log) {
CHECK(!group_name.empty());
// Note that this will result in a link error if the SocketParams has not been