Replace base::str[n]casecmp with helper functions.

Adds CompareCaseInsensitiveASCII and EqualsCaseInsensitiveASCII helper functions and removes base::strcasecmp and base::strncasecmp. This avoids the dangerous locale-sensitive behavior.

ClientIsAdvertisingSdchEncoding in sdch_browsertest had the condition inverted, but because it returned true any time the given line wasn't found, the test didn't notice.

cups_helper changed most significantly. I redid the loop to use StringPieces which saves a lot of copies. On line 82 cups_helper used to do a prefix match which I'm pretty sure it wanted a regular compare. I changed this.

render_text_harfbuzz set "<" operator was also doing a prefix comparison only, when it looks like it really just wanted to compare the strings.

file_path passed string pieces into strcasecmp which could then read off the end if they're not null terminated. This patch fixes the bug and calls the native strcasecmp which is probably the best we can do for Posix file names.

Removed additional version of the same function in net.

Adds a backwards-compat hack for crashpad which improperly uses base from a DEPS-ed in repo.

Review URL: https://codereview.chromium.org/1224553010

Cr-Original-Commit-Position: refs/heads/master@{#338324}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8a800901b78a29e33bc91b48621cec72964a1f14
1 file changed
tree: b8bd0997c8aca61dd8193d9b90f3dacf154d5108
  1. tools/