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

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

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 default_trigger_id_set_.clear(); 90 default_trigger_id_set_.clear();
91 std::vector<std::string> entries; 91 std::vector<std::string> entries;
92 base::SplitString(variation_ids, ',', &entries); 92 base::SplitString(variation_ids, ',', &entries);
93 for (std::vector<std::string>::const_iterator it = entries.begin(); 93 for (std::vector<std::string>::const_iterator it = entries.begin();
94 it != entries.end(); ++it) { 94 it != entries.end(); ++it) {
95 if (it->empty()) { 95 if (it->empty()) {
96 default_variation_ids_set_.clear(); 96 default_variation_ids_set_.clear();
97 default_trigger_id_set_.clear(); 97 default_trigger_id_set_.clear();
98 return false; 98 return false;
99 } 99 }
100 bool trigger_id = base::StartsWithASCII(*it, "t", true); 100 bool trigger_id = base::StartsWith(*it, "t", base::CompareCase::SENSITIVE);
101 // Remove the "t" prefix if it's there. 101 // Remove the "t" prefix if it's there.
102 std::string entry = trigger_id ? it->substr(1) : *it; 102 std::string entry = trigger_id ? it->substr(1) : *it;
103 103
104 int variation_id = 0; 104 int variation_id = 0;
105 if (!base::StringToInt(entry, &variation_id)) { 105 if (!base::StringToInt(entry, &variation_id)) {
106 default_variation_ids_set_.clear(); 106 default_variation_ids_set_.clear();
107 default_trigger_id_set_.clear(); 107 default_trigger_id_set_.clear();
108 return false; 108 return false;
109 } 109 }
110 if (trigger_id) 110 if (trigger_id)
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 if (base::EndsWith(host, kSuffixesToSetHeadersFor[i], 283 if (base::EndsWith(host, kSuffixesToSetHeadersFor[i],
284 base::CompareCase::INSENSITIVE_ASCII)) 284 base::CompareCase::INSENSITIVE_ASCII))
285 return true; 285 return true;
286 } 286 }
287 287
288 return google_util::IsYoutubeDomainUrl(url, google_util::ALLOW_SUBDOMAIN, 288 return google_util::IsYoutubeDomainUrl(url, google_util::ALLOW_SUBDOMAIN,
289 google_util::ALLOW_NON_STANDARD_PORTS); 289 google_util::ALLOW_NON_STANDARD_PORTS);
290 } 290 }
291 291
292 } // namespace variations 292 } // namespace variations
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698