diff options
author | brettw <brettw@chromium.org> | 2015-07-16 16:57:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-16 23:58:34 +0000 |
commit | 955093110ad64d5ec6f5426991efaa4a680b5d6f (patch) | |
tree | 19368cdb8861595640715e1072789959729efc2d /pdf/document_loader.cc | |
parent | 387e05a79c7ae346ba7db36977ddfca7ca6f10a3 (diff) | |
download | chromium_src-955093110ad64d5ec6f5426991efaa4a680b5d6f.zip chromium_src-955093110ad64d5ec6f5426991efaa4a680b5d6f.tar.gz chromium_src-955093110ad64d5ec6f5426991efaa4a680b5d6f.tar.bz2 |
Remove legacy StartsWithASCII function.
This replaces it with base::StartsWith and the appropriate case flag. Since the existing version only ever did case-insensitive tests in ASCII, there should be no behavior change.
BUG=506255
TBR=jam
Review URL: https://codereview.chromium.org/1242023005
Cr-Commit-Position: refs/heads/master@{#339175}
Diffstat (limited to 'pdf/document_loader.cc')
-rw-r--r-- | pdf/document_loader.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pdf/document_loader.cc b/pdf/document_loader.cc index 28a6ee4..a156cbe 100644 --- a/pdf/document_loader.cc +++ b/pdf/document_loader.cc @@ -29,7 +29,8 @@ bool GetByteRange(const std::string& headers, uint32_t* start, uint32_t* end) { while (it.GetNext()) { if (base::LowerCaseEqualsASCII(it.name(), "content-range")) { std::string range = it.values().c_str(); - if (base::StartsWithASCII(range, "bytes", false)) { + if (base::StartsWith(range, "bytes", + base::CompareCase::INSENSITIVE_ASCII)) { range = range.substr(strlen("bytes")); std::string::size_type pos = range.find('-'); std::string range_end; @@ -53,7 +54,7 @@ std::string GetMultiPartBoundary(const std::string& headers) { while (it.GetNext()) { if (base::LowerCaseEqualsASCII(it.name(), "content-type")) { std::string type = base::StringToLowerASCII(it.values()); - if (base::StartsWithASCII(type, "multipart/", true)) { + if (base::StartsWith(type, "multipart/", base::CompareCase::SENSITIVE)) { const char* boundary = strstr(type.c_str(), "boundary="); if (!boundary) { NOTREACHED(); @@ -121,8 +122,10 @@ bool DocumentLoader::Init(const pp::URLLoader& loader, // This happens for PDFs not loaded from http(s) sources. if (response_headers == "Content-Type: text/plain") { - if (!base::StartsWithASCII(url, "http://", false) && - !base::StartsWithASCII(url, "https://", false)) { + if (!base::StartsWith(url, "http://", + base::CompareCase::INSENSITIVE_ASCII) && + !base::StartsWith(url, "https://", + base::CompareCase::INSENSITIVE_ASCII)) { type = "application/pdf"; } } @@ -150,7 +153,8 @@ bool DocumentLoader::Init(const pp::URLLoader& loader, } if (!type.empty() && !IsValidContentType(type)) return false; - if (base::StartsWithASCII(disposition, "attachment", false)) + if (base::StartsWith(disposition, "attachment", + base::CompareCase::INSENSITIVE_ASCII)) return false; if (content_length > 0) |