summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-15 05:10:02 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-15 05:10:02 +0000
commitebeefff3de6b22ea1447f768399f5fba14820ca8 (patch)
treeb8923c352b5c316a38a40a14985e87ba7c778b10 /net
parent38c56c73e185a306b66a9d10ce37a06bf34c70d0 (diff)
downloadchromium_src-ebeefff3de6b22ea1447f768399f5fba14820ca8.zip
chromium_src-ebeefff3de6b22ea1447f768399f5fba14820ca8.tar.gz
chromium_src-ebeefff3de6b22ea1447f768399f5fba14820ca8.tar.bz2
Reland 59362 - net: Rename ProxyService::CreateNull to ProxyService::CreateDirect.
(Note: This was a TODO for eroman). BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3336021 Revert Review URL: http://codereview.chromium.org/3444001/show TBR=eroman@chromium.org Fix the bad git svn rebase (that caused a bad merge, that integrates other files in the original cl, now this should be fixed). Review URL: http://codereview.chromium.org/3413008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59481 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/http/http_network_layer_unittest.cc12
-rw-r--r--net/http/http_network_transaction_unittest.cc6
-rw-r--r--net/http/http_proxy_client_socket_pool_unittest.cc2
-rw-r--r--net/proxy/proxy_service.cc2
-rw-r--r--net/proxy/proxy_service.h6
-rw-r--r--net/socket/ssl_client_socket_pool_unittest.cc2
-rw-r--r--net/spdy/spdy_stream_unittest.cc5
-rw-r--r--net/spdy/spdy_test_util.h4
-rw-r--r--net/tools/fetch/fetch_client.cc2
-rw-r--r--net/url_request/url_request_unittest.h2
10 files changed, 18 insertions, 25 deletions
diff --git a/net/http/http_network_layer_unittest.cc b/net/http/http_network_layer_unittest.cc
index 274d2dc..27822ed 100644
--- a/net/http/http_network_layer_unittest.cc
+++ b/net/http/http_network_layer_unittest.cc
@@ -17,8 +17,8 @@ class HttpNetworkLayerTest : public PlatformTest {
TEST_F(HttpNetworkLayerTest, CreateAndDestroy) {
net::HttpNetworkLayer factory(NULL, new net::MockHostResolver,
- net::ProxyService::CreateNull(), new net::SSLConfigServiceDefaults, NULL,
- NULL, NULL);
+ net::ProxyService::CreateDirect(), new net::SSLConfigServiceDefaults,
+ NULL, NULL, NULL);
scoped_ptr<net::HttpTransaction> trans;
int rv = factory.CreateTransaction(&trans);
@@ -28,8 +28,8 @@ TEST_F(HttpNetworkLayerTest, CreateAndDestroy) {
TEST_F(HttpNetworkLayerTest, Suspend) {
net::HttpNetworkLayer factory(NULL, new net::MockHostResolver,
- net::ProxyService::CreateNull(), new net::SSLConfigServiceDefaults, NULL,
- NULL, NULL);
+ net::ProxyService::CreateDirect(), new net::SSLConfigServiceDefaults,
+ NULL, NULL, NULL);
scoped_ptr<net::HttpTransaction> trans;
int rv = factory.CreateTransaction(&trans);
@@ -68,8 +68,8 @@ TEST_F(HttpNetworkLayerTest, GET) {
mock_socket_factory.AddSocketDataProvider(&data);
net::HttpNetworkLayer factory(&mock_socket_factory, new net::MockHostResolver,
- net::ProxyService::CreateNull(), new net::SSLConfigServiceDefaults, NULL,
- NULL, NULL);
+ net::ProxyService::CreateDirect(), new net::SSLConfigServiceDefaults,
+ NULL, NULL, NULL);
TestCompletionCallback callback;
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 41873da..c483000 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -110,7 +110,7 @@ struct SessionDependencies {
// Default set of dependencies -- "null" proxy service.
SessionDependencies()
: host_resolver(new MockHostResolver),
- proxy_service(ProxyService::CreateNull()),
+ proxy_service(ProxyService::CreateDirect()),
ssl_config_service(new SSLConfigServiceDefaults),
http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault()),
spdy_session_pool(new SpdySessionPool(NULL)),
@@ -6521,7 +6521,7 @@ TEST_F(HttpNetworkTransactionTest, GenerateAuthToken) {
session_deps.proxy_service =
CreateFixedProxyService(test_config.proxy_url);
} else {
- session_deps.proxy_service = ProxyService::CreateNull();
+ session_deps.proxy_service = ProxyService::CreateDirect();
}
HttpRequestInfo request;
@@ -6600,7 +6600,7 @@ TEST_F(HttpNetworkTransactionTest, MultiRoundAuth) {
HttpAuthHandlerMock::Factory* auth_factory(
new HttpAuthHandlerMock::Factory());
session_deps.http_auth_handler_factory.reset(auth_factory);
- session_deps.proxy_service = ProxyService::CreateNull();
+ session_deps.proxy_service = ProxyService::CreateDirect();
session_deps.host_resolver->rules()->AddRule("www.example.com", "10.0.0.1");
session_deps.host_resolver->set_synchronous_mode(true);
diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc
index dcc893e..a1190cb 100644
--- a/net/http/http_proxy_client_socket_pool_unittest.cc
+++ b/net/http/http_proxy_client_socket_pool_unittest.cc
@@ -52,7 +52,7 @@ class HttpProxyClientSocketPoolTest : public TestWithHttpParam {
kMaxSocketsPerGroup, tcp_histograms_, &tcp_client_socket_factory_)),
http_auth_handler_factory_(HttpAuthHandlerFactory::CreateDefault()),
session_(new HttpNetworkSession(new MockHostResolver,
- ProxyService::CreateNull(),
+ ProxyService::CreateDirect(),
&socket_factory_,
new SSLConfigServiceDefaults,
new SpdySessionPool(NULL),
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 3d1539f..c74b8b0 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -426,7 +426,7 @@ ProxyService* ProxyService::CreateFixed(const ProxyConfig& pc) {
}
// static
-ProxyService* ProxyService::CreateNull() {
+ProxyService* ProxyService::CreateDirect() {
// Use direct connections.
return new ProxyService(new ProxyConfigServiceDirect, new ProxyResolverNull,
NULL);
diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h
index 990830e..8e53970 100644
--- a/net/proxy/proxy_service.h
+++ b/net/proxy/proxy_service.h
@@ -177,10 +177,8 @@ class ProxyService : public base::RefCountedThreadSafe<ProxyService>,
// specified fixed settings. |pc| must not be NULL.
static ProxyService* CreateFixed(const ProxyConfig& pc);
- // Creates a proxy service that always fails to fetch the proxy configuration,
- // so it falls back to direct connect.
- // TODO(eroman): Rename to CreateDirect().
- static ProxyService* CreateNull();
+ // Creates a proxy service that uses a DIRECT connection for all requests.
+ static ProxyService* CreateDirect();
// This method is used by tests to create a ProxyService that returns a
// hardcoded proxy fallback list (|pac_string|) for every URL.
diff --git a/net/socket/ssl_client_socket_pool_unittest.cc b/net/socket/ssl_client_socket_pool_unittest.cc
index 90eb319..378356d 100644
--- a/net/socket/ssl_client_socket_pool_unittest.cc
+++ b/net/socket/ssl_client_socket_pool_unittest.cc
@@ -37,7 +37,7 @@ class SSLClientSocketPoolTest : public ClientSocketPoolTest {
SSLClientSocketPoolTest()
: http_auth_handler_factory_(HttpAuthHandlerFactory::CreateDefault()),
session_(new HttpNetworkSession(new MockHostResolver,
- ProxyService::CreateNull(),
+ ProxyService::CreateDirect(),
&socket_factory_,
new SSLConfigServiceDefaults,
new SpdySessionPool(NULL),
diff --git a/net/spdy/spdy_stream_unittest.cc b/net/spdy/spdy_stream_unittest.cc
index 57afd53..392fb3b 100644
--- a/net/spdy/spdy_stream_unittest.cc
+++ b/net/spdy/spdy_stream_unittest.cc
@@ -28,11 +28,6 @@ class SpdySessionPoolPeer {
namespace {
-// Create a proxy service which fails on all requests (falls back to direct).
-ProxyService* CreateNullProxyService() {
- return ProxyService::CreateNull();
-}
-
class TestSpdyStreamDelegate : public SpdyStream::Delegate {
public:
TestSpdyStreamDelegate(SpdyStream* stream,
diff --git a/net/spdy/spdy_test_util.h b/net/spdy/spdy_test_util.h
index 3d7ce0c..c30cb5c 100644
--- a/net/spdy/spdy_test_util.h
+++ b/net/spdy/spdy_test_util.h
@@ -300,7 +300,7 @@ class SpdySessionDependencies {
// Default set of dependencies -- "null" proxy service.
SpdySessionDependencies()
: host_resolver(new MockHostResolver),
- proxy_service(ProxyService::CreateNull()),
+ proxy_service(ProxyService::CreateDirect()),
ssl_config_service(new SSLConfigServiceDefaults),
socket_factory(new MockClientSocketFactory),
deterministic_socket_factory(new DeterministicMockClientSocketFactory),
@@ -362,7 +362,7 @@ class SpdyURLRequestContext : public URLRequestContext {
public:
SpdyURLRequestContext() {
host_resolver_ = new MockHostResolver;
- proxy_service_ = ProxyService::CreateNull();
+ proxy_service_ = ProxyService::CreateDirect();
spdy_session_pool_ = new SpdySessionPool(NULL);
ssl_config_service_ = new SSLConfigServiceDefaults;
http_auth_handler_factory_ = HttpAuthHandlerFactory::CreateDefault();
diff --git a/net/tools/fetch/fetch_client.cc b/net/tools/fetch/fetch_client.cc
index 933f676..9adf20b 100644
--- a/net/tools/fetch/fetch_client.cc
+++ b/net/tools/fetch/fetch_client.cc
@@ -140,7 +140,7 @@ int main(int argc, char**argv) {
NULL));
scoped_refptr<net::ProxyService> proxy_service(
- net::ProxyService::CreateNull());
+ net::ProxyService::CreateDirect());
scoped_refptr<net::SSLConfigService> ssl_config_service(
net::SSLConfigService::CreateSystemSSLConfigService());
net::HttpTransactionFactory* factory = NULL;
diff --git a/net/url_request/url_request_unittest.h b/net/url_request/url_request_unittest.h
index e0492ab..9ee9591 100644
--- a/net/url_request/url_request_unittest.h
+++ b/net/url_request/url_request_unittest.h
@@ -127,7 +127,7 @@ class TestURLRequestContext : public URLRequestContext {
host_resolver_ =
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
NULL);
- proxy_service_ = net::ProxyService::CreateNull();
+ proxy_service_ = net::ProxyService::CreateDirect();
Init();
}