summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-07 15:22:28 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-07 15:22:28 +0000
commitab73904ffa1b236905a4f1253dd03e02dd9e8695 (patch)
tree280c13fdd850ed27e964df6f25cc7b6f16072a3b /net/http
parent53900d0715c882d9b8ae8281a17272143fd77143 (diff)
downloadchromium_src-ab73904ffa1b236905a4f1253dd03e02dd9e8695.zip
chromium_src-ab73904ffa1b236905a4f1253dd03e02dd9e8695.tar.gz
chromium_src-ab73904ffa1b236905a4f1253dd03e02dd9e8695.tar.bz2
Rename a number of classes previously labeled "TCP" to "Transport" in
preparation for non-TCP transports. This helps because the alternative is to either use non-TCP protocols (like SCTP) in classes which are called "TCPClientSocketPool", or to clone the code as "SCTPClientSocketPool", both of which are less than ideal. For now, we're just testing transports, so the TransportSocketPool classes will determine a single type of transport and just use them. In the future we'll likely need to figure out how to deal with runtime selection of transports, and probably support use of multiple transports either within the same pools or within subpools. But that is for the future. Note that the histograms have some "tcp" references to them. I didn't change these to "transport" yet, because it will effect existing histograms. Renames include: classes: TCPClientSocketPool -> TransportClientSocketPool MockTCPClientSocketPool -> MockTransportClientSocketPool TCPSocketParams -> TransportSocketParams methods (not the exhaustive list): CreateTCPClientSocket() -> CreateTransportClientSocket() DoTCPConnect() -> DoTransportConnect() BUG=none TEST=none Review URL: http://codereview.chromium.org/6804028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80781 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_network_session.h4
-rw-r--r--net/http/http_network_session_peer.cc7
-rw-r--r--net/http/http_network_session_peer.h4
-rw-r--r--net/http/http_network_transaction.cc2
-rw-r--r--net/http/http_network_transaction_unittest.cc73
-rw-r--r--net/http/http_proxy_client_socket_pool.cc78
-rw-r--r--net/http/http_proxy_client_socket_pool.h49
-rw-r--r--net/http/http_proxy_client_socket_pool_unittest.cc23
-rw-r--r--net/http/http_stream_factory_impl_job.cc1
-rw-r--r--net/http/http_stream_factory_impl_job.h2
-rw-r--r--net/http/http_stream_factory_impl_unittest.cc20
11 files changed, 139 insertions, 124 deletions
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h
index f25227b4..14b85ae 100644
--- a/net/http/http_network_session.h
+++ b/net/http/http_network_session.h
@@ -87,8 +87,8 @@ class HttpNetworkSession : public base::RefCounted<HttpNetworkSession>,
return &alternate_protocols_;
}
- TCPClientSocketPool* tcp_socket_pool() {
- return socket_pool_manager_.tcp_socket_pool();
+ TransportClientSocketPool* transport_socket_pool() {
+ return socket_pool_manager_.transport_socket_pool();
}
SSLClientSocketPool* ssl_socket_pool() {
diff --git a/net/http/http_network_session_peer.cc b/net/http/http_network_session_peer.cc
index 2ed3e76..921322a 100644
--- a/net/http/http_network_session_peer.cc
+++ b/net/http/http_network_session_peer.cc
@@ -9,7 +9,7 @@
#include "net/proxy/proxy_service.h"
#include "net/socket/socks_client_socket_pool.h"
#include "net/socket/ssl_client_socket_pool.h"
-#include "net/socket/tcp_client_socket_pool.h"
+#include "net/socket/transport_client_socket_pool.h"
namespace net {
@@ -19,8 +19,9 @@ HttpNetworkSessionPeer::HttpNetworkSessionPeer(
HttpNetworkSessionPeer::~HttpNetworkSessionPeer() {}
-void HttpNetworkSessionPeer::SetTCPSocketPool(TCPClientSocketPool* pool) {
- session_->socket_pool_manager_.tcp_socket_pool_.reset(pool);
+void HttpNetworkSessionPeer::SetTransportSocketPool(
+ TransportClientSocketPool* pool) {
+ session_->socket_pool_manager_.transport_socket_pool_.reset(pool);
}
void HttpNetworkSessionPeer::SetSocketPoolForSOCKSProxy(
diff --git a/net/http/http_network_session_peer.h b/net/http/http_network_session_peer.h
index e380302..51b1f81 100644
--- a/net/http/http_network_session_peer.h
+++ b/net/http/http_network_session_peer.h
@@ -17,7 +17,7 @@ class HttpStreamFactory;
class ProxyService;
class SOCKSClientSocketPool;
class SSLClientSocketPool;
-class TCPClientSocketPool;
+class TransportClientSocketPool;
class HttpNetworkSessionPeer {
public:
@@ -25,7 +25,7 @@ class HttpNetworkSessionPeer {
const scoped_refptr<HttpNetworkSession>& session);
~HttpNetworkSessionPeer();
- void SetTCPSocketPool(TCPClientSocketPool* pool);
+ void SetTransportSocketPool(TransportClientSocketPool* pool);
void SetSocketPoolForSOCKSProxy(
const HostPortPair& socks_proxy,
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 9271b33..0bfad34 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -50,7 +50,7 @@
#include "net/socket/socks_client_socket_pool.h"
#include "net/socket/ssl_client_socket.h"
#include "net/socket/ssl_client_socket_pool.h"
-#include "net/socket/tcp_client_socket_pool.h"
+#include "net/socket/transport_client_socket_pool.h"
#include "net/spdy/spdy_http_stream.h"
#include "net/spdy/spdy_session.h"
#include "net/spdy/spdy_session_pool.h"
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 90cb0c4..f21a1a2 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -295,8 +295,8 @@ class CaptureGroupNameSocketPool : public ParentPool {
std::string last_group_name_;
};
-typedef CaptureGroupNameSocketPool<TCPClientSocketPool>
-CaptureGroupNameTCPSocketPool;
+typedef CaptureGroupNameSocketPool<TransportClientSocketPool>
+CaptureGroupNameTransportSocketPool;
typedef CaptureGroupNameSocketPool<HttpProxyClientSocketPool>
CaptureGroupNameHttpProxySocketPool;
typedef CaptureGroupNameSocketPool<SOCKSClientSocketPool>
@@ -3120,7 +3120,7 @@ TEST_F(HttpNetworkTransactionTest, LargeHeadersNoBody) {
// Make sure that we don't try to reuse a TCPClientSocket when failing to
// establish tunnel.
// http://code.google.com/p/chromium/issues/detail?id=3772
-TEST_F(HttpNetworkTransactionTest, DontRecycleTCPSocketForSSLTunnel) {
+TEST_F(HttpNetworkTransactionTest, DontRecycleTransportSocketForSSLTunnel) {
HttpRequestInfo request;
request.method = "GET";
request.url = GURL("https://www.google.com/");
@@ -3170,11 +3170,11 @@ TEST_F(HttpNetworkTransactionTest, DontRecycleTCPSocketForSSLTunnel) {
// We now check to make sure the TCPClientSocket was not added back to
// the pool.
- EXPECT_EQ(0, session->tcp_socket_pool()->IdleSocketCount());
+ EXPECT_EQ(0, session->transport_socket_pool()->IdleSocketCount());
trans.reset();
MessageLoop::current()->RunAllPending();
// Make sure that the socket didn't get recycled after calling the destructor.
- EXPECT_EQ(0, session->tcp_socket_pool()->IdleSocketCount());
+ EXPECT_EQ(0, session->transport_socket_pool()->IdleSocketCount());
}
// Make sure that we recycle a socket after reading all of the response body.
@@ -3217,7 +3217,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleSocket) {
std::string status_line = response->headers->GetStatusLine();
EXPECT_EQ("HTTP/1.1 200 OK", status_line);
- EXPECT_EQ(0, session->tcp_socket_pool()->IdleSocketCount());
+ EXPECT_EQ(0, session->transport_socket_pool()->IdleSocketCount());
std::string response_data;
rv = ReadTransaction(trans.get(), &response_data);
@@ -3229,7 +3229,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleSocket) {
MessageLoop::current()->RunAllPending();
// We now check to make sure the socket was added back to the pool.
- EXPECT_EQ(1, session->tcp_socket_pool()->IdleSocketCount());
+ EXPECT_EQ(1, session->transport_socket_pool()->IdleSocketCount());
}
// Make sure that we recycle a SSL socket after reading all of the response
@@ -3276,7 +3276,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleSSLSocket) {
ASSERT_TRUE(response->headers != NULL);
EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine());
- EXPECT_EQ(0, session->tcp_socket_pool()->IdleSocketCount());
+ EXPECT_EQ(0, session->transport_socket_pool()->IdleSocketCount());
std::string response_data;
rv = ReadTransaction(trans.get(), &response_data);
@@ -3344,7 +3344,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleDeadSSLSocket) {
ASSERT_TRUE(response->headers != NULL);
EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine());
- EXPECT_EQ(0, session->tcp_socket_pool()->IdleSocketCount());
+ EXPECT_EQ(0, session->transport_socket_pool()->IdleSocketCount());
std::string response_data;
rv = ReadTransaction(trans.get(), &response_data);
@@ -3372,7 +3372,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleDeadSSLSocket) {
ASSERT_TRUE(response->headers != NULL);
EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine());
- EXPECT_EQ(0, session->tcp_socket_pool()->IdleSocketCount());
+ EXPECT_EQ(0, session->transport_socket_pool()->IdleSocketCount());
rv = ReadTransaction(trans.get(), &response_data);
EXPECT_EQ(OK, rv);
@@ -3428,7 +3428,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleSocketAfterZeroContentLength) {
std::string status_line = response->headers->GetStatusLine();
EXPECT_EQ("HTTP/1.1 204 No Content", status_line);
- EXPECT_EQ(0, session->tcp_socket_pool()->IdleSocketCount());
+ EXPECT_EQ(0, session->transport_socket_pool()->IdleSocketCount());
std::string response_data;
rv = ReadTransaction(trans.get(), &response_data);
@@ -3440,7 +3440,7 @@ TEST_F(HttpNetworkTransactionTest, RecycleSocketAfterZeroContentLength) {
MessageLoop::current()->RunAllPending();
// We now check to make sure the socket was added back to the pool.
- EXPECT_EQ(1, session->tcp_socket_pool()->IdleSocketCount());
+ EXPECT_EQ(1, session->transport_socket_pool()->IdleSocketCount());
}
TEST_F(HttpNetworkTransactionTest, ResendRequestOnWriteBodyError) {
@@ -5512,9 +5512,9 @@ TEST_F(HttpNetworkTransactionTest, GroupNameForDirectConnections) {
SetupSessionForGroupNameTests(&session_deps));
HttpNetworkSessionPeer peer(session);
- CaptureGroupNameTCPSocketPool* tcp_conn_pool =
- new CaptureGroupNameTCPSocketPool(NULL, NULL);
- peer.SetTCPSocketPool(tcp_conn_pool);
+ CaptureGroupNameTransportSocketPool* transport_conn_pool =
+ new CaptureGroupNameTransportSocketPool(NULL, NULL);
+ peer.SetTransportSocketPool(transport_conn_pool);
CaptureGroupNameSSLSocketPool* ssl_conn_pool =
new CaptureGroupNameSSLSocketPool(NULL, NULL);
peer.SetSSLSocketPool(ssl_conn_pool);
@@ -5526,7 +5526,7 @@ TEST_F(HttpNetworkTransactionTest, GroupNameForDirectConnections) {
ssl_conn_pool->last_group_name_received());
else
EXPECT_EQ(tests[i].expected_group_name,
- tcp_conn_pool->last_group_name_received());
+ transport_conn_pool->last_group_name_received());
}
HttpStreamFactory::set_use_alternate_protocols(false);
@@ -7046,13 +7046,16 @@ TEST_F(HttpNetworkTransactionTest,
HostPortProxyPair pair(host_port_pair, ProxyServer::Direct());
scoped_refptr<SpdySession> spdy_session =
session->spdy_session_pool()->Get(pair, BoundNetLog());
- scoped_refptr<TCPSocketParams> tcp_params(
- new TCPSocketParams(host_port_pair, MEDIUM, GURL(), false, false));
+ scoped_refptr<TransportSocketParams> transport_params(
+ new TransportSocketParams(host_port_pair, MEDIUM, GURL(), false, false));
scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
EXPECT_EQ(ERR_IO_PENDING,
- connection->Init(host_port_pair.ToString(),tcp_params, LOWEST,
- &callback, session->tcp_socket_pool(),
+ connection->Init(host_port_pair.ToString(),
+ transport_params,
+ LOWEST,
+ &callback,
+ session->transport_socket_pool(),
BoundNetLog()));
EXPECT_EQ(OK, callback.WaitForResult());
@@ -7533,15 +7536,15 @@ TEST_F(HttpNetworkTransactionTest, MultiRoundAuth) {
// to validate that the TCP socket is not released to the pool between
// each round of multi-round authentication.
HttpNetworkSessionPeer session_peer(session);
- ClientSocketPoolHistograms tcp_pool_histograms("SmallTCP");
- TCPClientSocketPool* tcp_pool = new TCPClientSocketPool(
+ ClientSocketPoolHistograms transport_pool_histograms("SmallTCP");
+ TransportClientSocketPool* transport_pool = new TransportClientSocketPool(
50, // Max sockets for pool
1, // Max sockets per group
- &tcp_pool_histograms,
+ &transport_pool_histograms,
session_deps.host_resolver.get(),
&session_deps.socket_factory,
session_deps.net_log);
- session_peer.SetTCPSocketPool(tcp_pool);
+ session_peer.SetTransportSocketPool(transport_pool);
scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session));
TestCompletionCallback callback;
@@ -7607,7 +7610,7 @@ TEST_F(HttpNetworkTransactionTest, MultiRoundAuth) {
response = trans->GetResponseInfo();
ASSERT_FALSE(response == NULL);
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- EXPECT_EQ(0, tcp_pool->IdleSocketCountInGroup(kSocketGroup));
+ EXPECT_EQ(0, transport_pool->IdleSocketCountInGroup(kSocketGroup));
// In between rounds, another request comes in for the same domain.
// It should not be able to grab the TCP socket that trans has already
@@ -7630,7 +7633,7 @@ TEST_F(HttpNetworkTransactionTest, MultiRoundAuth) {
response = trans->GetResponseInfo();
ASSERT_FALSE(response == NULL);
EXPECT_TRUE(response->auth_challenge.get() == NULL);
- EXPECT_EQ(0, tcp_pool->IdleSocketCountInGroup(kSocketGroup));
+ EXPECT_EQ(0, transport_pool->IdleSocketCountInGroup(kSocketGroup));
// Third round of authentication.
auth_handler->SetGenerateExpectation(false, OK);
@@ -7641,7 +7644,7 @@ TEST_F(HttpNetworkTransactionTest, MultiRoundAuth) {
response = trans->GetResponseInfo();
ASSERT_FALSE(response == NULL);
EXPECT_TRUE(response->auth_challenge.get() == NULL);
- EXPECT_EQ(0, tcp_pool->IdleSocketCountInGroup(kSocketGroup));
+ EXPECT_EQ(0, transport_pool->IdleSocketCountInGroup(kSocketGroup));
// Fourth round of authentication, which completes successfully.
auth_handler->SetGenerateExpectation(false, OK);
@@ -7652,7 +7655,7 @@ TEST_F(HttpNetworkTransactionTest, MultiRoundAuth) {
response = trans->GetResponseInfo();
ASSERT_FALSE(response == NULL);
EXPECT_TRUE(response->auth_challenge.get() == NULL);
- EXPECT_EQ(0, tcp_pool->IdleSocketCountInGroup(kSocketGroup));
+ EXPECT_EQ(0, transport_pool->IdleSocketCountInGroup(kSocketGroup));
// Read the body since the fourth round was successful. This will also
// release the socket back to the pool.
@@ -7665,7 +7668,7 @@ TEST_F(HttpNetworkTransactionTest, MultiRoundAuth) {
EXPECT_EQ(0, rv);
// There are still 0 idle sockets, since the trans_compete transaction
// will be handed it immediately after trans releases it to the group.
- EXPECT_EQ(0, tcp_pool->IdleSocketCountInGroup(kSocketGroup));
+ EXPECT_EQ(0, transport_pool->IdleSocketCountInGroup(kSocketGroup));
// The competing request can now finish. Wait for the headers and then
// read the body.
@@ -7679,7 +7682,7 @@ TEST_F(HttpNetworkTransactionTest, MultiRoundAuth) {
EXPECT_EQ(0, rv);
// Finally, the socket is released to the group.
- EXPECT_EQ(1, tcp_pool->IdleSocketCountInGroup(kSocketGroup));
+ EXPECT_EQ(1, transport_pool->IdleSocketCountInGroup(kSocketGroup));
}
class TLSDecompressionFailureSocketDataProvider : public SocketDataProvider {
@@ -8295,15 +8298,15 @@ TEST_F(HttpNetworkTransactionTest, PreconnectWithExistingSpdySession) {
HostPortProxyPair pair(host_port_pair, ProxyServer::Direct());
scoped_refptr<SpdySession> spdy_session =
session->spdy_session_pool()->Get(pair, BoundNetLog());
- scoped_refptr<TCPSocketParams> tcp_params(
- new TCPSocketParams(host_port_pair, MEDIUM, GURL(), false, false));
+ scoped_refptr<TransportSocketParams> transport_params(
+ new TransportSocketParams(host_port_pair, MEDIUM, GURL(), false, false));
TestCompletionCallback callback;
scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
EXPECT_EQ(ERR_IO_PENDING,
- connection->Init(host_port_pair.ToString(), tcp_params, LOWEST,
- &callback, session->tcp_socket_pool(),
- BoundNetLog()));
+ connection->Init(host_port_pair.ToString(), transport_params,
+ LOWEST, &callback,
+ session->transport_socket_pool(), BoundNetLog()));
EXPECT_EQ(OK, callback.WaitForResult());
spdy_session->InitializeWithSocket(connection.release(), false, OK);
diff --git a/net/http/http_proxy_client_socket_pool.cc b/net/http/http_proxy_client_socket_pool.cc
index 39e899c..e991f55 100644
--- a/net/http/http_proxy_client_socket_pool.cc
+++ b/net/http/http_proxy_client_socket_pool.cc
@@ -18,7 +18,7 @@
#include "net/socket/client_socket_pool_base.h"
#include "net/socket/ssl_client_socket.h"
#include "net/socket/ssl_client_socket_pool.h"
-#include "net/socket/tcp_client_socket_pool.h"
+#include "net/socket/transport_client_socket_pool.h"
#include "net/spdy/spdy_proxy_client_socket.h"
#include "net/spdy/spdy_session.h"
#include "net/spdy/spdy_session_pool.h"
@@ -28,7 +28,7 @@
namespace net {
HttpProxySocketParams::HttpProxySocketParams(
- const scoped_refptr<TCPSocketParams>& tcp_params,
+ const scoped_refptr<TransportSocketParams>& transport_params,
const scoped_refptr<SSLSocketParams>& ssl_params,
const GURL& request_url,
const std::string& user_agent,
@@ -37,7 +37,7 @@ HttpProxySocketParams::HttpProxySocketParams(
HttpAuthHandlerFactory* http_auth_handler_factory,
SpdySessionPool* spdy_session_pool,
bool tunnel)
- : tcp_params_(tcp_params),
+ : transport_params_(transport_params),
ssl_params_(ssl_params),
spdy_session_pool_(spdy_session_pool),
request_url_(request_url),
@@ -46,19 +46,19 @@ HttpProxySocketParams::HttpProxySocketParams(
http_auth_cache_(tunnel ? http_auth_cache : NULL),
http_auth_handler_factory_(tunnel ? http_auth_handler_factory : NULL),
tunnel_(tunnel) {
- DCHECK((tcp_params == NULL && ssl_params != NULL) ||
- (tcp_params != NULL && ssl_params == NULL));
- if (tcp_params_)
- ignore_limits_ = tcp_params->ignore_limits();
+ DCHECK((transport_params == NULL && ssl_params != NULL) ||
+ (transport_params != NULL && ssl_params == NULL));
+ if (transport_params_)
+ ignore_limits_ = transport_params->ignore_limits();
else
ignore_limits_ = ssl_params->ignore_limits();
}
const HostResolver::RequestInfo& HttpProxySocketParams::destination() const {
- if (tcp_params_ == NULL)
- return ssl_params_->tcp_params()->destination();
+ if (transport_params_ == NULL)
+ return ssl_params_->transport_params()->destination();
else
- return tcp_params_->destination();
+ return transport_params_->destination();
}
HttpProxySocketParams::~HttpProxySocketParams() {}
@@ -71,7 +71,7 @@ HttpProxyConnectJob::HttpProxyConnectJob(
const std::string& group_name,
const scoped_refptr<HttpProxySocketParams>& params,
const base::TimeDelta& timeout_duration,
- TCPClientSocketPool* tcp_pool,
+ TransportClientSocketPool* transport_pool,
SSLClientSocketPool* ssl_pool,
HostResolver* host_resolver,
Delegate* delegate,
@@ -79,7 +79,7 @@ HttpProxyConnectJob::HttpProxyConnectJob(
: ConnectJob(group_name, timeout_duration, delegate,
BoundNetLog::Make(net_log, NetLog::SOURCE_CONNECT_JOB)),
params_(params),
- tcp_pool_(tcp_pool),
+ transport_pool_(transport_pool),
ssl_pool_(ssl_pool),
resolver_(host_resolver),
ALLOW_THIS_IN_INITIALIZER_LIST(
@@ -130,10 +130,10 @@ int HttpProxyConnectJob::DoLoop(int result) {
switch (state) {
case STATE_TCP_CONNECT:
DCHECK_EQ(OK, rv);
- rv = DoTCPConnect();
+ rv = DoTransportConnect();
break;
case STATE_TCP_CONNECT_COMPLETE:
- rv = DoTCPConnectComplete(rv);
+ rv = DoTransportConnectComplete(rv);
break;
case STATE_SSL_CONNECT:
DCHECK_EQ(OK, rv);
@@ -166,16 +166,19 @@ int HttpProxyConnectJob::DoLoop(int result) {
return rv;
}
-int HttpProxyConnectJob::DoTCPConnect() {
+int HttpProxyConnectJob::DoTransportConnect() {
next_state_ = STATE_TCP_CONNECT_COMPLETE;
transport_socket_handle_.reset(new ClientSocketHandle());
return transport_socket_handle_->Init(
- group_name(), params_->tcp_params(),
- params_->tcp_params()->destination().priority(), &callback_, tcp_pool_,
+ group_name(),
+ params_->transport_params(),
+ params_->transport_params()->destination().priority(),
+ &callback_,
+ transport_pool_,
net_log());
}
-int HttpProxyConnectJob::DoTCPConnectComplete(int result) {
+int HttpProxyConnectJob::DoTransportConnectComplete(int result) {
if (result != OK)
return ERR_PROXY_CONNECTION_FAILED;
@@ -203,7 +206,7 @@ int HttpProxyConnectJob::DoSSLConnect() {
transport_socket_handle_.reset(new ClientSocketHandle());
return transport_socket_handle_->Init(
group_name(), params_->ssl_params(),
- params_->ssl_params()->tcp_params()->destination().priority(),
+ params_->ssl_params()->transport_params()->destination().priority(),
&callback_, ssl_pool_, net_log());
}
@@ -327,7 +330,7 @@ int HttpProxyConnectJob::DoSpdyProxyCreateStreamComplete(int result) {
}
int HttpProxyConnectJob::ConnectInternal() {
- if (params_->tcp_params())
+ if (params_->transport_params())
next_state_ = STATE_TCP_CONNECT;
else
next_state_ = STATE_SSL_CONNECT;
@@ -336,17 +339,17 @@ int HttpProxyConnectJob::ConnectInternal() {
HttpProxyClientSocketPool::
HttpProxyConnectJobFactory::HttpProxyConnectJobFactory(
- TCPClientSocketPool* tcp_pool,
+ TransportClientSocketPool* transport_pool,
SSLClientSocketPool* ssl_pool,
HostResolver* host_resolver,
NetLog* net_log)
- : tcp_pool_(tcp_pool),
+ : transport_pool_(transport_pool),
ssl_pool_(ssl_pool),
host_resolver_(host_resolver),
net_log_(net_log) {
base::TimeDelta max_pool_timeout = base::TimeDelta();
- if (tcp_pool_)
- max_pool_timeout = tcp_pool_->ConnectionTimeout();
+ if (transport_pool_)
+ max_pool_timeout = transport_pool_->ConnectionTimeout();
if (ssl_pool_)
max_pool_timeout = std::max(max_pool_timeout,
ssl_pool_->ConnectionTimeout());
@@ -360,9 +363,14 @@ HttpProxyClientSocketPool::HttpProxyConnectJobFactory::NewConnectJob(
const std::string& group_name,
const PoolBase::Request& request,
ConnectJob::Delegate* delegate) const {
- return new HttpProxyConnectJob(group_name, request.params(),
- ConnectionTimeout(), tcp_pool_, ssl_pool_,
- host_resolver_, delegate, net_log_);
+ return new HttpProxyConnectJob(group_name,
+ request.params(),
+ ConnectionTimeout(),
+ transport_pool_,
+ ssl_pool_,
+ host_resolver_,
+ delegate,
+ net_log_);
}
HttpProxyClientSocketPool::HttpProxyClientSocketPool(
@@ -370,16 +378,18 @@ HttpProxyClientSocketPool::HttpProxyClientSocketPool(
int max_sockets_per_group,
ClientSocketPoolHistograms* histograms,
HostResolver* host_resolver,
- TCPClientSocketPool* tcp_pool,
+ TransportClientSocketPool* transport_pool,
SSLClientSocketPool* ssl_pool,
NetLog* net_log)
- : tcp_pool_(tcp_pool),
+ : transport_pool_(transport_pool),
ssl_pool_(ssl_pool),
base_(max_sockets, max_sockets_per_group, histograms,
base::TimeDelta::FromSeconds(
ClientSocketPool::unused_idle_socket_timeout()),
base::TimeDelta::FromSeconds(kUsedIdleSocketTimeout),
- new HttpProxyConnectJobFactory(tcp_pool, ssl_pool, host_resolver,
+ new HttpProxyConnectJobFactory(transport_pool,
+ ssl_pool,
+ host_resolver,
net_log)) {}
HttpProxyClientSocketPool::~HttpProxyClientSocketPool() {}
@@ -448,10 +458,10 @@ DictionaryValue* HttpProxyClientSocketPool::GetInfoAsValue(
DictionaryValue* dict = base_.GetInfoAsValue(name, type);
if (include_nested_pools) {
ListValue* list = new ListValue();
- if (tcp_pool_) {
- list->Append(tcp_pool_->GetInfoAsValue("tcp_socket_pool",
- "tcp_socket_pool",
- true));
+ if (transport_pool_) {
+ list->Append(transport_pool_->GetInfoAsValue("transport_socket_pool",
+ "transport_socket_pool",
+ true));
}
if (ssl_pool_) {
list->Append(ssl_pool_->GetInfoAsValue("ssl_socket_pool",
diff --git a/net/http/http_proxy_client_socket_pool.h b/net/http/http_proxy_client_socket_pool.h
index 3efbf3c..14bd9bea 100644
--- a/net/http/http_proxy_client_socket_pool.h
+++ b/net/http/http_proxy_client_socket_pool.h
@@ -29,27 +29,28 @@ class SSLClientSocketPool;
class SSLSocketParams;
class SpdySessionPool;
class SpdyStream;
-class TCPClientSocketPool;
-class TCPSocketParams;
+class TransportClientSocketPool;
+class TransportSocketParams;
// HttpProxySocketParams only needs the socket params for one of the proxy
// types. The other param must be NULL. When using an HTTP Proxy,
-// |tcp_params| must be set. When using an HTTPS Proxy, |ssl_params|
+// |transport_params| must be set. When using an HTTPS Proxy, |ssl_params|
// must be set.
class HttpProxySocketParams : public base::RefCounted<HttpProxySocketParams> {
public:
- HttpProxySocketParams(const scoped_refptr<TCPSocketParams>& tcp_params,
- const scoped_refptr<SSLSocketParams>& ssl_params,
- const GURL& request_url,
- const std::string& user_agent,
- HostPortPair endpoint,
- HttpAuthCache* http_auth_cache,
- HttpAuthHandlerFactory* http_auth_handler_factory,
- SpdySessionPool* spdy_session_pool,
- bool tunnel);
-
- const scoped_refptr<TCPSocketParams>& tcp_params() const {
- return tcp_params_;
+ HttpProxySocketParams(
+ const scoped_refptr<TransportSocketParams>& transport_params,
+ const scoped_refptr<SSLSocketParams>& ssl_params,
+ const GURL& request_url,
+ const std::string& user_agent,
+ HostPortPair endpoint,
+ HttpAuthCache* http_auth_cache,
+ HttpAuthHandlerFactory* http_auth_handler_factory,
+ SpdySessionPool* spdy_session_pool,
+ bool tunnel);
+
+ const scoped_refptr<TransportSocketParams>& transport_params() const {
+ return transport_params_;
}
const scoped_refptr<SSLSocketParams>& ssl_params() const {
return ssl_params_;
@@ -72,7 +73,7 @@ class HttpProxySocketParams : public base::RefCounted<HttpProxySocketParams> {
friend class base::RefCounted<HttpProxySocketParams>;
~HttpProxySocketParams();
- const scoped_refptr<TCPSocketParams> tcp_params_;
+ const scoped_refptr<TransportSocketParams> transport_params_;
const scoped_refptr<SSLSocketParams> ssl_params_;
SpdySessionPool* spdy_session_pool_;
const GURL request_url_;
@@ -93,7 +94,7 @@ class HttpProxyConnectJob : public ConnectJob {
HttpProxyConnectJob(const std::string& group_name,
const scoped_refptr<HttpProxySocketParams>& params,
const base::TimeDelta& timeout_duration,
- TCPClientSocketPool* tcp_pool,
+ TransportClientSocketPool* transport_pool,
SSLClientSocketPool* ssl_pool,
HostResolver* host_resolver,
Delegate* delegate,
@@ -125,8 +126,8 @@ class HttpProxyConnectJob : public ConnectJob {
int DoLoop(int result);
// Connecting to HTTP Proxy
- int DoTCPConnect();
- int DoTCPConnectComplete(int result);
+ int DoTransportConnect();
+ int DoTransportConnectComplete(int result);
// Connecting to HTTPS Proxy
int DoSSLConnect();
int DoSSLConnectComplete(int result);
@@ -147,7 +148,7 @@ class HttpProxyConnectJob : public ConnectJob {
virtual int ConnectInternal();
scoped_refptr<HttpProxySocketParams> params_;
- TCPClientSocketPool* const tcp_pool_;
+ TransportClientSocketPool* const transport_pool_;
SSLClientSocketPool* const ssl_pool_;
HostResolver* const resolver_;
@@ -171,7 +172,7 @@ class HttpProxyClientSocketPool : public ClientSocketPool {
int max_sockets_per_group,
ClientSocketPoolHistograms* histograms,
HostResolver* host_resolver,
- TCPClientSocketPool* tcp_pool,
+ TransportClientSocketPool* transport_pool,
SSLClientSocketPool* ssl_pool,
NetLog* net_log);
@@ -222,7 +223,7 @@ class HttpProxyClientSocketPool : public ClientSocketPool {
class HttpProxyConnectJobFactory : public PoolBase::ConnectJobFactory {
public:
HttpProxyConnectJobFactory(
- TCPClientSocketPool* tcp_pool,
+ TransportClientSocketPool* transport_pool,
SSLClientSocketPool* ssl_pool,
HostResolver* host_resolver,
NetLog* net_log);
@@ -235,7 +236,7 @@ class HttpProxyClientSocketPool : public ClientSocketPool {
virtual base::TimeDelta ConnectionTimeout() const { return timeout_; }
private:
- TCPClientSocketPool* const tcp_pool_;
+ TransportClientSocketPool* const transport_pool_;
SSLClientSocketPool* const ssl_pool_;
HostResolver* const host_resolver_;
NetLog* net_log_;
@@ -244,7 +245,7 @@ class HttpProxyClientSocketPool : public ClientSocketPool {
DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJobFactory);
};
- TCPClientSocketPool* const tcp_pool_;
+ TransportClientSocketPool* const transport_pool_;
SSLClientSocketPool* const ssl_pool_;
PoolBase base_;
diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc
index 63bb94a..fb6bef0 100644
--- a/net/http/http_proxy_client_socket_pool_unittest.cc
+++ b/net/http/http_proxy_client_socket_pool_unittest.cc
@@ -48,13 +48,14 @@ class HttpProxyClientSocketPoolTest : public TestWithHttpParam {
protected:
HttpProxyClientSocketPoolTest()
: ssl_config_(),
- ignored_tcp_socket_params_(new TCPSocketParams(
+ ignored_transport_socket_params_(new TransportSocketParams(
HostPortPair("proxy", 80), LOWEST, GURL(), false, false)),
ignored_ssl_socket_params_(new SSLSocketParams(
- ignored_tcp_socket_params_, NULL, NULL, ProxyServer::SCHEME_DIRECT,
- HostPortPair("www.google.com", 443), ssl_config_, 0, false, false)),
+ ignored_transport_socket_params_, NULL, NULL,
+ ProxyServer::SCHEME_DIRECT, HostPortPair("www.google.com", 443),
+ ssl_config_, 0, false, false)),
tcp_histograms_("MockTCP"),
- tcp_socket_pool_(
+ transport_socket_pool_(
kMaxSockets, kMaxSocketsPerGroup,
&tcp_histograms_,
&socket_factory_),
@@ -69,7 +70,7 @@ class HttpProxyClientSocketPoolTest : public TestWithHttpParam {
NULL /* dns_cert_checker */,
NULL /* ssl_host_info_factory */,
&socket_factory_,
- &tcp_socket_pool_,
+ &transport_socket_pool_,
NULL,
NULL,
ssl_config_service_.get(),
@@ -83,7 +84,7 @@ class HttpProxyClientSocketPoolTest : public TestWithHttpParam {
pool_(kMaxSockets, kMaxSocketsPerGroup,
&http_proxy_histograms_,
NULL,
- &tcp_socket_pool_,
+ &transport_socket_pool_,
&ssl_socket_pool_,
NULL) {
}
@@ -103,10 +104,10 @@ class HttpProxyClientSocketPoolTest : public TestWithHttpParam {
"/");
}
- scoped_refptr<TCPSocketParams> GetTcpParams() {
+ scoped_refptr<TransportSocketParams> GetTcpParams() {
if (GetParam() != HTTP)
- return scoped_refptr<TCPSocketParams>();
- return ignored_tcp_socket_params_;
+ return scoped_refptr<TransportSocketParams>();
+ return ignored_transport_socket_params_;
}
scoped_refptr<SSLSocketParams> GetSslParams() {
@@ -189,11 +190,11 @@ class HttpProxyClientSocketPoolTest : public TestWithHttpParam {
private:
SSLConfig ssl_config_;
- scoped_refptr<TCPSocketParams> ignored_tcp_socket_params_;
+ scoped_refptr<TransportSocketParams> ignored_transport_socket_params_;
scoped_refptr<SSLSocketParams> ignored_ssl_socket_params_;
ClientSocketPoolHistograms tcp_histograms_;
DeterministicMockClientSocketFactory socket_factory_;
- MockTCPClientSocketPool tcp_socket_pool_;
+ MockTransportClientSocketPool transport_socket_pool_;
ClientSocketPoolHistograms ssl_histograms_;
MockHostResolver host_resolver_;
CertVerifier cert_verifier_;
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc
index 09c17ea..401ba7d 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -24,7 +24,6 @@
#include "net/socket/socks_client_socket_pool.h"
#include "net/socket/ssl_client_socket.h"
#include "net/socket/ssl_client_socket_pool.h"
-#include "net/socket/tcp_client_socket_pool.h"
#include "net/spdy/spdy_http_stream.h"
#include "net/spdy/spdy_session.h"
#include "net/spdy/spdy_session_pool.h"
diff --git a/net/http/http_stream_factory_impl_job.h b/net/http/http_stream_factory_impl_job.h
index d4335c8..a12d108 100644
--- a/net/http/http_stream_factory_impl_job.h
+++ b/net/http/http_stream_factory_impl_job.h
@@ -28,7 +28,7 @@ class HttpProxySocketParams;
class HttpStream;
class SOCKSSocketParams;
class SSLSocketParams;
-class TCPSocketParams;
+class TransportSocketParams;
// An HttpStreamRequestImpl exists for each stream which is in progress of being
// created for the StreamFactory.
diff --git a/net/http/http_stream_factory_impl_unittest.cc b/net/http/http_stream_factory_impl_unittest.cc
index f316251..4246059 100644
--- a/net/http/http_stream_factory_impl_unittest.cc
+++ b/net/http/http_stream_factory_impl_unittest.cc
@@ -183,8 +183,8 @@ class CapturePreconnectsSocketPool : public ParentPool {
int last_num_streams_;
};
-typedef CapturePreconnectsSocketPool<TCPClientSocketPool>
-CapturePreconnectsTCPSocketPool;
+typedef CapturePreconnectsSocketPool<TransportClientSocketPool>
+CapturePreconnectsTransportSocketPool;
typedef CapturePreconnectsSocketPool<HttpProxyClientSocketPool>
CapturePreconnectsHttpProxySocketPool;
typedef CapturePreconnectsSocketPool<SOCKSClientSocketPool>
@@ -216,11 +216,11 @@ TEST(HttpStreamFactoryTest, PreconnectDirect) {
SessionDependencies session_deps(ProxyService::CreateDirect());
scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps));
HttpNetworkSessionPeer peer(session);
- CapturePreconnectsTCPSocketPool* tcp_conn_pool =
- new CapturePreconnectsTCPSocketPool(
+ CapturePreconnectsTransportSocketPool* transport_conn_pool =
+ new CapturePreconnectsTransportSocketPool(
session_deps.host_resolver.get(),
session_deps.cert_verifier.get());
- peer.SetTCPSocketPool(tcp_conn_pool);
+ peer.SetTransportSocketPool(transport_conn_pool);
CapturePreconnectsSSLSocketPool* ssl_conn_pool =
new CapturePreconnectsSSLSocketPool(
session_deps.host_resolver.get(),
@@ -230,7 +230,7 @@ TEST(HttpStreamFactoryTest, PreconnectDirect) {
if (kTests[i].ssl)
EXPECT_EQ(kTests[i].num_streams, ssl_conn_pool->last_num_streams());
else
- EXPECT_EQ(kTests[i].num_streams, tcp_conn_pool->last_num_streams());
+ EXPECT_EQ(kTests[i].num_streams, transport_conn_pool->last_num_streams());
}
}
@@ -295,11 +295,11 @@ TEST(HttpStreamFactoryTest, PreconnectDirectWithExistingSpdySession) {
scoped_refptr<SpdySession> spdy_session =
session->spdy_session_pool()->Get(pair, BoundNetLog());
- CapturePreconnectsTCPSocketPool* tcp_conn_pool =
- new CapturePreconnectsTCPSocketPool(
+ CapturePreconnectsTransportSocketPool* transport_conn_pool =
+ new CapturePreconnectsTransportSocketPool(
session_deps.host_resolver.get(),
session_deps.cert_verifier.get());
- peer.SetTCPSocketPool(tcp_conn_pool);
+ peer.SetTransportSocketPool(transport_conn_pool);
CapturePreconnectsSSLSocketPool* ssl_conn_pool =
new CapturePreconnectsSSLSocketPool(
session_deps.host_resolver.get(),
@@ -311,7 +311,7 @@ TEST(HttpStreamFactoryTest, PreconnectDirectWithExistingSpdySession) {
if (kTests[i].ssl)
EXPECT_EQ(-1, ssl_conn_pool->last_num_streams());
else
- EXPECT_EQ(kTests[i].num_streams, tcp_conn_pool->last_num_streams());
+ EXPECT_EQ(kTests[i].num_streams, transport_conn_pool->last_num_streams());
}
}