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

Side by Side Diff: net/http/http_request_headers.cc

Issue 1224553010: Replace base::str[n]casecmp with helper functions. (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
« no previous file with comments | « net/http/http_log_util.cc ('k') | net/tools/balsa/balsa_headers.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/http/http_request_headers.h" 5 #include "net/http/http_request_headers.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_split.h" 8 #include "base/strings/string_split.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 234 }
235 headers->AddHeaderFromString(header_line); 235 headers->AddHeaderFromString(header_line);
236 } 236 }
237 return true; 237 return true;
238 } 238 }
239 239
240 HttpRequestHeaders::HeaderVector::iterator 240 HttpRequestHeaders::HeaderVector::iterator
241 HttpRequestHeaders::FindHeader(const base::StringPiece& key) { 241 HttpRequestHeaders::FindHeader(const base::StringPiece& key) {
242 for (HeaderVector::iterator it = headers_.begin(); 242 for (HeaderVector::iterator it = headers_.begin();
243 it != headers_.end(); ++it) { 243 it != headers_.end(); ++it) {
244 if (key.length() == it->key.length() && 244 if (base::EqualsCaseInsensitiveASCII(key, it->key))
245 !base::strncasecmp(key.data(), it->key.data(), key.length()))
246 return it; 245 return it;
247 } 246 }
248 247
249 return headers_.end(); 248 return headers_.end();
250 } 249 }
251 250
252 HttpRequestHeaders::HeaderVector::const_iterator 251 HttpRequestHeaders::HeaderVector::const_iterator
253 HttpRequestHeaders::FindHeader(const base::StringPiece& key) const { 252 HttpRequestHeaders::FindHeader(const base::StringPiece& key) const {
254 for (HeaderVector::const_iterator it = headers_.begin(); 253 for (HeaderVector::const_iterator it = headers_.begin();
255 it != headers_.end(); ++it) { 254 it != headers_.end(); ++it) {
256 if (key.length() == it->key.length() && 255 if (base::EqualsCaseInsensitiveASCII(key, it->key))
257 !base::strncasecmp(key.data(), it->key.data(), key.length()))
258 return it; 256 return it;
259 } 257 }
260 258
261 return headers_.end(); 259 return headers_.end();
262 } 260 }
263 261
264 } // namespace net 262 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_log_util.cc ('k') | net/tools/balsa/balsa_headers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698