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

Unified Diff: net/http/http_util.cc

Issue 1172753003: Move LowerCaseEqualsASCII to base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_security_headers.cc ('k') | net/proxy/proxy_bypass_rules.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util.cc
diff --git a/net/http/http_util.cc b/net/http/http_util.cc
index baa2eff1043a34926c328be9eeadf15d08cbf3cd..a22ee605425d39db603465f0bedae2b7867a3a75 100644
--- a/net/http/http_util.cc
+++ b/net/http/http_util.cc
@@ -118,13 +118,14 @@ void HttpUtil::ParseContentType(const std::string& content_type_str,
DCHECK(param_value_begin <= tokenizer.token_end());
TrimLWS(&param_value_begin, &param_value_end);
- if (LowerCaseEqualsASCII(param_name_begin, param_name_end, "charset")) {
+ if (base::LowerCaseEqualsASCII(param_name_begin, param_name_end,
+ "charset")) {
// TODO(abarth): Refactor this function to consistently use iterators.
charset_val = param_value_begin - begin;
charset_end = param_value_end - begin;
type_has_charset = true;
- } else if (LowerCaseEqualsASCII(param_name_begin, param_name_end,
- "boundary")) {
+ } else if (base::LowerCaseEqualsASCII(param_name_begin, param_name_end,
+ "boundary")) {
if (boundary)
boundary->assign(param_value_begin, param_value_end);
}
@@ -160,9 +161,9 @@ void HttpUtil::ParseContentType(const std::string& content_type_str,
content_type_str != "*/*" &&
content_type_str.find_first_of('/') != std::string::npos) {
// Common case here is that mime_type is empty
- bool eq = !mime_type->empty() && LowerCaseEqualsASCII(begin + type_val,
- begin + type_end,
- mime_type->data());
+ bool eq = !mime_type->empty() &&
+ base::LowerCaseEqualsASCII(begin + type_val, begin + type_end,
+ mime_type->data());
if (!eq) {
mime_type->assign(begin + type_val, begin + type_end);
base::StringToLowerASCII(mime_type);
@@ -190,7 +191,7 @@ bool HttpUtil::ParseRanges(const std::string& headers,
while (it.GetNext()) {
// Look for "Range" header.
- if (!LowerCaseEqualsASCII(it.name(), "range"))
+ if (!base::LowerCaseEqualsASCII(it.name(), "range"))
continue;
ranges_specifier = it.values();
// We just care about the first "Range" header, so break here.
@@ -219,7 +220,7 @@ bool HttpUtil::ParseRangeHeader(const std::string& ranges_specifier,
TrimLWS(&bytes_unit_begin, &bytes_unit_end);
// "bytes" unit identifier is not found.
- if (!LowerCaseEqualsASCII(bytes_unit_begin, bytes_unit_end, "bytes"))
+ if (!base::LowerCaseEqualsASCII(bytes_unit_begin, bytes_unit_end, "bytes"))
return false;
ValuesIterator byte_range_set_iterator(byte_range_set_begin,
@@ -385,8 +386,8 @@ std::string HttpUtil::StripHeaders(const std::string& headers,
while (it.GetNext()) {
bool should_remove = false;
for (size_t i = 0; i < headers_to_remove_len; ++i) {
- if (LowerCaseEqualsASCII(it.name_begin(), it.name_end(),
- headers_to_remove[i])) {
+ if (base::LowerCaseEqualsASCII(it.name_begin(), it.name_end(),
+ headers_to_remove[i])) {
should_remove = true;
break;
}
@@ -421,7 +422,8 @@ bool HttpUtil::IsNonCoalescingHeader(std::string::const_iterator name_begin,
"strict-transport-security"
};
for (size_t i = 0; i < arraysize(kNonCoalescingHeaders); ++i) {
- if (LowerCaseEqualsASCII(name_begin, name_end, kNonCoalescingHeaders[i]))
+ if (base::LowerCaseEqualsASCII(name_begin, name_end,
+ kNonCoalescingHeaders[i]))
return true;
}
return false;
@@ -535,7 +537,7 @@ int HttpUtil::LocateStartOfStatusLine(const char* buf, int buf_len) {
if (buf_len >= http_len) {
int i_max = std::min(buf_len - http_len, slop);
for (int i = 0; i <= i_max; ++i) {
- if (LowerCaseEqualsASCII(buf + i, buf + i + http_len, "http"))
+ if (base::LowerCaseEqualsASCII(buf + i, buf + i + http_len, "http"))
return i;
}
}
@@ -731,7 +733,7 @@ bool HttpUtil::HasStrongValidators(HttpVersion version,
std::string::const_iterator i = etag_header.begin();
std::string::const_iterator j = etag_header.begin() + slash;
TrimLWS(&i, &j);
- if (!LowerCaseEqualsASCII(i, j, "w"))
+ if (!base::LowerCaseEqualsASCII(i, j, "w"))
return true;
}
@@ -832,7 +834,7 @@ bool HttpUtil::HeadersIterator::AdvanceTo(const char* name) {
<< "the header name must be in all lower case";
while (GetNext()) {
- if (LowerCaseEqualsASCII(name_begin_, name_end_, name)) {
+ if (base::LowerCaseEqualsASCII(name_begin_, name_end_, name)) {
return true;
}
}
« no previous file with comments | « net/http/http_security_headers.cc ('k') | net/proxy/proxy_bypass_rules.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698