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

Side by Side Diff: components/variations/net/variations_http_header_provider.cc

Issue 1239493005: Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 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 "components/variations/net/variations_http_header_provider.h" 5 #include "components/variations/net/variations_http_header_provider.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 return true; 273 return true;
274 } 274 }
275 275
276 if (!url.is_valid() || !url.SchemeIsHTTPOrHTTPS()) 276 if (!url.is_valid() || !url.SchemeIsHTTPOrHTTPS())
277 return false; 277 return false;
278 278
279 // Some domains don't have international TLD extensions, so testing for them 279 // Some domains don't have international TLD extensions, so testing for them
280 // is very straight forward. 280 // is very straight forward.
281 const std::string host = url.host(); 281 const std::string host = url.host();
282 for (size_t i = 0; i < arraysize(kSuffixesToSetHeadersFor); ++i) { 282 for (size_t i = 0; i < arraysize(kSuffixesToSetHeadersFor); ++i) {
283 if (base::EndsWith(host, kSuffixesToSetHeadersFor[i], false)) 283 if (base::EndsWith(host, kSuffixesToSetHeadersFor[i],
284 base::CompareCase::INSENSITIVE_ASCII))
284 return true; 285 return true;
285 } 286 }
286 287
287 return google_util::IsYoutubeDomainUrl(url, google_util::ALLOW_SUBDOMAIN, 288 return google_util::IsYoutubeDomainUrl(url, google_util::ALLOW_SUBDOMAIN,
288 google_util::ALLOW_NON_STANDARD_PORTS); 289 google_util::ALLOW_NON_STANDARD_PORTS);
289 } 290 }
290 291
291 } // namespace variations 292 } // namespace variations
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698