summaryrefslogtreecommitdiffstats
path: root/net/socket/socket_test_util.h
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-19 21:19:24 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-19 21:19:24 +0000
commita937a06d92a426395c006ef8437e57db6be928be (patch)
treec5f547a7c513e6e125a34ef069f3653b2f3a696e /net/socket/socket_test_util.h
parent8c89e779666552bdfc748989f9870b6c7cf94cfd (diff)
downloadchromium_src-a937a06d92a426395c006ef8437e57db6be928be.zip
chromium_src-a937a06d92a426395c006ef8437e57db6be928be.tar.gz
chromium_src-a937a06d92a426395c006ef8437e57db6be928be.tar.bz2
Make ClientSocketHandle::Init() typesafe.
Introduce a REGISTER_SOCKET_PARAMS_FOR_POOL macro to register valid SocketParams for a ClientSocketPool subtype. Update HttpNetworkSession's ClientSocketPool to return the concrete TCPClientSocketPool instead of the parent interface. Renamed the member variable&accessor. Updated tests. BUG=http://crbug.com/13289 Review URL: http://codereview.chromium.org/173018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23743 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/socket_test_util.h')
-rw-r--r--net/socket/socket_test_util.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h
index 8307d44..76d4df1f 100644
--- a/net/socket/socket_test_util.h
+++ b/net/socket/socket_test_util.h
@@ -329,22 +329,20 @@ class ClientSocketPoolTest : public testing::Test {
static const int kIndexOutOfBounds;
static const int kRequestNotFound;
- ClientSocketPoolTest() : ignored_request_info_("ignored", 80) {
- }
-
virtual void SetUp();
virtual void TearDown();
- template <typename PoolType>
+ template <typename PoolType, typename SocketParams>
int StartRequestUsingPool(PoolType* socket_pool,
const std::string& group_name,
- int priority) {
+ int priority,
+ const SocketParams& socket_params) {
DCHECK(socket_pool);
TestSocketRequest* request = new TestSocketRequest(&request_order_,
&completion_count_);
requests_.push_back(request);
int rv = request->handle()->Init(
- group_name, ignored_request_info_, priority, request,
+ group_name, socket_params, priority, request,
socket_pool, NULL);
if (rv != ERR_IO_PENDING)
request_order_.push_back(request);
@@ -364,7 +362,6 @@ class ClientSocketPoolTest : public testing::Test {
// Releases connections until there is nothing to release.
void ReleaseAllConnections(KeepAlive keep_alive);
- HostResolver::RequestInfo ignored_request_info_;
ScopedVector<TestSocketRequest> requests_;
std::vector<TestSocketRequest*> request_order_;
size_t completion_count_;