summaryrefslogtreecommitdiffstats
path: root/net/proxy
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 04:54:46 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 04:54:46 +0000
commit684970b638fbfe1a2137fd162f630c86d2859828 (patch)
treeb74fafda6801aa5c9e8746c230b8a2880a1de585 /net/proxy
parentc4deb899d3293782beeb8d83eefc226a5fb1813e (diff)
downloadchromium_src-684970b638fbfe1a2137fd162f630c86d2859828.zip
chromium_src-684970b638fbfe1a2137fd162f630c86d2859828.tar.gz
chromium_src-684970b638fbfe1a2137fd162f630c86d2859828.tar.bz2
LoadLog is used as an output parameter, reorder it to the last parameter.
Review URL: http://codereview.chromium.org/164531 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23419 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy')
-rw-r--r--net/proxy/proxy_resolver_js_bindings.cc4
-rw-r--r--net/proxy/proxy_service.cc38
-rw-r--r--net/proxy/proxy_service.h23
-rw-r--r--net/proxy/proxy_service_unittest.cc140
4 files changed, 102 insertions, 103 deletions
diff --git a/net/proxy/proxy_resolver_js_bindings.cc b/net/proxy/proxy_resolver_js_bindings.cc
index 723c91e..94d6448 100644
--- a/net/proxy/proxy_resolver_js_bindings.cc
+++ b/net/proxy/proxy_resolver_js_bindings.cc
@@ -38,7 +38,7 @@ class SyncHostResolverBridge
// Hack for tests -- run synchronously on current thread.
if (!host_resolver_loop_)
- return host_resolver_->Resolve(NULL, info, addresses, NULL, NULL);
+ return host_resolver_->Resolve(info, addresses, NULL, NULL, NULL);
// Otherwise start an async resolve on the resolver's thread.
host_resolver_loop_->PostTask(FROM_HERE, NewRunnableMethod(this,
@@ -55,7 +55,7 @@ class SyncHostResolverBridge
net::AddressList* addresses) {
DCHECK_EQ(host_resolver_loop_, MessageLoop::current());
int error = host_resolver_->Resolve(
- NULL, info, addresses, &callback_, NULL);
+ info, addresses, &callback_, NULL, NULL);
if (error != ERR_IO_PENDING)
OnResolveCompletion(error); // Completed synchronously.
}
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 43b7cfe..43e6808 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -246,11 +246,11 @@ ProxyService* ProxyService::CreateNull() {
return new ProxyService(new ProxyConfigServiceNull, new ProxyResolverNull);
}
-int ProxyService::ResolveProxy(LoadLog* load_log,
- const GURL& raw_url,
+int ProxyService::ResolveProxy(const GURL& raw_url,
ProxyInfo* result,
CompletionCallback* callback,
- PacRequest** pac_request) {
+ PacRequest** pac_request,
+ LoadLog* load_log) {
DCHECK(callback);
// Strip away any reference fragments and the username/password, as they
@@ -405,11 +405,11 @@ void ProxyService::OnInitProxyResolverComplete(int result) {
ResumeAllPendingRequests();
}
-int ProxyService::ReconsiderProxyAfterError(LoadLog* load_log,
- const GURL& url,
+int ProxyService::ReconsiderProxyAfterError(const GURL& url,
ProxyInfo* result,
CompletionCallback* callback,
- PacRequest** pac_request) {
+ PacRequest** pac_request,
+ LoadLog* load_log) {
// Check to see if we have a new config since ResolveProxy was called. We
// want to re-run ResolveProxy in two cases: 1) we have a new config, or 2) a
// direct connection failed and we never tried the current config.
@@ -432,7 +432,7 @@ int ProxyService::ReconsiderProxyAfterError(LoadLog* load_log,
// If we have a new config or the config was never tried, we delete the
// list of bad proxies and we try again.
proxy_retry_info_.clear();
- return ResolveProxy(load_log, url, result, callback, pac_request);
+ return ResolveProxy(url, result, callback, pac_request, load_log);
}
// We don't have new proxy settings to try, fallback to the next proxy
@@ -702,13 +702,13 @@ SyncProxyServiceHelper::SyncProxyServiceHelper(MessageLoop* io_message_loop,
DCHECK(io_message_loop_ != MessageLoop::current());
}
-int SyncProxyServiceHelper::ResolveProxy(LoadLog* load_log,
- const GURL& url,
- ProxyInfo* proxy_info) {
+int SyncProxyServiceHelper::ResolveProxy(const GURL& url,
+ ProxyInfo* proxy_info,
+ LoadLog* load_log) {
DCHECK(io_message_loop_ != MessageLoop::current());
io_message_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &SyncProxyServiceHelper::StartAsyncResolve, load_log, url));
+ this, &SyncProxyServiceHelper::StartAsyncResolve, url, load_log));
event_.Wait();
@@ -719,11 +719,11 @@ int SyncProxyServiceHelper::ResolveProxy(LoadLog* load_log,
}
int SyncProxyServiceHelper::ReconsiderProxyAfterError(
- LoadLog* load_log, const GURL& url, ProxyInfo* proxy_info) {
+ const GURL& url, ProxyInfo* proxy_info, LoadLog* load_log) {
DCHECK(io_message_loop_ != MessageLoop::current());
io_message_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &SyncProxyServiceHelper::StartAsyncReconsider, load_log, url));
+ this, &SyncProxyServiceHelper::StartAsyncReconsider, url, load_log));
event_.Wait();
@@ -733,19 +733,19 @@ int SyncProxyServiceHelper::ReconsiderProxyAfterError(
return result_;
}
-void SyncProxyServiceHelper::StartAsyncResolve(LoadLog* load_log,
- const GURL& url) {
+void SyncProxyServiceHelper::StartAsyncResolve(const GURL& url,
+ LoadLog* load_log) {
result_ = proxy_service_->ResolveProxy(
- load_log, url, &proxy_info_, &callback_, NULL);
+ url, &proxy_info_, &callback_, NULL, load_log);
if (result_ != net::ERR_IO_PENDING) {
OnCompletion(result_);
}
}
-void SyncProxyServiceHelper::StartAsyncReconsider(LoadLog* load_log,
- const GURL& url) {
+void SyncProxyServiceHelper::StartAsyncReconsider(const GURL& url,
+ LoadLog* load_log) {
result_ = proxy_service_->ReconsiderProxyAfterError(
- load_log, url, &proxy_info_, &callback_, NULL);
+ url, &proxy_info_, &callback_, NULL, load_log);
if (result_ != net::ERR_IO_PENDING) {
OnCompletion(result_);
}
diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h
index 12b5262..994cb5a 100644
--- a/net/proxy/proxy_service.h
+++ b/net/proxy/proxy_service.h
@@ -64,11 +64,11 @@ class ProxyService {
// 3. named proxy
//
// Profiling information for the request is saved to |load_log| if non-NULL.
- int ResolveProxy(LoadLog* load_log,
- const GURL& url,
+ int ResolveProxy(const GURL& url,
ProxyInfo* results,
CompletionCallback* callback,
- PacRequest** pac_request);
+ PacRequest** pac_request,
+ LoadLog* load_log);
// This method is called after a failure to connect or resolve a host name.
// It gives the proxy service an opportunity to reconsider the proxy to use.
@@ -82,11 +82,11 @@ class ProxyService {
// Returns ERR_FAILED if there is not another proxy config to try.
//
// Profiling information for the request is saved to |load_log| if non-NULL.
- int ReconsiderProxyAfterError(LoadLog* load_log,
- const GURL& url,
+ int ReconsiderProxyAfterError(const GURL& url,
ProxyInfo* results,
CompletionCallback* callback,
- PacRequest** pac_request);
+ PacRequest** pac_request,
+ LoadLog* load_log);
// Call this method with a non-null |pac_request| to cancel the PAC request.
void CancelPacRequest(PacRequest* pac_request);
@@ -266,14 +266,13 @@ class SyncProxyServiceHelper
SyncProxyServiceHelper(MessageLoop* io_message_loop,
ProxyService* proxy_service);
- int ResolveProxy(LoadLog* load_log, const GURL& url, ProxyInfo* proxy_info);
- int ReconsiderProxyAfterError(LoadLog* load_log,
- const GURL& url,
- ProxyInfo* proxy_info);
+ int ResolveProxy(const GURL& url, ProxyInfo* proxy_info, LoadLog* load_log);
+ int ReconsiderProxyAfterError(const GURL& url,
+ ProxyInfo* proxy_info, LoadLog* load_log);
private:
- void StartAsyncResolve(LoadLog* load_log, const GURL& url);
- void StartAsyncReconsider(LoadLog* load_log, const GURL& url);
+ void StartAsyncResolve(const GURL& url, LoadLog* load_log);
+ void StartAsyncReconsider(const GURL& url, LoadLog* load_log);
void OnCompletion(int result);
diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc
index 8a2fb98..3fde148 100644
--- a/net/proxy/proxy_service_unittest.cc
+++ b/net/proxy/proxy_service_unittest.cc
@@ -92,7 +92,7 @@ TEST(ProxyServiceTest, Direct) {
ProxyInfo info;
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(resolver->pending_requests().empty());
@@ -111,7 +111,7 @@ TEST(ProxyServiceTest, PAC) {
ProxyInfo info;
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(url, &info, &callback, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(GURL("http://foopy/proxy.pac"),
@@ -144,7 +144,7 @@ TEST(ProxyServiceTest, PAC_NoIdentityOrHash) {
ProxyInfo info;
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(url, &info, &callback, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(GURL("http://foopy/proxy.pac"),
@@ -171,7 +171,7 @@ TEST(ProxyServiceTest, PAC_FailoverToDirect) {
ProxyInfo info;
TestCompletionCallback callback1;
- int rv = service.ResolveProxy(NULL, url, &info, &callback1, NULL);
+ int rv = service.ResolveProxy(url, &info, &callback1, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(GURL("http://foopy/proxy.pac"),
@@ -191,7 +191,7 @@ TEST(ProxyServiceTest, PAC_FailoverToDirect) {
// Now, imagine that connecting to foopy:8080 fails.
TestCompletionCallback callback2;
- rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback2, NULL);
+ rv = service.ReconsiderProxyAfterError(url, &info, &callback2, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info.is_direct());
}
@@ -213,7 +213,7 @@ TEST(ProxyServiceTest, ProxyResolverFails) {
GURL url("http://www.google.com/");
ProxyInfo info;
TestCompletionCallback callback1;
- int rv = service.ResolveProxy(NULL, url, &info, &callback1, NULL);
+ int rv = service.ResolveProxy(url, &info, &callback1, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(GURL("http://foopy/proxy.pac"),
@@ -231,7 +231,7 @@ TEST(ProxyServiceTest, ProxyResolverFails) {
// The second resolve request will automatically select direct connect,
// because it has cached the configuration as being bad.
TestCompletionCallback callback2;
- rv = service.ResolveProxy(NULL, url, &info, &callback2, NULL);
+ rv = service.ResolveProxy(url, &info, &callback2, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info.is_direct());
EXPECT_TRUE(resolver->pending_requests().empty());
@@ -239,7 +239,7 @@ TEST(ProxyServiceTest, ProxyResolverFails) {
// But, if that fails, then we should give the proxy config another shot
// since we have never tried it with this URL before.
TestCompletionCallback callback3;
- rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback3, NULL);
+ rv = service.ReconsiderProxyAfterError(url, &info, &callback3, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
ASSERT_EQ(1u, resolver->pending_requests().size());
@@ -270,7 +270,7 @@ TEST(ProxyServiceTest, ProxyFallback) {
// Get the proxy information.
ProxyInfo info;
TestCompletionCallback callback1;
- int rv = service.ResolveProxy(NULL, url, &info, &callback1, NULL);
+ int rv = service.ResolveProxy(url, &info, &callback1, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(GURL("http://foopy/proxy.pac"),
@@ -292,14 +292,14 @@ TEST(ProxyServiceTest, ProxyFallback) {
// Fake an error on the proxy.
TestCompletionCallback callback2;
- rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback2, NULL);
+ rv = service.ReconsiderProxyAfterError(url, &info, &callback2, NULL, NULL);
EXPECT_EQ(OK, rv);
// The second proxy should be specified.
EXPECT_EQ("foopy2:9090", info.proxy_server().ToURI());
TestCompletionCallback callback3;
- rv = service.ResolveProxy(NULL, url, &info, &callback3, NULL);
+ rv = service.ResolveProxy(url, &info, &callback3, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
ASSERT_EQ(1u, resolver->pending_requests().size());
@@ -317,19 +317,19 @@ TEST(ProxyServiceTest, ProxyFallback) {
// We fake another error. It should now try the third one.
TestCompletionCallback callback4;
- rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback4, NULL);
+ rv = service.ReconsiderProxyAfterError(url, &info, &callback4, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_EQ("foopy2:9090", info.proxy_server().ToURI());
// Fake another error, the last proxy is gone, the list should now be empty.
TestCompletionCallback callback5;
- rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback5, NULL);
+ rv = service.ReconsiderProxyAfterError(url, &info, &callback5, NULL, NULL);
EXPECT_EQ(OK, rv); // We try direct.
EXPECT_TRUE(info.is_direct());
// If it fails again, we don't have anything else to try.
TestCompletionCallback callback6;
- rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback6, NULL);
+ rv = service.ReconsiderProxyAfterError(url, &info, &callback6, NULL, NULL);
EXPECT_EQ(ERR_FAILED, rv);
// TODO(nsylvain): Test that the proxy can be retried after the delay.
@@ -350,7 +350,7 @@ TEST(ProxyServiceTest, ProxyFallback_NewSettings) {
// Get the proxy information.
ProxyInfo info;
TestCompletionCallback callback1;
- int rv = service.ResolveProxy(NULL, url, &info, &callback1, NULL);
+ int rv = service.ResolveProxy(url, &info, &callback1, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(GURL("http://foopy/proxy.pac"),
@@ -375,7 +375,7 @@ TEST(ProxyServiceTest, ProxyFallback_NewSettings) {
config_service->config.pac_url = GURL("http://foopy-new/proxy.pac");
TestCompletionCallback callback2;
- rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback2, NULL);
+ rv = service.ReconsiderProxyAfterError(url, &info, &callback2, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(GURL("http://foopy-new/proxy.pac"),
@@ -395,7 +395,7 @@ TEST(ProxyServiceTest, ProxyFallback_NewSettings) {
// We fake another error. It should now ignore the first one.
TestCompletionCallback callback3;
- rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback3, NULL);
+ rv = service.ReconsiderProxyAfterError(url, &info, &callback3, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_EQ("foopy2:9090", info.proxy_server().ToURI());
@@ -405,7 +405,7 @@ TEST(ProxyServiceTest, ProxyFallback_NewSettings) {
// We fake another error. It should go back to the first proxy.
TestCompletionCallback callback4;
- rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback4, NULL);
+ rv = service.ReconsiderProxyAfterError(url, &info, &callback4, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(GURL("http://foopy-new2/proxy.pac"),
@@ -438,7 +438,7 @@ TEST(ProxyServiceTest, ProxyFallback_BadConfig) {
// Get the proxy information.
ProxyInfo info;
TestCompletionCallback callback1;
- int rv = service.ResolveProxy(NULL, url, &info, &callback1, NULL);
+ int rv = service.ResolveProxy(url, &info, &callback1, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(GURL("http://foopy/proxy.pac"),
@@ -458,7 +458,7 @@ TEST(ProxyServiceTest, ProxyFallback_BadConfig) {
// Fake a proxy error.
TestCompletionCallback callback2;
- rv = service.ReconsiderProxyAfterError(NULL, url, &info, &callback2, NULL);
+ rv = service.ReconsiderProxyAfterError(url, &info, &callback2, NULL, NULL);
EXPECT_EQ(OK, rv);
// The first proxy is ignored, and the second one is selected.
@@ -468,7 +468,7 @@ TEST(ProxyServiceTest, ProxyFallback_BadConfig) {
// Fake a PAC failure.
ProxyInfo info2;
TestCompletionCallback callback3;
- rv = service.ResolveProxy(NULL, url, &info2, &callback3, NULL);
+ rv = service.ResolveProxy(url, &info2, &callback3, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
ASSERT_EQ(1u, resolver->pending_requests().size());
@@ -487,7 +487,7 @@ TEST(ProxyServiceTest, ProxyFallback_BadConfig) {
// to check the config since everything works.
ProxyInfo info3;
TestCompletionCallback callback4;
- rv = service.ResolveProxy(NULL, url, &info3, &callback4, NULL);
+ rv = service.ResolveProxy(url, &info3, &callback4, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info3.is_direct());
@@ -495,7 +495,7 @@ TEST(ProxyServiceTest, ProxyFallback_BadConfig) {
// resolve the proxy before, and if not (like in this case), we give the
// PAC another try.
TestCompletionCallback callback5;
- rv = service.ReconsiderProxyAfterError(NULL, url, &info3, &callback5, NULL);
+ rv = service.ReconsiderProxyAfterError(url, &info3, &callback5, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
ASSERT_EQ(1u, resolver->pending_requests().size());
@@ -526,7 +526,7 @@ TEST(ProxyServiceTest, ProxyBypassList) {
GURL url("http://www.google.com/");
// Get the proxy information.
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_FALSE(info.is_direct());
}
@@ -536,7 +536,7 @@ TEST(ProxyServiceTest, ProxyBypassList) {
new MockAsyncProxyResolver());
GURL test_url("http://local");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info.is_direct());
}
@@ -549,7 +549,7 @@ TEST(ProxyServiceTest, ProxyBypassList) {
new MockAsyncProxyResolver);
GURL test_url("http://www.webkit.org");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info.is_direct());
}
@@ -563,7 +563,7 @@ TEST(ProxyServiceTest, ProxyBypassList) {
new MockAsyncProxyResolver);
GURL test_url("http://74.125.19.147");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info.is_direct());
}
@@ -576,7 +576,7 @@ TEST(ProxyServiceTest, ProxyBypassList) {
new MockAsyncProxyResolver);
GURL test_url("http://www.msn.com");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_FALSE(info.is_direct());
}
@@ -589,7 +589,7 @@ TEST(ProxyServiceTest, ProxyBypassList) {
new MockAsyncProxyResolver);
GURL test_url("http://www.msnbc.msn.com");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info.is_direct());
}
@@ -602,7 +602,7 @@ TEST(ProxyServiceTest, ProxyBypassList) {
new MockAsyncProxyResolver);
GURL test_url("HTTP://WWW.MSNBC.MSN.COM");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info.is_direct());
}
@@ -624,21 +624,21 @@ TEST(ProxyServiceTest, ProxyBypassListWithPorts) {
{
GURL test_url("http://www.example.com:99");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info.is_direct());
}
{
GURL test_url("http://www.example.com:100");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_FALSE(info.is_direct());
}
{
GURL test_url("http://www.example.com");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_FALSE(info.is_direct());
}
@@ -651,7 +651,7 @@ TEST(ProxyServiceTest, ProxyBypassListWithPorts) {
new MockAsyncProxyResolver);
GURL test_url("http://www.example.com");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info.is_direct());
}
@@ -663,7 +663,7 @@ TEST(ProxyServiceTest, ProxyBypassListWithPorts) {
new MockAsyncProxyResolver);
GURL test_url("http://www.example.com:99");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info.is_direct());
}
@@ -677,14 +677,14 @@ TEST(ProxyServiceTest, ProxyBypassListWithPorts) {
{
GURL test_url("http://[3ffe:2a00:100:7031::1]:99/");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info.is_direct());
}
{
GURL test_url("http://[3ffe:2a00:100:7031::1]/");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_FALSE(info.is_direct());
}
@@ -701,14 +701,14 @@ TEST(ProxyServiceTest, ProxyBypassListWithPorts) {
{
GURL test_url("http://[3ffe:2a00:100:7031::1]:99/");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info.is_direct());
}
{
GURL test_url("http://[3ffe:2a00:100:7031::1]/");
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info.is_direct());
}
@@ -725,7 +725,7 @@ TEST(ProxyServiceTest, PerProtocolProxyTests) {
GURL test_url("http://www.msn.com");
ProxyInfo info;
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_FALSE(info.is_direct());
EXPECT_EQ("foopy1:8080", info.proxy_server().ToURI());
@@ -736,7 +736,7 @@ TEST(ProxyServiceTest, PerProtocolProxyTests) {
GURL test_url("ftp://ftp.google.com");
ProxyInfo info;
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info.is_direct());
EXPECT_EQ("direct://", info.proxy_server().ToURI());
@@ -747,7 +747,7 @@ TEST(ProxyServiceTest, PerProtocolProxyTests) {
GURL test_url("https://webbranch.techcu.com");
ProxyInfo info;
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_FALSE(info.is_direct());
EXPECT_EQ("foopy2:8080", info.proxy_server().ToURI());
@@ -759,7 +759,7 @@ TEST(ProxyServiceTest, PerProtocolProxyTests) {
GURL test_url("http://www.microsoft.com");
ProxyInfo info;
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_FALSE(info.is_direct());
EXPECT_EQ("foopy1:8080", info.proxy_server().ToURI());
@@ -781,7 +781,7 @@ TEST(ProxyServiceTest, DefaultProxyFallbackToSOCKS) {
GURL test_url("http://www.msn.com");
ProxyInfo info;
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_FALSE(info.is_direct());
EXPECT_EQ("foopy1:8080", info.proxy_server().ToURI());
@@ -792,7 +792,7 @@ TEST(ProxyServiceTest, DefaultProxyFallbackToSOCKS) {
GURL test_url("ftp://ftp.google.com");
ProxyInfo info;
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_FALSE(info.is_direct());
EXPECT_EQ("socks4://foopy2:1080", info.proxy_server().ToURI());
@@ -803,7 +803,7 @@ TEST(ProxyServiceTest, DefaultProxyFallbackToSOCKS) {
GURL test_url("https://webbranch.techcu.com");
ProxyInfo info;
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_FALSE(info.is_direct());
EXPECT_EQ("socks4://foopy2:1080", info.proxy_server().ToURI());
@@ -814,7 +814,7 @@ TEST(ProxyServiceTest, DefaultProxyFallbackToSOCKS) {
GURL test_url("unknown://www.microsoft.com");
ProxyInfo info;
TestCompletionCallback callback;
- int rv = service.ResolveProxy(NULL, test_url, &info, &callback, NULL);
+ int rv = service.ResolveProxy(test_url, &info, &callback, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_FALSE(info.is_direct());
EXPECT_EQ("socks4://foopy2:1080", info.proxy_server().ToURI());
@@ -835,7 +835,7 @@ TEST(ProxyServiceTest, CancelInProgressRequest) {
ProxyInfo info1;
TestCompletionCallback callback1;
int rv = service.ResolveProxy(
- NULL, GURL("http://request1"), &info1, &callback1, NULL);
+ GURL("http://request1"), &info1, &callback1, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
// Nothing has been sent to the proxy resolver yet, since the proxy
@@ -854,7 +854,7 @@ TEST(ProxyServiceTest, CancelInProgressRequest) {
TestCompletionCallback callback2;
ProxyService::PacRequest* request2;
rv = service.ResolveProxy(
- NULL, GURL("http://request2"), &info2, &callback2, &request2);
+ GURL("http://request2"), &info2, &callback2, &request2, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
ASSERT_EQ(2u, resolver->pending_requests().size());
EXPECT_EQ(GURL("http://request2"), resolver->pending_requests()[1]->url());
@@ -862,7 +862,7 @@ TEST(ProxyServiceTest, CancelInProgressRequest) {
ProxyInfo info3;
TestCompletionCallback callback3;
rv = service.ResolveProxy(
- NULL, GURL("http://request3"), &info3, &callback3, NULL);
+ GURL("http://request3"), &info3, &callback3, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
ASSERT_EQ(3u, resolver->pending_requests().size());
EXPECT_EQ(GURL("http://request3"), resolver->pending_requests()[2]->url());
@@ -912,7 +912,7 @@ TEST(ProxyServiceTest, InitialPACScriptDownload) {
ProxyInfo info1;
TestCompletionCallback callback1;
int rv = service.ResolveProxy(
- NULL, GURL("http://request1"), &info1, &callback1, NULL);
+ GURL("http://request1"), &info1, &callback1, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
// The first request should have triggered download of PAC script.
@@ -922,13 +922,13 @@ TEST(ProxyServiceTest, InitialPACScriptDownload) {
ProxyInfo info2;
TestCompletionCallback callback2;
rv = service.ResolveProxy(
- NULL, GURL("http://request2"), &info2, &callback2, NULL);
+ GURL("http://request2"), &info2, &callback2, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
ProxyInfo info3;
TestCompletionCallback callback3;
rv = service.ResolveProxy(
- NULL, GURL("http://request3"), &info3, &callback3, NULL);
+ GURL("http://request3"), &info3, &callback3, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
// Nothing has been sent to the resolver yet.
@@ -990,7 +990,7 @@ TEST(ProxyServiceTest, CancelWhilePACFetching) {
TestCompletionCallback callback1;
ProxyService::PacRequest* request1;
int rv = service.ResolveProxy(
- NULL, GURL("http://request1"), &info1, &callback1, &request1);
+ GURL("http://request1"), &info1, &callback1, &request1, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
// The first request should have triggered download of PAC script.
@@ -1001,13 +1001,13 @@ TEST(ProxyServiceTest, CancelWhilePACFetching) {
TestCompletionCallback callback2;
ProxyService::PacRequest* request2;
rv = service.ResolveProxy(
- NULL, GURL("http://request2"), &info2, &callback2, &request2);
+ GURL("http://request2"), &info2, &callback2, &request2, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
ProxyInfo info3;
TestCompletionCallback callback3;
rv = service.ResolveProxy(
- NULL, GURL("http://request3"), &info3, &callback3, NULL);
+ GURL("http://request3"), &info3, &callback3, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
// Nothing has been sent to the resolver yet.
@@ -1063,14 +1063,14 @@ TEST(ProxyServiceTest, FallbackFromAutodetectToCustomPac) {
ProxyInfo info1;
TestCompletionCallback callback1;
int rv = service.ResolveProxy(
- NULL, GURL("http://request1"), &info1, &callback1, NULL);
+ GURL("http://request1"), &info1, &callback1, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
ProxyInfo info2;
TestCompletionCallback callback2;
ProxyService::PacRequest* request2;
rv = service.ResolveProxy(
- NULL, GURL("http://request2"), &info2, &callback2, &request2);
+ GURL("http://request2"), &info2, &callback2, &request2, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
// Check that nothing has been sent to the proxy resolver yet.
@@ -1133,14 +1133,14 @@ TEST(ProxyServiceTest, FallbackFromAutodetectToCustomPac2) {
ProxyInfo info1;
TestCompletionCallback callback1;
int rv = service.ResolveProxy(
- NULL, GURL("http://request1"), &info1, &callback1, NULL);
+ GURL("http://request1"), &info1, &callback1, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
ProxyInfo info2;
TestCompletionCallback callback2;
ProxyService::PacRequest* request2;
rv = service.ResolveProxy(
- NULL, GURL("http://request2"), &info2, &callback2, &request2);
+ GURL("http://request2"), &info2, &callback2, &request2, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
// Check that nothing has been sent to the proxy resolver yet.
@@ -1208,14 +1208,14 @@ TEST(ProxyServiceTest, FallbackFromAutodetectToCustomToManual) {
ProxyInfo info1;
TestCompletionCallback callback1;
int rv = service.ResolveProxy(
- NULL, GURL("http://request1"), &info1, &callback1, NULL);
+ GURL("http://request1"), &info1, &callback1, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
ProxyInfo info2;
TestCompletionCallback callback2;
ProxyService::PacRequest* request2;
rv = service.ResolveProxy(
- NULL, GURL("http://request2"), &info2, &callback2, &request2);
+ GURL("http://request2"), &info2, &callback2, &request2, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
// Check that nothing has been sent to the proxy resolver yet.
@@ -1265,7 +1265,7 @@ TEST(ProxyServiceTest, BypassDoesntApplyToPac) {
ProxyInfo info1;
TestCompletionCallback callback1;
int rv = service.ResolveProxy(
- NULL, GURL("http://www.google.com"), &info1, &callback1, NULL);
+ GURL("http://www.google.com"), &info1, &callback1, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
// Check that nothing has been sent to the proxy resolver yet.
@@ -1296,7 +1296,7 @@ TEST(ProxyServiceTest, BypassDoesntApplyToPac) {
ProxyInfo info2;
TestCompletionCallback callback2;
rv = service.ResolveProxy(
- NULL, GURL("http://www.google.com"), &info2, &callback2, NULL);
+ GURL("http://www.google.com"), &info2, &callback2, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
ASSERT_EQ(1u, resolver->pending_requests().size());
@@ -1321,7 +1321,7 @@ TEST(ProxyServiceTest, ResetProxyConfigService) {
ProxyInfo info;
TestCompletionCallback callback1;
int rv = service.ResolveProxy(
- NULL, GURL("http://request1"), &info, &callback1, NULL);
+ GURL("http://request1"), &info, &callback1, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_EQ("foopy1:8080", info.proxy_server().ToURI());
@@ -1331,7 +1331,7 @@ TEST(ProxyServiceTest, ResetProxyConfigService) {
service.ResetConfigService(new MockProxyConfigService(config2));
TestCompletionCallback callback2;
rv = service.ResolveProxy(
- NULL, GURL("http://request2"), &info, &callback2, NULL);
+ GURL("http://request2"), &info, &callback2, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_EQ("foopy2:8080", info.proxy_server().ToURI());
}
@@ -1395,7 +1395,7 @@ TEST(ProxyServiceTest, UpdateConfigAfterFailedAutodetect) {
ProxyInfo info1;
TestCompletionCallback callback1;
int rv = service.ResolveProxy(
- NULL, GURL("http://www.google.com"), &info1, &callback1, NULL);
+ GURL("http://www.google.com"), &info1, &callback1, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
// Check that nothing has been sent to the proxy resolver yet.
@@ -1419,7 +1419,7 @@ TEST(ProxyServiceTest, UpdateConfigAfterFailedAutodetect) {
ProxyInfo info2;
TestCompletionCallback callback2;
rv = service.ResolveProxy(
- NULL, GURL("http://www.google.com"), &info2, &callback2, NULL);
+ GURL("http://www.google.com"), &info2, &callback2, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info2.is_direct());
@@ -1440,7 +1440,7 @@ TEST(ProxyServiceTest, UpdateConfigFromPACToDirect) {
ProxyInfo info1;
TestCompletionCallback callback1;
int rv = service.ResolveProxy(
- NULL, GURL("http://www.google.com"), &info1, &callback1, NULL);
+ GURL("http://www.google.com"), &info1, &callback1, NULL, NULL);
EXPECT_EQ(ERR_IO_PENDING, rv);
// Check that nothing has been sent to the proxy resolver yet.
@@ -1472,7 +1472,7 @@ TEST(ProxyServiceTest, UpdateConfigFromPACToDirect) {
ProxyInfo info2;
TestCompletionCallback callback2;
rv = service.ResolveProxy(
- NULL, GURL("http://www.google.com"), &info2, &callback2, NULL);
+ GURL("http://www.google.com"), &info2, &callback2, NULL, NULL);
EXPECT_EQ(OK, rv);
EXPECT_TRUE(info2.is_direct());