summaryrefslogtreecommitdiffstats
path: root/net/socket/client_socket_handle.h
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-18 16:01:06 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-18 16:01:06 +0000
commita512f598dca5030e9c02c497b36839cbdcd6e0cb (patch)
tree0d1e24b54244557c52fe1bc1eac534316f378e8c /net/socket/client_socket_handle.h
parente4b553615a137a007b7c073d2ac2189fad00b6eb (diff)
downloadchromium_src-a512f598dca5030e9c02c497b36839cbdcd6e0cb.zip
chromium_src-a512f598dca5030e9c02c497b36839cbdcd6e0cb.tar.gz
chromium_src-a512f598dca5030e9c02c497b36839cbdcd6e0cb.tar.bz2
Change ClientSocketHandle to take the pool as a parameter to Init() rather than the constructor. The purpose of this change is to allow ClientSocketHandle to be able to accept ClientSocketPools of different types, since we will want to pass a TCPClientSocketPool or an SSLClientSocketPool or whatever to it.
BUG=http://crbug.com/13289 Review URL: http://codereview.chromium.org/171003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23629 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_handle.h')
-rw-r--r--net/socket/client_socket_handle.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/socket/client_socket_handle.h b/net/socket/client_socket_handle.h
index 9d63a41..c58e832 100644
--- a/net/socket/client_socket_handle.h
+++ b/net/socket/client_socket_handle.h
@@ -34,7 +34,7 @@ class ClientSocketHandle {
NUM_TYPES,
} SocketReuseType;
- explicit ClientSocketHandle(ClientSocketPool* pool);
+ ClientSocketHandle();
~ClientSocketHandle();
// Initializes a ClientSocketHandle object, which involves talking to the
@@ -56,11 +56,12 @@ class ClientSocketHandle {
//
// Profiling information for the request is saved to |load_log| if non-NULL.
//
- template <typename SocketParams>
+ template <typename SocketParams, typename PoolType>
int Init(const std::string& group_name,
const SocketParams& socket_params,
int priority,
CompletionCallback* callback,
+ PoolType* pool,
LoadLog* load_log);
// An initialized handle can be reset, which causes it to return to the
@@ -129,14 +130,18 @@ class ClientSocketHandle {
};
// Template function implementation:
-template <typename SocketParams>
+// TODO(willchan): Register valid (SocketParams,PoolType) pairs to provide
+// type safety.
+template <typename SocketParams, typename PoolType>
int ClientSocketHandle::Init(const std::string& group_name,
const SocketParams& socket_params,
int priority,
CompletionCallback* callback,
+ PoolType* pool,
LoadLog* load_log) {
CHECK(!group_name.empty());
ResetInternal(true);
+ pool_ = pool;
group_name_ = group_name;
init_time_ = base::TimeTicks::Now();
int rv = pool_->RequestSocket(