summaryrefslogtreecommitdiffstats
path: root/net/proxy
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 12:46:38 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 12:46:38 +0000
commitf0a51fb571f46531025fa09240bbc3e1af925e84 (patch)
tree558b4f0e737fda4b9ab60f252c9c23b8a4ca523e /net/proxy
parent6390be368205705f49ead3cec40396519f13b889 (diff)
downloadchromium_src-f0a51fb571f46531025fa09240bbc3e1af925e84.zip
chromium_src-f0a51fb571f46531025fa09240bbc3e1af925e84.tar.gz
chromium_src-f0a51fb571f46531025fa09240bbc3e1af925e84.tar.bz2
Fixes CRLF and trailing white spaces.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10982 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy')
-rw-r--r--net/proxy/proxy_config_service_fixed.h2
-rw-r--r--net/proxy/proxy_config_service_win.cc2
-rw-r--r--net/proxy/proxy_resolver_mac.cc68
-rw-r--r--net/proxy/proxy_resolver_script.h2
-rw-r--r--net/proxy/proxy_resolver_v8.h4
-rw-r--r--net/proxy/proxy_resolver_v8_unittest.cc2
-rw-r--r--net/proxy/proxy_script_fetcher.cc4
-rw-r--r--net/proxy/proxy_server.cc2
-rw-r--r--net/proxy/proxy_server.h2
-rw-r--r--net/proxy/proxy_service.cc2
-rw-r--r--net/proxy/proxy_service.h2
11 files changed, 46 insertions, 46 deletions
diff --git a/net/proxy/proxy_config_service_fixed.h b/net/proxy/proxy_config_service_fixed.h
index 5120093..9b8b589 100644
--- a/net/proxy/proxy_config_service_fixed.h
+++ b/net/proxy/proxy_config_service_fixed.h
@@ -19,7 +19,7 @@ class ProxyConfigServiceFixed : public ProxyConfigService {
config->proxy_rules = pi_.proxy_server().ToURI();
return OK;
}
-
+
private:
ProxyInfo pi_;
};
diff --git a/net/proxy/proxy_config_service_win.cc b/net/proxy/proxy_config_service_win.cc
index e3dc95e..d4d18e3 100644
--- a/net/proxy/proxy_config_service_win.cc
+++ b/net/proxy/proxy_config_service_win.cc
@@ -40,7 +40,7 @@ int ProxyConfigServiceWin::GetProxyConfig(ProxyConfig* config) {
config->proxy_rules = WideToASCII(ie_config.lpszProxy);
if (ie_config.lpszProxyBypass) {
std::string proxy_bypass = WideToASCII(ie_config.lpszProxyBypass);
-
+
StringTokenizer proxy_server_bypass_list(proxy_bypass, "; \t\n\r");
while (proxy_server_bypass_list.GetNext()) {
std::string bypass_url_domain = proxy_server_bypass_list.token();
diff --git a/net/proxy/proxy_resolver_mac.cc b/net/proxy/proxy_resolver_mac.cc
index 796847d..4ac2b18 100644
--- a/net/proxy/proxy_resolver_mac.cc
+++ b/net/proxy/proxy_resolver_mac.cc
@@ -26,7 +26,7 @@ CFTypeRef GetValueFromDictionary(CFDictionaryRef dict,
CFTypeRef value = CFDictionaryGetValue(dict, key);
if (!value)
return value;
-
+
if (CFGetTypeID(value) != expected_type) {
scoped_cftyperef<CFStringRef> expected_type_ref(
CFCopyTypeIDDescription(expected_type));
@@ -41,7 +41,7 @@ CFTypeRef GetValueFromDictionary(CFDictionaryRef dict,
<< " instead";
return NULL;
}
-
+
return value;
}
@@ -54,7 +54,7 @@ bool GetBoolFromDictionary(CFDictionaryRef dict,
CFNumberGetTypeID());
if (!number)
return default_value;
-
+
int int_value;
if (CFNumberGetValue(number, kCFNumberIntType, &int_value))
return int_value;
@@ -86,7 +86,7 @@ net::ProxyServer GetProxyServerFromDictionary(net::ProxyServer::Scheme scheme,
return net::ProxyServer(); // Invalid.
}
std::string host = base::SysCFStringRefToUTF8(host_ref);
-
+
CFNumberRef port_ref =
(CFNumberRef)GetValueFromDictionary(dict, port_key,
CFNumberGetTypeID());
@@ -96,7 +96,7 @@ net::ProxyServer GetProxyServerFromDictionary(net::ProxyServer::Scheme scheme,
} else {
port = net::ProxyServer::GetDefaultPortForScheme(scheme);
}
-
+
return net::ProxyServer(scheme, host, port);
}
@@ -119,18 +119,18 @@ net::ProxyServer::Scheme GetProxyServerScheme(CFStringRef proxy_type) {
// to a CFTypeRef. This stashes either |error| or |proxies| in that location.
void ResultCallback(void* client, CFArrayRef proxies, CFErrorRef error) {
DCHECK((proxies != NULL) == (error == NULL));
-
+
CFTypeRef* result_ptr = (CFTypeRef*)client;
DCHECK(result_ptr != NULL);
DCHECK(*result_ptr == NULL);
-
+
if (error != NULL) {
*result_ptr = CFRetain(error);
} else {
*result_ptr = CFRetain(proxies);
}
CFRunLoopStop(CFRunLoopGetCurrent());
-}
+}
} // namespace
@@ -140,9 +140,9 @@ int ProxyConfigServiceMac::GetProxyConfig(ProxyConfig* config) {
scoped_cftyperef<CFDictionaryRef> config_dict(
SCDynamicStoreCopyProxies(NULL));
DCHECK(config_dict);
-
+
// auto-detect
-
+
// There appears to be no UI for this configuration option, and we're not sure
// if Apple's proxy code even takes it into account. But the constant is in
// the header file so we'll use it.
@@ -150,9 +150,9 @@ int ProxyConfigServiceMac::GetProxyConfig(ProxyConfig* config) {
GetBoolFromDictionary(config_dict.get(),
kSCPropNetProxiesProxyAutoDiscoveryEnable,
false);
-
+
// PAC file
-
+
if (GetBoolFromDictionary(config_dict.get(),
kSCPropNetProxiesProxyAutoConfigEnable,
false)) {
@@ -164,9 +164,9 @@ int ProxyConfigServiceMac::GetProxyConfig(ProxyConfig* config) {
if (pac_url_ref)
config->pac_url = GURL(base::SysCFStringRefToUTF8(pac_url_ref));
}
-
+
// proxies (for now only ftp, http and https)
-
+
if (GetBoolFromDictionary(config_dict.get(),
kSCPropNetProxiesFTPEnable,
false)) {
@@ -210,9 +210,9 @@ int ProxyConfigServiceMac::GetProxyConfig(ProxyConfig* config) {
config->proxy_rules += proxy_server.ToURI();
}
}
-
+
// proxy bypass list
-
+
CFArrayRef bypass_array_ref =
(CFArrayRef)GetValueFromDictionary(config_dict.get(),
kSCPropNetProxiesExceptionsList,
@@ -225,22 +225,22 @@ int ProxyConfigServiceMac::GetProxyConfig(ProxyConfig* config) {
if (CFGetTypeID(bypass_item_ref) != CFStringGetTypeID()) {
LOG(WARNING) << "Expected value for item " << i
<< " in the kSCPropNetProxiesExceptionsList"
- " to be a CFStringRef but it was not";
-
+ " to be a CFStringRef but it was not";
+
} else {
config->proxy_bypass.push_back(
base::SysCFStringRefToUTF8(bypass_item_ref));
}
}
}
-
+
// proxy bypass boolean
-
+
config->proxy_bypass_local_names =
GetBoolFromDictionary(config_dict.get(),
kSCPropNetProxiesExcludeSimpleHostnames,
false);
-
+
return OK;
}
@@ -261,21 +261,21 @@ int ProxyResolverMac::GetProxyForURL(const GURL& query_url,
CFURLCreateWithString(kCFAllocatorDefault,
pac_ref.get(),
NULL));
-
+
// Work around <rdar://problem/5530166>. This dummy call to
// CFNetworkCopyProxiesForURL initializes some state within CFNetwork that is
// required by CFNetworkExecuteProxyAutoConfigurationURL.
-
+
CFArrayRef dummy_result = CFNetworkCopyProxiesForURL(query_url_ref.get(),
NULL);
if (dummy_result)
CFRelease(dummy_result);
-
+
// We cheat here. We need to act as if we were synchronous, so we pump the
// runloop ourselves. Our caller moved us to a new thread anyway, so this is
// OK to do. (BTW, CFNetworkExecuteProxyAutoConfigurationURL returns a
// runloop source we need to release despite its name.)
-
+
CFTypeRef result = NULL;
CFStreamClientContext context = { 0, &result, NULL, NULL, NULL };
scoped_cftyperef<CFRunLoopSourceRef> runloop_source(
@@ -285,17 +285,17 @@ int ProxyResolverMac::GetProxyForURL(const GURL& query_url,
&context));
if (!runloop_source)
return ERR_FAILED;
-
+
const CFStringRef private_runloop_mode =
CFSTR("org.chromium.ProxyResolverMac");
-
+
CFRunLoopAddSource(CFRunLoopGetCurrent(), runloop_source.get(),
private_runloop_mode);
CFRunLoopRunInMode(private_runloop_mode, DBL_MAX, false);
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), runloop_source.get(),
private_runloop_mode);
DCHECK(result != NULL);
-
+
if (CFGetTypeID(result) == CFErrorGetTypeID()) {
// TODO(avi): do something better than this
CFRelease(result);
@@ -303,19 +303,19 @@ int ProxyResolverMac::GetProxyForURL(const GURL& query_url,
}
DCHECK(CFGetTypeID(result) == CFArrayGetTypeID());
scoped_cftyperef<CFArrayRef> proxy_array_ref((CFArrayRef)result);
-
+
// This string will be an ordered list of <proxy-uri> entries, separated by
// semi-colons. It is the format that ProxyInfo::UseNamedProxy() expects.
// proxy-uri = [<proxy-scheme>"://"]<proxy-host>":"<proxy-port>
// (This also includes entries for direct connection, as "direct://").
std::string proxy_uri_list;
-
+
CFIndex proxy_array_count = CFArrayGetCount(proxy_array_ref.get());
for (CFIndex i = 0; i < proxy_array_count; ++i) {
CFDictionaryRef proxy_dictionary =
(CFDictionaryRef)CFArrayGetValueAtIndex(proxy_array_ref.get(), i);
DCHECK(CFGetTypeID(proxy_dictionary) == CFDictionaryGetTypeID());
-
+
// The dictionary may have the following keys:
// - kCFProxyTypeKey : The type of the proxy
// - kCFProxyHostNameKey
@@ -329,7 +329,7 @@ int ProxyResolverMac::GetProxyForURL(const GURL& query_url,
// tease.
// - kCFProxyAutoConfigurationURLKey : If the PAC file specifies another
// PAC file, I'm going home.
-
+
CFStringRef proxy_type =
(CFStringRef)GetValueFromDictionary(proxy_dictionary,
kCFProxyTypeKey,
@@ -346,11 +346,11 @@ int ProxyResolverMac::GetProxyForURL(const GURL& query_url,
proxy_uri_list += ";";
proxy_uri_list += proxy_server.ToURI();
}
-
+
if (!proxy_uri_list.empty())
results->UseNamedProxy(proxy_uri_list);
// Else do nothing (results is already guaranteed to be in the default state).
-
+
return OK;
}
diff --git a/net/proxy/proxy_resolver_script.h b/net/proxy/proxy_resolver_script.h
index 5b19924..be592e4 100644
--- a/net/proxy/proxy_resolver_script.h
+++ b/net/proxy/proxy_resolver_script.h
@@ -50,7 +50,7 @@
// sed -e 's/"\s*[+]\s*$/"/g' |
// sed -e 's/"$/" \\/g' |
// sed -e 's/\/(ipaddr);/\/.exec(ipaddr);/g' |
-// grep -v '^var pacUtils ='
+// grep -v '^var pacUtils ='
#define PROXY_RESOLVER_SCRIPT \
"function dnsDomainIs(host, domain) {\n" \
" return (host.length >= domain.length &&\n" \
diff --git a/net/proxy/proxy_resolver_v8.h b/net/proxy/proxy_resolver_v8.h
index a0275c8..219560c 100644
--- a/net/proxy/proxy_resolver_v8.h
+++ b/net/proxy/proxy_resolver_v8.h
@@ -82,8 +82,8 @@ class ProxyResolverV8::JSBindings {
// Handler for "alert(message)"
virtual void Alert(const std::string& message) = 0;
- // Handler for "myIpAddress()". Returns empty string on failure.
- virtual std::string MyIpAddress() = 0;
+ // Handler for "myIpAddress()". Returns empty string on failure.
+ virtual std::string MyIpAddress() = 0;
// Handler for "dnsResolve(host)". Returns empty string on failure.
virtual std::string DnsResolve(const std::string& host) = 0;
diff --git a/net/proxy/proxy_resolver_v8_unittest.cc b/net/proxy/proxy_resolver_v8_unittest.cc
index 5cbdfd4..dff8843 100644
--- a/net/proxy/proxy_resolver_v8_unittest.cc
+++ b/net/proxy/proxy_resolver_v8_unittest.cc
@@ -379,7 +379,7 @@ TEST(ProxyResolverV8DefaultBindingsTest, DnsResolve) {
// Get a hold of a DefaultJSBindings* (it is a hidden impl class).
net::ProxyResolverV8 resolver;
net::ProxyResolverV8::JSBindings* bindings = resolver.js_bindings();
-
+
// Considered an error.
EXPECT_EQ("", bindings->DnsResolve(""));
diff --git a/net/proxy/proxy_script_fetcher.cc b/net/proxy/proxy_script_fetcher.cc
index b48ee1a..22e559ee 100644
--- a/net/proxy/proxy_script_fetcher.cc
+++ b/net/proxy/proxy_script_fetcher.cc
@@ -12,7 +12,7 @@
#include "net/base/load_flags.h"
#include "net/url_request/url_request.h"
-// TODO(eroman):
+// TODO(eroman):
// - Support auth-prompts.
namespace net {
@@ -197,7 +197,7 @@ void ProxyScriptFetcherImpl::OnResponseStarted(URLRequest* request) {
// NOTE about mime types: We do not enforce mime types on PAC files.
// This is for compatibility with {IE 7, Firefox 3, Opera 9.5}
- // NOTE about status codes: We are like Firefox 3 in this respect.
+ // NOTE about status codes: We are like Firefox 3 in this respect.
// {IE 7, Safari 3, Opera 9.5} do not care about the status code.
if (request->GetResponseCode() != 200) {
result_code_ = ERR_PAC_STATUS_NOT_OK;
diff --git a/net/proxy/proxy_server.cc b/net/proxy/proxy_server.cc
index 3ff5432..c6aea17 100644
--- a/net/proxy/proxy_server.cc
+++ b/net/proxy/proxy_server.cc
@@ -182,7 +182,7 @@ int ProxyServer::GetDefaultPortForScheme(Scheme scheme) {
return -1;
}
}
-
+
// static
ProxyServer ProxyServer::FromSchemeHostAndPort(
Scheme scheme,
diff --git a/net/proxy/proxy_server.h b/net/proxy/proxy_server.h
index 45db1fc..6c3354d 100644
--- a/net/proxy/proxy_server.h
+++ b/net/proxy/proxy_server.h
@@ -98,7 +98,7 @@ class ProxyServer {
// Format as a PAC result entry. This does the reverse of FromPacString().
std::string ToPacString() const;
-
+
// Returns the default port number for a proxy server with the specified
// scheme. Returns -1 if unknown.
static int GetDefaultPortForScheme(Scheme scheme);
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 443a46b..ed6fa97 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -398,7 +398,7 @@ void ProxyService::ProcessPendingRequests(PacRequest* recent_req) {
// For auto-detect we use the well known WPAD url.
GURL pac_url = config_.auto_detect ?
GURL("http://wpad/wpad.dat") : config_.pac_url;
-
+
in_progress_fetch_config_id_ = config_.id();
proxy_script_fetcher_->Fetch(
diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h
index cb1fc91..81859d8 100644
--- a/net/proxy/proxy_service.h
+++ b/net/proxy/proxy_service.h
@@ -134,7 +134,7 @@ class ProxyService {
// Callback for when the PAC script has finished downloading.
void OnScriptFetchCompletion(int result);
-
+
// Returns ERR_IO_PENDING if the request cannot be completed synchronously.
// Otherwise it fills |result| with the proxy information for |url|.
// Completing synchronously means we don't need to query ProxyResolver.