summaryrefslogtreecommitdiffstats
path: root/net/proxy/proxy_config_service_mac.cc
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-24 00:20:48 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-24 00:20:48 +0000
commited4ed0fa4e964e416cd3ac65df64bc238f65461c (patch)
tree83a492355815043301313a6cced9fb96a033c37f /net/proxy/proxy_config_service_mac.cc
parentb07408332337cd6f10b31e87cbed0886e872fa93 (diff)
downloadchromium_src-ed4ed0fa4e964e416cd3ac65df64bc238f65461c.zip
chromium_src-ed4ed0fa4e964e416cd3ac65df64bc238f65461c.tar.gz
chromium_src-ed4ed0fa4e964e416cd3ac65df64bc238f65461c.tar.bz2
ProxyConfig behaved like a struct, but was defined as a class.
Changed it to be a proper class with hidden implementation variables, setters etc. Also seized this opportunity to move the bypass list from being a member of ProxyConfig, to being a member of ProxyRules. This is a more correct hiearchy, since the bypass rules only apply to the manual settings. Lastly, this makes it possible to have the manual rules evaluation be a method on ProxyRules, and shift some more code out of proxy_service. Review URL: http://codereview.chromium.org/651070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39818 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_config_service_mac.cc')
-rw-r--r--net/proxy/proxy_config_service_mac.cc30
1 files changed, 17 insertions, 13 deletions
diff --git a/net/proxy/proxy_config_service_mac.cc b/net/proxy/proxy_config_service_mac.cc
index 74b1ea6..1e04ff0 100644
--- a/net/proxy/proxy_config_service_mac.cc
+++ b/net/proxy/proxy_config_service_mac.cc
@@ -49,10 +49,10 @@ int ProxyConfigServiceMac::GetProxyConfig(ProxyConfig* config) {
// 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.
- config->auto_detect =
+ config->set_auto_detect(
GetBoolFromDictionary(config_dict.get(),
kSCPropNetProxiesProxyAutoDiscoveryEnable,
- false);
+ false));
// PAC file
@@ -64,7 +64,7 @@ int ProxyConfigServiceMac::GetProxyConfig(ProxyConfig* config) {
kSCPropNetProxiesProxyAutoConfigURLString,
CFStringGetTypeID());
if (pac_url_ref)
- config->pac_url = GURL(base::SysCFStringRefToUTF8(pac_url_ref));
+ config->set_pac_url(GURL(base::SysCFStringRefToUTF8(pac_url_ref)));
}
// proxies (for now ftp, http, https, and SOCKS)
@@ -78,8 +78,9 @@ int ProxyConfigServiceMac::GetProxyConfig(ProxyConfig* config) {
kSCPropNetProxiesFTPProxy,
kSCPropNetProxiesFTPPort);
if (proxy_server.is_valid()) {
- config->proxy_rules.type = ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME;
- config->proxy_rules.proxy_for_ftp = proxy_server;
+ config->proxy_rules().type =
+ ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME;
+ config->proxy_rules().proxy_for_ftp = proxy_server;
}
}
if (GetBoolFromDictionary(config_dict.get(),
@@ -91,8 +92,9 @@ int ProxyConfigServiceMac::GetProxyConfig(ProxyConfig* config) {
kSCPropNetProxiesHTTPProxy,
kSCPropNetProxiesHTTPPort);
if (proxy_server.is_valid()) {
- config->proxy_rules.type = ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME;
- config->proxy_rules.proxy_for_http = proxy_server;
+ config->proxy_rules().type =
+ ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME;
+ config->proxy_rules().proxy_for_http = proxy_server;
}
}
if (GetBoolFromDictionary(config_dict.get(),
@@ -104,8 +106,9 @@ int ProxyConfigServiceMac::GetProxyConfig(ProxyConfig* config) {
kSCPropNetProxiesHTTPSProxy,
kSCPropNetProxiesHTTPSPort);
if (proxy_server.is_valid()) {
- config->proxy_rules.type = ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME;
- config->proxy_rules.proxy_for_https = proxy_server;
+ config->proxy_rules().type =
+ ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME;
+ config->proxy_rules().proxy_for_https = proxy_server;
}
}
if (GetBoolFromDictionary(config_dict.get(),
@@ -117,8 +120,9 @@ int ProxyConfigServiceMac::GetProxyConfig(ProxyConfig* config) {
kSCPropNetProxiesSOCKSProxy,
kSCPropNetProxiesSOCKSPort);
if (proxy_server.is_valid()) {
- config->proxy_rules.type = ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME;
- config->proxy_rules.socks_proxy = proxy_server;
+ config->proxy_rules().type =
+ ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME;
+ config->proxy_rules().socks_proxy = proxy_server;
}
}
@@ -140,7 +144,7 @@ int ProxyConfigServiceMac::GetProxyConfig(ProxyConfig* config) {
" to be a CFStringRef but it was not";
} else {
- config->bypass_rules.AddRuleFromString(
+ config->proxy_rules().bypass_rules.AddRuleFromString(
base::SysCFStringRefToUTF8(bypass_item_ref));
}
}
@@ -151,7 +155,7 @@ int ProxyConfigServiceMac::GetProxyConfig(ProxyConfig* config) {
if (GetBoolFromDictionary(config_dict.get(),
kSCPropNetProxiesExcludeSimpleHostnames,
false)) {
- config->bypass_rules.AddRuleToBypassLocal();
+ config->proxy_rules().bypass_rules.AddRuleToBypassLocal();
}
return OK;