Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(603)

Side by Side Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc

Issue 1233453011: Revert of Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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, 48 kDataReductionProxyDefaultHostSuffix, true)) {
49 base::CompareCase::SENSITIVE)) {
50 return true; 49 return true;
51 } 50 }
52 } 51 }
53 return false; 52 return false;
54 } 53 }
55 54
56 // Searches |proxy_rules| for any Data Reduction Proxies, even if they don't 55 // Searches |proxy_rules| for any Data Reduction Proxies, even if they don't
57 // match a currently configured Data Reduction Proxy. 56 // match a currently configured Data Reduction Proxy.
58 bool ContainsDataReductionProxyDefaultHostSuffix( 57 bool ContainsDataReductionProxyDefaultHostSuffix(
59 const net::ProxyConfig::ProxyRules& proxy_rules) { 58 const net::ProxyConfig::ProxyRules& proxy_rules) {
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 #elif defined(OS_OPENBSD) 229 #elif defined(OS_OPENBSD)
231 return data_reduction_proxy::Client::CHROME_OPENBSD; 230 return data_reduction_proxy::Client::CHROME_OPENBSD;
232 #elif defined(OS_SOLARIS) 231 #elif defined(OS_SOLARIS)
233 return data_reduction_proxy::Client::CHROME_SOLARIS; 232 return data_reduction_proxy::Client::CHROME_SOLARIS;
234 #elif defined(OS_QNX) 233 #elif defined(OS_QNX)
235 return data_reduction_proxy::Client::CHROME_QNX; 234 return data_reduction_proxy::Client::CHROME_QNX;
236 #else 235 #else
237 return data_reduction_proxy::Client::UNKNOWN; 236 return data_reduction_proxy::Client::UNKNOWN;
238 #endif 237 #endif
239 } 238 }
OLDNEW
« no previous file with comments | « chrome/browser/net/pref_proxy_config_tracker_impl.cc ('k') | chrome/browser/safe_browsing/safe_browsing_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698