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

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

Issue 1239493005: 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/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 25 matching lines...) Expand all
36 // Assume that any proxy host ending with this suffix is a Data Reduction Proxy. 36 // Assume that any proxy host ending with this suffix is a Data Reduction Proxy.
37 const char kDataReductionProxyDefaultHostSuffix[] = ".googlezip.net"; 37 const char kDataReductionProxyDefaultHostSuffix[] = ".googlezip.net";
38 38
39 // Searches |proxy_list| for any Data Reduction Proxies, even if they don't 39 // Searches |proxy_list| for any Data Reduction Proxies, even if they don't
40 // match a currently configured Data Reduction Proxy. 40 // match a currently configured Data Reduction Proxy.
41 bool ContainsDataReductionProxyDefaultHostSuffix( 41 bool ContainsDataReductionProxyDefaultHostSuffix(
42 const net::ProxyList& proxy_list) { 42 const net::ProxyList& proxy_list) {
43 for (const net::ProxyServer& proxy : proxy_list.GetAll()) { 43 for (const net::ProxyServer& proxy : proxy_list.GetAll()) {
44 if (proxy.is_valid() && !proxy.is_direct() && 44 if (proxy.is_valid() && !proxy.is_direct() &&
45 base::EndsWith(proxy.host_port_pair().host(), 45 base::EndsWith(proxy.host_port_pair().host(),
46 kDataReductionProxyDefaultHostSuffix, true)) { 46 kDataReductionProxyDefaultHostSuffix,
47 base::CompareCase::SENSITIVE)) {
47 return true; 48 return true;
48 } 49 }
49 } 50 }
50 return false; 51 return false;
51 } 52 }
52 53
53 // Searches |proxy_rules| for any Data Reduction Proxies, even if they don't 54 // Searches |proxy_rules| for any Data Reduction Proxies, even if they don't
54 // match a currently configured Data Reduction Proxy. 55 // match a currently configured Data Reduction Proxy.
55 bool ContainsDataReductionProxyDefaultHostSuffix( 56 bool ContainsDataReductionProxyDefaultHostSuffix(
56 const net::ProxyConfig::ProxyRules& proxy_rules) { 57 const net::ProxyConfig::ProxyRules& proxy_rules) {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 #elif defined(OS_OPENBSD) 229 #elif defined(OS_OPENBSD)
229 return data_reduction_proxy::Client::CHROME_OPENBSD; 230 return data_reduction_proxy::Client::CHROME_OPENBSD;
230 #elif defined(OS_SOLARIS) 231 #elif defined(OS_SOLARIS)
231 return data_reduction_proxy::Client::CHROME_SOLARIS; 232 return data_reduction_proxy::Client::CHROME_SOLARIS;
232 #elif defined(OS_QNX) 233 #elif defined(OS_QNX)
233 return data_reduction_proxy::Client::CHROME_QNX; 234 return data_reduction_proxy::Client::CHROME_QNX;
234 #else 235 #else
235 return data_reduction_proxy::Client::UNKNOWN; 236 return data_reduction_proxy::Client::UNKNOWN;
236 #endif 237 #endif
237 } 238 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698