summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorkristianm@google.com <kristianm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 16:02:33 +0000
committerkristianm@google.com <kristianm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 16:02:33 +0000
commit8a84988e3a6bf32b5ed24b189cefd2b56b3fe041 (patch)
tree98a43aa19090f6d79b2f8e8a8749bb2dc1521176 /net
parentb6c2955681cc0959a9754c02cab67b317fc59e8a (diff)
downloadchromium_src-8a84988e3a6bf32b5ed24b189cefd2b56b3fe041.zip
chromium_src-8a84988e3a6bf32b5ed24b189cefd2b56b3fe041.tar.gz
chromium_src-8a84988e3a6bf32b5ed24b189cefd2b56b3fe041.tar.bz2
Removing a TODO and cleaning up code.
This is done in preparation of a patch to let some request ignore the max sockets and max sockets to group limits. BUG=none TEST=none Review URL: http://codereview.chromium.org/6679001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78034 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/http/http_network_transaction_unittest.cc4
-rw-r--r--net/socket/tcp_client_socket_pool.cc8
-rw-r--r--net/socket/tcp_client_socket_pool.h4
-rw-r--r--net/socket/tcp_client_socket_pool_unittest.cc3
-rw-r--r--net/spdy/spdy_http_stream_unittest.cc3
-rw-r--r--net/spdy/spdy_session_unittest.cc8
6 files changed, 9 insertions, 21 deletions
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index b238f57..78dbe55 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -7075,7 +7075,7 @@ TEST_F(HttpNetworkTransactionTest,
scoped_refptr<SpdySession> spdy_session =
session->spdy_session_pool()->Get(pair, BoundNetLog());
scoped_refptr<TCPSocketParams> tcp_params(
- new TCPSocketParams("www.google.com", 443, MEDIUM, GURL(), false));
+ new TCPSocketParams(host_port_pair, MEDIUM, GURL(), false));
scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
EXPECT_EQ(ERR_IO_PENDING,
@@ -8324,7 +8324,7 @@ TEST_F(HttpNetworkTransactionTest, PreconnectWithExistingSpdySession) {
scoped_refptr<SpdySession> spdy_session =
session->spdy_session_pool()->Get(pair, BoundNetLog());
scoped_refptr<TCPSocketParams> tcp_params(
- new TCPSocketParams("www.google.com", 443, MEDIUM, GURL(), false));
+ new TCPSocketParams(host_port_pair, MEDIUM, GURL(), false));
TestCompletionCallback callback;
scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
diff --git a/net/socket/tcp_client_socket_pool.cc b/net/socket/tcp_client_socket_pool.cc
index 4d71e2d..716c798 100644
--- a/net/socket/tcp_client_socket_pool.cc
+++ b/net/socket/tcp_client_socket_pool.cc
@@ -28,14 +28,6 @@ TCPSocketParams::TCPSocketParams(const HostPortPair& host_port_pair,
Initialize(priority, referrer, disable_resolver_cache);
}
-// TODO(willchan): Update all unittests so we don't need this.
-TCPSocketParams::TCPSocketParams(const std::string& host, int port,
- RequestPriority priority, const GURL& referrer,
- bool disable_resolver_cache)
- : destination_(HostPortPair(host, port)) {
- Initialize(priority, referrer, disable_resolver_cache);
-}
-
TCPSocketParams::~TCPSocketParams() {}
void TCPSocketParams::Initialize(RequestPriority priority,
diff --git a/net/socket/tcp_client_socket_pool.h b/net/socket/tcp_client_socket_pool.h
index 4c19509..245262e 100644
--- a/net/socket/tcp_client_socket_pool.h
+++ b/net/socket/tcp_client_socket_pool.h
@@ -28,10 +28,6 @@ class TCPSocketParams : public base::RefCounted<TCPSocketParams> {
TCPSocketParams(const HostPortPair& host_port_pair, RequestPriority priority,
const GURL& referrer, bool disable_resolver_cache);
- // TODO(willchan): Update all unittests so we don't need this.
- TCPSocketParams(const std::string& host, int port, RequestPriority priority,
- const GURL& referrer, bool disable_resolver_cache);
-
const HostResolver::RequestInfo& destination() const { return destination_; }
private:
diff --git a/net/socket/tcp_client_socket_pool_unittest.cc b/net/socket/tcp_client_socket_pool_unittest.cc
index 307bd12..a8d496f 100644
--- a/net/socket/tcp_client_socket_pool_unittest.cc
+++ b/net/socket/tcp_client_socket_pool_unittest.cc
@@ -353,8 +353,9 @@ TEST_F(TCPClientSocketPoolTest, InitHostResolutionFailure) {
host_resolver_->rules()->AddSimulatedFailure("unresolvable.host.name");
TestCompletionCallback callback;
ClientSocketHandle handle;
+ HostPortPair host_port_pair("unresolvable.host.name", 80);
scoped_refptr<TCPSocketParams> dest(new TCPSocketParams(
- "unresolvable.host.name", 80, kDefaultPriority, GURL(), false));
+ host_port_pair, kDefaultPriority, GURL(), false));
EXPECT_EQ(ERR_IO_PENDING,
handle.Init("a", dest, kDefaultPriority, &callback, &pool_,
BoundNetLog()));
diff --git a/net/spdy/spdy_http_stream_unittest.cc b/net/spdy/spdy_http_stream_unittest.cc
index bee345a..730c5cc 100644
--- a/net/spdy/spdy_http_stream_unittest.cc
+++ b/net/spdy/spdy_http_stream_unittest.cc
@@ -30,8 +30,7 @@ class SpdyHttpStreamTest : public testing::Test {
session_deps_.socket_factory->AddSocketDataProvider(data_.get());
http_session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_);
session_ = http_session_->spdy_session_pool()->Get(pair, BoundNetLog());
- tcp_params_ = new TCPSocketParams(host_port_pair.host(),
- host_port_pair.port(),
+ tcp_params_ = new TCPSocketParams(host_port_pair,
MEDIUM, GURL(), false);
TestCompletionCallback callback;
scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc
index 0f3b601..ee59f8b 100644
--- a/net/spdy/spdy_session_unittest.cc
+++ b/net/spdy/spdy_session_unittest.cc
@@ -92,7 +92,7 @@ TEST_F(SpdySessionTest, GoAway) {
EXPECT_TRUE(spdy_session_pool->HasSession(pair));
scoped_refptr<TCPSocketParams> tcp_params(
- new TCPSocketParams(kTestHost, kTestPort, MEDIUM, GURL(), false));
+ new TCPSocketParams(test_host_port_pair, MEDIUM, GURL(), false));
scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
EXPECT_EQ(OK,
connection->Init(test_host_port_pair.ToString(), tcp_params, MEDIUM,
@@ -199,7 +199,7 @@ TEST_F(SpdySessionTest, OnSettings) {
ASSERT_TRUE(spdy_session_pool->HasSession(pair));
scoped_refptr<TCPSocketParams> tcp_params(
- new TCPSocketParams(kTestHost, kTestPort, MEDIUM, GURL(), false));
+ new TCPSocketParams(test_host_port_pair, MEDIUM, GURL(), false));
scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
EXPECT_EQ(OK,
connection->Init(test_host_port_pair.ToString(), tcp_params, MEDIUM,
@@ -280,7 +280,7 @@ TEST_F(SpdySessionTest, CancelPendingCreateStream) {
ASSERT_TRUE(spdy_session_pool->HasSession(pair));
scoped_refptr<TCPSocketParams> tcp_params(
- new TCPSocketParams(kTestHost, kTestPort, MEDIUM, GURL(), false));
+ new TCPSocketParams(test_host_port_pair, MEDIUM, GURL(), false));
scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
EXPECT_EQ(OK,
connection->Init(test_host_port_pair.ToString(), tcp_params, MEDIUM,
@@ -375,7 +375,7 @@ TEST_F(SpdySessionTest, SendSettingsOnNewSession) {
EXPECT_TRUE(spdy_session_pool->HasSession(pair));
scoped_refptr<TCPSocketParams> tcp_params(
- new TCPSocketParams(kTestHost, kTestPort, MEDIUM, GURL(), false));
+ new TCPSocketParams(test_host_port_pair, MEDIUM, GURL(), false));
scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
EXPECT_EQ(OK,
connection->Init(test_host_port_pair.ToString(), tcp_params, MEDIUM,