diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-14 14:56:27 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-14 14:56:27 +0000 |
commit | 88a2c4078d51ef9c5aec9270d8f72e517ad94e4e (patch) | |
tree | a81dd5083fccc7f60028a25ecb554916ba26cf80 /net | |
parent | dd43578d4929c6502944871bc752905d5b61566f (diff) | |
download | chromium_src-88a2c4078d51ef9c5aec9270d8f72e517ad94e4e.zip chromium_src-88a2c4078d51ef9c5aec9270d8f72e517ad94e4e.tar.gz chromium_src-88a2c4078d51ef9c5aec9270d8f72e517ad94e4e.tar.bz2 |
Trying to green up the tree, lots of mac and win red around this cl.
Revert 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
TBR=tfarina@chromium.org
Review URL: http://codereview.chromium.org/3444001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59373 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/http/http_network_layer_unittest.cc | 12 | ||||
-rw-r--r-- | net/http/http_network_transaction_unittest.cc | 6 | ||||
-rw-r--r-- | net/http/http_proxy_client_socket_pool_unittest.cc | 2 | ||||
-rw-r--r-- | net/proxy/proxy_service.cc | 2 | ||||
-rw-r--r-- | net/proxy/proxy_service.h | 6 | ||||
-rw-r--r-- | net/socket/ssl_client_socket_pool_unittest.cc | 2 | ||||
-rw-r--r-- | net/spdy/spdy_stream_unittest.cc | 5 | ||||
-rw-r--r-- | net/spdy/spdy_test_util.h | 4 | ||||
-rw-r--r-- | net/tools/fetch/fetch_client.cc | 2 | ||||
-rw-r--r-- | net/url_request/url_request_unittest.h | 2 |
10 files changed, 25 insertions, 18 deletions
diff --git a/net/http/http_network_layer_unittest.cc b/net/http/http_network_layer_unittest.cc index 27822ed..274d2dc 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::CreateDirect(), new net::SSLConfigServiceDefaults, - NULL, NULL, NULL); + net::ProxyService::CreateNull(), 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::CreateDirect(), new net::SSLConfigServiceDefaults, - NULL, NULL, NULL); + net::ProxyService::CreateNull(), 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::CreateDirect(), new net::SSLConfigServiceDefaults, - NULL, NULL, NULL); + net::ProxyService::CreateNull(), 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 c483000..41873da 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::CreateDirect()), + proxy_service(ProxyService::CreateNull()), 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::CreateDirect(); + session_deps.proxy_service = ProxyService::CreateNull(); } 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::CreateDirect(); + session_deps.proxy_service = ProxyService::CreateNull(); 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 a1190cb..dcc893e 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::CreateDirect(), + ProxyService::CreateNull(), &socket_factory_, new SSLConfigServiceDefaults, new SpdySessionPool(NULL), diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc index c74b8b0..3d1539f 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::CreateDirect() { +ProxyService* ProxyService::CreateNull() { // 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 8e53970..990830e 100644 --- a/net/proxy/proxy_service.h +++ b/net/proxy/proxy_service.h @@ -177,8 +177,10 @@ 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 uses a DIRECT connection for all requests. - static ProxyService* CreateDirect(); + // 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(); // 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 378356d..90eb319 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::CreateDirect(), + ProxyService::CreateNull(), &socket_factory_, new SSLConfigServiceDefaults, new SpdySessionPool(NULL), diff --git a/net/spdy/spdy_stream_unittest.cc b/net/spdy/spdy_stream_unittest.cc index 392fb3b..57afd53 100644 --- a/net/spdy/spdy_stream_unittest.cc +++ b/net/spdy/spdy_stream_unittest.cc @@ -28,6 +28,11 @@ 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 c30cb5c..3d7ce0c 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::CreateDirect()), + proxy_service(ProxyService::CreateNull()), 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::CreateDirect(); + proxy_service_ = ProxyService::CreateNull(); 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 9adf20b..933f676 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::CreateDirect()); + net::ProxyService::CreateNull()); 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 9ee9591..e0492ab 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::CreateDirect(); + proxy_service_ = net::ProxyService::CreateNull(); Init(); } |