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

Unified Diff: pdf/document_loader.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 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 | « mojo/runner/shell_apptest.cc ('k') | remoting/host/it2me/it2me_native_messaging_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/document_loader.cc
diff --git a/pdf/document_loader.cc b/pdf/document_loader.cc
index 28a6ee4ebd74dfc643fd49759ddde124f7847d0b..a156cbeec369fd2de22860ab65be4feb0f00a41b 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)
« no previous file with comments | « mojo/runner/shell_apptest.cc ('k') | remoting/host/it2me/it2me_native_messaging_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698