| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // Assume that any proxy host ending with this suffix is a Data Reduction Proxy. | 38 // Assume that any proxy host ending with this suffix is a Data Reduction Proxy. |
| 39 const char kDataReductionProxyDefaultHostSuffix[] = ".googlezip.net"; | 39 const char kDataReductionProxyDefaultHostSuffix[] = ".googlezip.net"; |
| 40 | 40 |
| 41 // Searches |proxy_list| for any Data Reduction Proxies, even if they don't | 41 // Searches |proxy_list| for any Data Reduction Proxies, even if they don't |
| 42 // match a currently configured Data Reduction Proxy. | 42 // match a currently configured Data Reduction Proxy. |
| 43 bool ContainsDataReductionProxyDefaultHostSuffix( | 43 bool ContainsDataReductionProxyDefaultHostSuffix( |
| 44 const net::ProxyList& proxy_list) { | 44 const net::ProxyList& proxy_list) { |
| 45 for (const net::ProxyServer& proxy : proxy_list.GetAll()) { | 45 for (const net::ProxyServer& proxy : proxy_list.GetAll()) { |
| 46 if (proxy.is_valid() && !proxy.is_direct() && | 46 if (proxy.is_valid() && !proxy.is_direct() && |
| 47 base::EndsWith(proxy.host_port_pair().host(), | 47 base::EndsWith(proxy.host_port_pair().host(), |
| 48 kDataReductionProxyDefaultHostSuffix, true)) { | 48 kDataReductionProxyDefaultHostSuffix, |
| 49 base::CompareCase::SENSITIVE)) { |
| 49 return true; | 50 return true; |
| 50 } | 51 } |
| 51 } | 52 } |
| 52 return false; | 53 return false; |
| 53 } | 54 } |
| 54 | 55 |
| 55 // Searches |proxy_rules| for any Data Reduction Proxies, even if they don't | 56 // Searches |proxy_rules| for any Data Reduction Proxies, even if they don't |
| 56 // match a currently configured Data Reduction Proxy. | 57 // match a currently configured Data Reduction Proxy. |
| 57 bool ContainsDataReductionProxyDefaultHostSuffix( | 58 bool ContainsDataReductionProxyDefaultHostSuffix( |
| 58 const net::ProxyConfig::ProxyRules& proxy_rules) { | 59 const net::ProxyConfig::ProxyRules& proxy_rules) { |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 #elif defined(OS_OPENBSD) | 230 #elif defined(OS_OPENBSD) |
| 230 return data_reduction_proxy::Client::CHROME_OPENBSD; | 231 return data_reduction_proxy::Client::CHROME_OPENBSD; |
| 231 #elif defined(OS_SOLARIS) | 232 #elif defined(OS_SOLARIS) |
| 232 return data_reduction_proxy::Client::CHROME_SOLARIS; | 233 return data_reduction_proxy::Client::CHROME_SOLARIS; |
| 233 #elif defined(OS_QNX) | 234 #elif defined(OS_QNX) |
| 234 return data_reduction_proxy::Client::CHROME_QNX; | 235 return data_reduction_proxy::Client::CHROME_QNX; |
| 235 #else | 236 #else |
| 236 return data_reduction_proxy::Client::UNKNOWN; | 237 return data_reduction_proxy::Client::UNKNOWN; |
| 237 #endif | 238 #endif |
| 238 } | 239 } |
| OLD | NEW |