| Index: net/proxy/proxy_config_service_mac.cc
|
| diff --git a/net/proxy/proxy_config_service_mac.cc b/net/proxy/proxy_config_service_mac.cc
|
| index 8c2f55ebd90b61e2a8c1c44d4d2935c96807f806..952a61e8ed4ce1eb336f12837eb6c3f991e702f9 100644
|
| --- a/net/proxy/proxy_config_service_mac.cc
|
| +++ b/net/proxy/proxy_config_service_mac.cc
|
| @@ -27,8 +27,8 @@ namespace {
|
| bool GetBoolFromDictionary(CFDictionaryRef dict,
|
| CFStringRef key,
|
| bool default_value) {
|
| - CFNumberRef number = base::mac::GetValueFromDictionary<CFNumberRef>(dict,
|
| - key);
|
| + CFNumberRef number =
|
| + base::mac::GetValueFromDictionary<CFNumberRef>(dict, key);
|
| if (!number)
|
| return default_value;
|
|
|
| @@ -49,16 +49,13 @@ void GetCurrentProxyConfig(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->set_auto_detect(
|
| - GetBoolFromDictionary(config_dict.get(),
|
| - kSCPropNetProxiesProxyAutoDiscoveryEnable,
|
| - false));
|
| + config->set_auto_detect(GetBoolFromDictionary(
|
| + config_dict.get(), kSCPropNetProxiesProxyAutoDiscoveryEnable, false));
|
|
|
| // PAC file
|
|
|
| - if (GetBoolFromDictionary(config_dict.get(),
|
| - kSCPropNetProxiesProxyAutoConfigEnable,
|
| - false)) {
|
| + if (GetBoolFromDictionary(
|
| + config_dict.get(), kSCPropNetProxiesProxyAutoConfigEnable, false)) {
|
| CFStringRef pac_url_ref = base::mac::GetValueFromDictionary<CFStringRef>(
|
| config_dict.get(), kSCPropNetProxiesProxyAutoConfigURLString);
|
| if (pac_url_ref)
|
| @@ -67,9 +64,8 @@ void GetCurrentProxyConfig(ProxyConfig* config) {
|
|
|
| // proxies (for now ftp, http, https, and SOCKS)
|
|
|
| - if (GetBoolFromDictionary(config_dict.get(),
|
| - kSCPropNetProxiesFTPEnable,
|
| - false)) {
|
| + if (GetBoolFromDictionary(
|
| + config_dict.get(), kSCPropNetProxiesFTPEnable, false)) {
|
| ProxyServer proxy_server =
|
| ProxyServer::FromDictionary(ProxyServer::SCHEME_HTTP,
|
| config_dict.get(),
|
| @@ -81,9 +77,8 @@ void GetCurrentProxyConfig(ProxyConfig* config) {
|
| config->proxy_rules().proxies_for_ftp.SetSingleProxyServer(proxy_server);
|
| }
|
| }
|
| - if (GetBoolFromDictionary(config_dict.get(),
|
| - kSCPropNetProxiesHTTPEnable,
|
| - false)) {
|
| + if (GetBoolFromDictionary(
|
| + config_dict.get(), kSCPropNetProxiesHTTPEnable, false)) {
|
| ProxyServer proxy_server =
|
| ProxyServer::FromDictionary(ProxyServer::SCHEME_HTTP,
|
| config_dict.get(),
|
| @@ -95,9 +90,8 @@ void GetCurrentProxyConfig(ProxyConfig* config) {
|
| config->proxy_rules().proxies_for_http.SetSingleProxyServer(proxy_server);
|
| }
|
| }
|
| - if (GetBoolFromDictionary(config_dict.get(),
|
| - kSCPropNetProxiesHTTPSEnable,
|
| - false)) {
|
| + if (GetBoolFromDictionary(
|
| + config_dict.get(), kSCPropNetProxiesHTTPSEnable, false)) {
|
| ProxyServer proxy_server =
|
| ProxyServer::FromDictionary(ProxyServer::SCHEME_HTTP,
|
| config_dict.get(),
|
| @@ -106,13 +100,12 @@ void GetCurrentProxyConfig(ProxyConfig* config) {
|
| if (proxy_server.is_valid()) {
|
| config->proxy_rules().type =
|
| ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME;
|
| - config->proxy_rules().proxies_for_https.
|
| - SetSingleProxyServer(proxy_server);
|
| + config->proxy_rules().proxies_for_https.SetSingleProxyServer(
|
| + proxy_server);
|
| }
|
| }
|
| - if (GetBoolFromDictionary(config_dict.get(),
|
| - kSCPropNetProxiesSOCKSEnable,
|
| - false)) {
|
| + if (GetBoolFromDictionary(
|
| + config_dict.get(), kSCPropNetProxiesSOCKSEnable, false)) {
|
| ProxyServer proxy_server =
|
| ProxyServer::FromDictionary(ProxyServer::SCHEME_SOCKS5,
|
| config_dict.get(),
|
| @@ -148,9 +141,8 @@ void GetCurrentProxyConfig(ProxyConfig* config) {
|
|
|
| // proxy bypass boolean
|
|
|
| - if (GetBoolFromDictionary(config_dict.get(),
|
| - kSCPropNetProxiesExcludeSimpleHostnames,
|
| - false)) {
|
| + if (GetBoolFromDictionary(
|
| + config_dict.get(), kSCPropNetProxiesExcludeSimpleHostnames, false)) {
|
| config->proxy_rules().bypass_rules.AddRuleToBypassLocal();
|
| }
|
|
|
| @@ -171,9 +163,7 @@ class ProxyConfigServiceMac::Helper
|
| }
|
|
|
| // Called when the parent is destroyed.
|
| - void Orphan() {
|
| - parent_ = NULL;
|
| - }
|
| + void Orphan() { parent_ = NULL; }
|
|
|
| void OnProxyConfigChanged(const ProxyConfig& new_config) {
|
| if (parent_)
|
| @@ -226,7 +216,7 @@ void ProxyConfigServiceMac::RemoveObserver(Observer* observer) {
|
| }
|
|
|
| net::ProxyConfigService::ConfigAvailability
|
| - ProxyConfigServiceMac::GetLatestProxyConfig(ProxyConfig* config) {
|
| +ProxyConfigServiceMac::GetLatestProxyConfig(ProxyConfig* config) {
|
| DCHECK(io_thread_task_runner_->BelongsToCurrentThread());
|
|
|
| // Lazy-initialize by fetching the proxy setting from this thread.
|
| @@ -245,7 +235,7 @@ void ProxyConfigServiceMac::SetDynamicStoreNotificationKeys(
|
|
|
| CFStringRef proxies_key = SCDynamicStoreKeyCreateProxies(NULL);
|
| CFArrayRef key_array = CFArrayCreate(
|
| - NULL, (const void **)(&proxies_key), 1, &kCFTypeArrayCallBacks);
|
| + NULL, (const void**)(&proxies_key), 1, &kCFTypeArrayCallBacks);
|
|
|
| bool ret = SCDynamicStoreSetNotificationKeys(store, key_array, NULL);
|
| // TODO(willchan): Figure out a proper way to handle this rather than crash.
|
| @@ -277,8 +267,8 @@ void ProxyConfigServiceMac::OnProxyConfigChanged(
|
| last_config_fetched_ = new_config;
|
|
|
| // Notify all the observers.
|
| - FOR_EACH_OBSERVER(Observer, observers_,
|
| - OnProxyConfigChanged(new_config, CONFIG_VALID));
|
| + FOR_EACH_OBSERVER(
|
| + Observer, observers_, OnProxyConfigChanged(new_config, CONFIG_VALID));
|
| }
|
|
|
| } // namespace net
|
|
|