diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-13 16:23:25 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-13 16:25:00 +0000 |
commit | eee3522979ae33c9ddc7ec33c769b2c3f0a48320 (patch) | |
tree | 46c85b8ad29772c08e4a423303128e976cb4b20f /pdf/document_loader.cc | |
parent | 67c87495f7b272a74ab1944af19202531b766b5b (diff) | |
download | chromium_src-eee3522979ae33c9ddc7ec33c769b2c3f0a48320.zip chromium_src-eee3522979ae33c9ddc7ec33c769b2c3f0a48320.tar.gz chromium_src-eee3522979ae33c9ddc7ec33c769b2c3f0a48320.tar.bz2 |
Move StringToUpperASCII and LowerCaseEqualsASCII to the base namespace
Convert LowerCaseEqualsASCII to take StringPiece. In the current patch this is
generally a NOP but will allow me to delete the other 4 variants in a followup
(wanted to do that separately since that will require more review, since
callsites will be changed in nontrivial ways).
In some cases, LowerCaseEqualsASCII is called with a WebString, which no
longer is implicitly converted. I added base::string16(...) around such
calls to force the right conversion. It happened in these files:
window_container_type.cc
savable_resources.cc
render_view_impl.cc
blink_ax_tree_source.cc
password_form_conversion_utils.cc
translate_helper.cc
chrome_render_view_observer.cc
dom_serializer_browsertest.cc
R=jamesr@chromium.org
Review URL: https://codereview.chromium.org/448143008
Cr-Commit-Position: refs/heads/master@{#289312}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289312 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'pdf/document_loader.cc')
-rw-r--r-- | pdf/document_loader.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pdf/document_loader.cc b/pdf/document_loader.cc index 6b871d6..132d27d 100644 --- a/pdf/document_loader.cc +++ b/pdf/document_loader.cc @@ -55,20 +55,20 @@ bool DocumentLoader::Init(const pp::URLLoader& loader, net::HttpUtil::HeadersIterator it(response_headers.begin(), response_headers.end(), "\n"); while (it.GetNext()) { - if (LowerCaseEqualsASCII(it.name(), "content-length")) { + if (base::LowerCaseEqualsASCII(it.name(), "content-length")) { content_length = atoi(it.values().c_str()); - } else if (LowerCaseEqualsASCII(it.name(), "accept-ranges")) { - accept_ranges_bytes = LowerCaseEqualsASCII(it.values(), "bytes"); - } else if (LowerCaseEqualsASCII(it.name(), "content-encoding")) { + } else if (base::LowerCaseEqualsASCII(it.name(), "accept-ranges")) { + accept_ranges_bytes = base::LowerCaseEqualsASCII(it.values(), "bytes"); + } else if (base::LowerCaseEqualsASCII(it.name(), "content-encoding")) { content_encoded = true; - } else if (LowerCaseEqualsASCII(it.name(), "content-type")) { + } else if (base::LowerCaseEqualsASCII(it.name(), "content-type")) { type = it.values(); size_t semi_colon_pos = type.find(';'); if (semi_colon_pos != std::string::npos) { type = type.substr(0, semi_colon_pos); } TrimWhitespace(type, base::TRIM_ALL, &type); - } else if (LowerCaseEqualsASCII(it.name(), "content-disposition")) { + } else if (base::LowerCaseEqualsASCII(it.name(), "content-disposition")) { disposition = it.values(); } } @@ -334,7 +334,7 @@ bool DocumentLoader::GetByteRange(const std::string& headers, uint32* start, uint32* end) { net::HttpUtil::HeadersIterator it(headers.begin(), headers.end(), "\n"); while (it.GetNext()) { - if (LowerCaseEqualsASCII(it.name(), "content-range")) { + if (base::LowerCaseEqualsASCII(it.name(), "content-range")) { std::string range = it.values().c_str(); if (StartsWithASCII(range, "bytes", false)) { range = range.substr(strlen("bytes")); @@ -356,7 +356,7 @@ bool DocumentLoader::GetByteRange(const std::string& headers, uint32* start, std::string DocumentLoader::GetMultiPartBoundary(const std::string& headers) { net::HttpUtil::HeadersIterator it(headers.begin(), headers.end(), "\n"); while (it.GetNext()) { - if (LowerCaseEqualsASCII(it.name(), "content-type")) { + if (base::LowerCaseEqualsASCII(it.name(), "content-type")) { std::string type = base::StringToLowerASCII(it.values()); if (StartsWithASCII(type, "multipart/", true)) { const char* boundary = strstr(type.c_str(), "boundary="); |