summaryrefslogtreecommitdiffstats
path: root/net/http/http_response_headers.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/http/http_response_headers.cc')
-rw-r--r--net/http/http_response_headers.cc28
1 files changed, 15 insertions, 13 deletions
diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc
index 99c5404..c2d098c 100644
--- a/net/http/http_response_headers.cc
+++ b/net/http/http_response_headers.cc
@@ -484,7 +484,7 @@ bool HttpResponseHeaders::HasHeaderValue(const std::string& name,
while (EnumerateHeader(&iter, name, &temp)) {
if (value.size() == temp.size() &&
std::equal(temp.begin(), temp.end(), value.begin(),
- CaseInsensitiveCompare<char>()))
+ base::CaseInsensitiveCompare<char>()))
return true;
}
return false;
@@ -598,7 +598,7 @@ void HttpResponseHeaders::ParseStatusLine(
raw_headers_.push_back(' ');
raw_headers_.append(code, p);
raw_headers_.push_back(' ');
- base::StringToInt(std::string(code, p), &response_code_);
+ base::StringToInt(code, p, &response_code_);
// Skip whitespace.
while (*p == ' ')
@@ -629,7 +629,7 @@ size_t HttpResponseHeaders::FindHeader(size_t from,
const std::string::const_iterator& name_end = parsed_[i].name_end;
if (static_cast<size_t>(name_end - name_begin) == search.size() &&
std::equal(name_begin, name_end, search.begin(),
- CaseInsensitiveCompare<char>()))
+ base::CaseInsensitiveCompare<char>()))
return i;
}
@@ -973,7 +973,9 @@ bool HttpResponseHeaders::GetMaxAgeValue(TimeDelta* result) const {
value.begin() + kMaxAgePrefixLen,
kMaxAgePrefix)) {
int64 seconds;
- base::StringToInt64(value.substr(kMaxAgePrefixLen), &seconds);
+ base::StringToInt64(value.begin() + kMaxAgePrefixLen,
+ value.end(),
+ &seconds);
*result = TimeDelta::FromSeconds(seconds);
return true;
}
@@ -1148,9 +1150,9 @@ bool HttpResponseHeaders::GetContentRange(int64* first_byte_position,
byte_range_resp_spec.begin() + minus_position;
HttpUtil::TrimLWS(&first_byte_pos_begin, &first_byte_pos_end);
- bool ok = base::StringToInt64(
- std::string(first_byte_pos_begin, first_byte_pos_end),
- first_byte_position);
+ bool ok = base::StringToInt64(first_byte_pos_begin,
+ first_byte_pos_end,
+ first_byte_position);
// Obtain last-byte-pos.
std::string::const_iterator last_byte_pos_begin =
@@ -1159,9 +1161,9 @@ bool HttpResponseHeaders::GetContentRange(int64* first_byte_position,
byte_range_resp_spec.end();
HttpUtil::TrimLWS(&last_byte_pos_begin, &last_byte_pos_end);
- ok &= base::StringToInt64(
- std::string(last_byte_pos_begin, last_byte_pos_end),
- last_byte_position);
+ ok &= base::StringToInt64(last_byte_pos_begin,
+ last_byte_pos_end,
+ last_byte_position);
if (!ok) {
*first_byte_position = *last_byte_position = -1;
return false;
@@ -1184,9 +1186,9 @@ bool HttpResponseHeaders::GetContentRange(int64* first_byte_position,
if (LowerCaseEqualsASCII(instance_length_begin, instance_length_end, "*")) {
return false;
- } else if (!base::StringToInt64(
- std::string(instance_length_begin, instance_length_end),
- instance_length)) {
+ } else if (!base::StringToInt64(instance_length_begin,
+ instance_length_end,
+ instance_length)) {
*instance_length = -1;
return false;
}