diff options
author | brettw <brettw@chromium.org> | 2015-08-11 12:30:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-11 19:31:27 +0000 |
commit | 8e2106dd88a61950569f9cfa8a94ad436d858658 (patch) | |
tree | b95818b8b8d98565bc0beaae50ffb76fa3d82080 /pdf | |
parent | 7d42dad6d95bf258c721f9d15f734bb9d0af8014 (diff) | |
download | chromium_src-8e2106dd88a61950569f9cfa8a94ad436d858658.zip chromium_src-8e2106dd88a61950569f9cfa8a94ad436d858658.tar.gz chromium_src-8e2106dd88a61950569f9cfa8a94ad436d858658.tar.bz2 |
Convert remaining StringToLowerASCII to ToLowerASCII.
Remove StringToLowerASCII. This removes the template and makes a consistent call that can take a string piece.
http_response_headers.cc in HttpResponseHeaders::RemoveHeaderLine there seemed to be a bug where it did
std::string old_header_name_lowercase(name);
where it actually meant
std::string old_header_name_lowercase(old_header_name);
I fixed this.
There were a number of cases where url.host() or url.scheme() was passed to ToLowerASCII. These are already guaranteed lower-case, so I removed the call.
There were a number of cases in net that did return ToLowerASCII().c_str() when the return type is a std::string, which is unnecessary and wasteful. I removed the c_str() call.
NOPRESUBMIT=true
(for touching code with wstrings)
Review URL: https://codereview.chromium.org/1282363003
Cr-Commit-Position: refs/heads/master@{#342869}
Diffstat (limited to 'pdf')
-rw-r--r-- | pdf/document_loader.cc | 2 | ||||
-rw-r--r-- | pdf/pdfium/pdfium_page.cc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/pdf/document_loader.cc b/pdf/document_loader.cc index a156cbe..868a8c4 100644 --- a/pdf/document_loader.cc +++ b/pdf/document_loader.cc @@ -53,7 +53,7 @@ std::string GetMultiPartBoundary(const std::string& headers) { net::HttpUtil::HeadersIterator it(headers.begin(), headers.end(), "\n"); while (it.GetNext()) { if (base::LowerCaseEqualsASCII(it.name(), "content-type")) { - std::string type = base::StringToLowerASCII(it.values()); + std::string type = base::ToLowerASCII(it.values()); if (base::StartsWith(type, "multipart/", base::CompareCase::SENSITIVE)) { const char* boundary = strstr(type.c_str(), "boundary="); if (!boundary) { diff --git a/pdf/pdfium/pdfium_page.cc b/pdf/pdfium/pdfium_page.cc index a7912a6..79410c4 100644 --- a/pdf/pdfium/pdfium_page.cc +++ b/pdf/pdfium/pdfium_page.cc @@ -204,8 +204,8 @@ base::Value* PDFiumPage::GetTextBoxAsValue(double page_height, DCHECK(targets[i].url[targets[i].url.size() - 1] != '\0'); // PDFium may change the case of generated links. - std::string lowerCaseURL = base::StringToLowerASCII(targets[i].url); - std::string lowerCaseText = base::StringToLowerASCII(text_utf8); + std::string lowerCaseURL = base::ToLowerASCII(targets[i].url); + std::string lowerCaseText = base::ToLowerASCII(text_utf8); size_t pos = lowerCaseText.find(lowerCaseURL, start); size_t length = targets[i].url.size(); if (pos == std::string::npos) { |