Skip to content

Commit

Permalink
Trying to green up the tree, lots of mac and win red around this cl.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
thomasvl@chromium.org committed Sep 14, 2010
1 parent dd43578 commit 88a2c40
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
web_prefs.accelerated_compositing_enabled =
!command_line.HasSwitch(switches::kDisableAcceleratedCompositing);
web_prefs.accelerated_2d_canvas_enabled =
!command_line.HasSwitch(switches::kDisableAccelerated2dCanvas);
command_line.HasSwitch(switches::kEnableAccelerated2dCanvas);
web_prefs.memory_info_enabled =
command_line.HasSwitch(switches::kEnableMemoryInfo);
// The user stylesheet watcher may not exist in a testing profile.
Expand Down
6 changes: 3 additions & 3 deletions chrome/common/chrome_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ const char kDebugPrint[] = "debug-print";
// Triggers a pletora of diagnostic modes.
const char kDiagnostics[] = "diagnostics";

// Disable gpu-accelerated 2d canvas.
const char kDisableAccelerated2dCanvas[] = "disable-accelerated-2d-canvas";

// Disables accelerated compositing.
const char kDisableAcceleratedCompositing[] =
"disable-accelerated-compositing";
Expand Down Expand Up @@ -355,6 +352,9 @@ const char kDumpHistogramsOnExit[] = "dump-histograms-on-exit";
// Enable displaying net log events on the command line.
extern const char kLogNetLog[] = "log-net-log";

// Enable gpu-accelerated 2d canvas.
const char kEnableAccelerated2dCanvas[] = "enable-accelerated-2d-canvas";

// Enables AeroPeek for each tab. (This switch only works on Windows 7).
const char kEnableAeroPeekTabs[] = "enable-aero-peek-tabs";

Expand Down
2 changes: 1 addition & 1 deletion chrome/common/chrome_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ extern const char kDnsLogDetails[];
extern const char kDnsPrefetchDisable[];
extern const char kDomAutomationController[];
extern const char kDumpHistogramsOnExit[];
extern const char kDisableAccelerated2dCanvas[];
extern const char kEnableAccelerated2dCanvas[];
extern const char kEnableAeroPeekTabs[];
extern const char kEnableAuthNegotiatePort[];
extern const char kEnableBackgroundMode[];
Expand Down
2 changes: 1 addition & 1 deletion chrome_frame/test/test_server_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class URLRequestTestContext : public URLRequestContext {
host_resolver_ =
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
NULL);
proxy_service_ = net::ProxyService::CreateDirect();
proxy_service_ = net::ProxyService::CreateNull();
ssl_config_service_ = new net::SSLConfigServiceDefaults;
http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault();
http_transaction_factory_ = new net::HttpCache(
Expand Down
12 changes: 6 additions & 6 deletions net/http/http_network_layer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions net/http/http_network_transaction_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion net/http/http_proxy_client_socket_pool_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion net/proxy/proxy_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions net/proxy/proxy_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion net/socket/ssl_client_socket_pool_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
5 changes: 5 additions & 0 deletions net/spdy/spdy_stream_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions net/spdy/spdy_test_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion net/tools/fetch/fetch_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion net/url_request/url_request_unittest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 88a2c40

Please sign in to comment.