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

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

Issue 1182183003: Move EndsWith to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 24 matching lines...) Expand all
35 35
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 EndsWith(proxy.host_port_pair().host(), 45 base::EndsWith(proxy.host_port_pair().host(),
46 kDataReductionProxyDefaultHostSuffix, true)) { 46 kDataReductionProxyDefaultHostSuffix, true)) {
47 return true; 47 return true;
48 } 48 }
49 } 49 }
50 return false; 50 return false;
51 } 51 }
52 52
53 // Searches |proxy_rules| for any Data Reduction Proxies, even if they don't 53 // Searches |proxy_rules| for any Data Reduction Proxies, even if they don't
54 // match a currently configured Data Reduction Proxy. 54 // match a currently configured Data Reduction Proxy.
55 bool ContainsDataReductionProxyDefaultHostSuffix( 55 bool ContainsDataReductionProxyDefaultHostSuffix(
56 const net::ProxyConfig::ProxyRules& proxy_rules) { 56 const net::ProxyConfig::ProxyRules& proxy_rules) {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 #elif defined(OS_OPENBSD) 230 #elif defined(OS_OPENBSD)
231 return data_reduction_proxy::Client::CHROME_OPENBSD; 231 return data_reduction_proxy::Client::CHROME_OPENBSD;
232 #elif defined(OS_SOLARIS) 232 #elif defined(OS_SOLARIS)
233 return data_reduction_proxy::Client::CHROME_SOLARIS; 233 return data_reduction_proxy::Client::CHROME_SOLARIS;
234 #elif defined(OS_QNX) 234 #elif defined(OS_QNX)
235 return data_reduction_proxy::Client::CHROME_QNX; 235 return data_reduction_proxy::Client::CHROME_QNX;
236 #else 236 #else
237 return data_reduction_proxy::Client::UNKNOWN; 237 return data_reduction_proxy::Client::UNKNOWN;
238 #endif 238 #endif
239 } 239 }
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