summaryrefslogtreecommitdiffstats
path: root/pdf
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-07-16 10:49:29 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-16 17:50:12 +0000
commita7ff1b291cd328e9584779a4bb9101fa9a3c01ad (patch)
treed010374be1ca156ea26405ae7b0aa85e48bb4bba /pdf
parent7befa9cf85342a0409502ed2c05d7610afec7844 (diff)
downloadchromium_src-a7ff1b291cd328e9584779a4bb9101fa9a3c01ad.zip
chromium_src-a7ff1b291cd328e9584779a4bb9101fa9a3c01ad.tar.gz
chromium_src-a7ff1b291cd328e9584779a4bb9101fa9a3c01ad.tar.bz2
Remove some legacy versions of StartsWith and EndsWith.
This just replaces true -> base::CompareCase::SENSITIVE false -> base::CompareCase::INSENSITIVE_ASCII I checked the insensitive cases to make sure they're not doing anything suspicious. The old version is a sometimes-correct Unicode comparison so converting to INSENSTITIVE_ASCII isn't a no-op. However, generally the prefix/suffix checking is done against a hardcoded string so there were very few cases to actually look at. extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc has a not-quite search-and-replace change where I changed the type of a class variable. BUG=506255 TBR=jam Reland of http://crrev.com/1239493005 Review URL: https://codereview.chromium.org/1233043003 Cr-Commit-Position: refs/heads/master@{#339071}
Diffstat (limited to 'pdf')
-rw-r--r--pdf/document_loader.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/pdf/document_loader.cc b/pdf/document_loader.cc
index f696656..28a6ee4 100644
--- a/pdf/document_loader.cc
+++ b/pdf/document_loader.cc
@@ -68,12 +68,15 @@ std::string GetMultiPartBoundary(const std::string& headers) {
}
bool IsValidContentType(const std::string& type) {
- return (base::EndsWith(type, "/pdf", false) ||
- base::EndsWith(type, ".pdf", false) ||
- base::EndsWith(type, "/x-pdf", false) ||
- base::EndsWith(type, "/*", false) ||
- base::EndsWith(type, "/acrobat", false) ||
- base::EndsWith(type, "/unknown", false));
+ return (base::EndsWith(type, "/pdf", base::CompareCase::INSENSITIVE_ASCII) ||
+ base::EndsWith(type, ".pdf", base::CompareCase::INSENSITIVE_ASCII) ||
+ base::EndsWith(type, "/x-pdf",
+ base::CompareCase::INSENSITIVE_ASCII) ||
+ base::EndsWith(type, "/*", base::CompareCase::INSENSITIVE_ASCII) ||
+ base::EndsWith(type, "/acrobat",
+ base::CompareCase::INSENSITIVE_ASCII) ||
+ base::EndsWith(type, "/unknown",
+ base::CompareCase::INSENSITIVE_ASCII));
}
} // namespace