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

Issue 1224553010: Replace base::str[n]casecmp with helper functions. (Closed)

Created:
5 years, 5 months ago by brettw
Modified:
5 years, 5 months ago
Reviewers:
Nico, Ryan Sleevi
CC:
chromium-reviews, qsr+mojo_chromium.org, tzik, erikwright (departed), yzshen+watch_chromium.org, kinuko+watch, ben+mojo_chromium.org, jsbell+serviceworker_chromium.org, cbentzel+watch_chromium.org, Aaron Boodman, samuong+watch_chromium.org, viettrungluu+watch_chromium.org, jam, abarth-chromium, darin-cc_chromium.org, chromium-apps-reviews_chromium.org, erikwright+watch_chromium.org, derat+watch_chromium.org, extensions-reviews_chromium.org, nhiroki, michaeln, Lei Zhang, tfarina, serviceworker-reviews, tommycli, kinuko+serviceworker, mmenke, horo+watch_chromium.org, darin (slow to review), kinuko+fileapi, jshin+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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. Committed: https://crrev.com/8a800901b78a29e33bc91b48621cec72964a1f14 Cr-Commit-Position: refs/heads/master@{#338324}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : . #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : Revert CLD #

Total comments: 18

Patch Set 9 : review comments #

Total comments: 2

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : crashpad hack #

Patch Set 13 : #

Patch Set 14 : #

Patch Set 15 : #

Total comments: 4

Patch Set 16 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+227 lines, -167 lines) Patch
M base/files/file_path.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -6 lines 0 comments Download
M base/strings/string_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +36 lines, -14 lines 0 comments Download
M base/strings/string_util.cc View 1 2 3 4 5 6 7 8 9 1 chunk +47 lines, -0 lines 0 comments Download
M base/strings/string_util_posix.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -8 lines 0 comments Download
M base/strings/string_util_unittest.cc View 1 chunk +20 lines, -0 lines 0 comments Download
M base/strings/string_util_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -8 lines 0 comments Download
M chrome/browser/media_galleries/fileapi/media_path_filter.cc View 1 2 3 4 5 1 chunk +6 lines, -9 lines 0 comments Download
M chrome/browser/net/sdch_browsertest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/printing/printing_layout_browsertest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/service/cloud_print/cloud_print_connector.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/service/cloud_print/cloud_print_proxy_backend.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/test/chromedriver/performance_logger.cc View 1 chunk +2 lines, -1 line 0 comments Download
M components/mime_util/mime_util.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/policy/core/common/registry_dict_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/common/service_worker/service_worker_types.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M content/plugin/webplugin_proxy.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M device/usb/usb_service_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -3 lines 0 comments Download
M extensions/browser/api/web_request/form_data_parser.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M media/video/capture/fake_video_capture_device_factory.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M mojo/services/network/http_connection_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -4 lines 0 comments Download
M net/base/mime_sniffer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +23 lines, -12 lines 0 comments Download
M net/base/mime_util.cc View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -6 lines 0 comments Download
M net/cookies/cookie_util.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M net/dns/dns_response.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/http/http_log_util.cc View 1 chunk +7 lines, -7 lines 0 comments Download
M net/http/http_request_headers.cc View 2 chunks +2 lines, -4 lines 0 comments Download
M net/tools/balsa/balsa_headers.h View 1 1 chunk +1 line, -1 line 0 comments Download
M net/tools/balsa/string_piece_utils.h View 1 1 chunk +1 line, -22 lines 0 comments Download
M net/tools/quic/test_tools/http_message.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M net/url_request/url_request_http_job_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M printing/backend/cups_helper.cc View 1 2 3 4 5 7 chunks +34 lines, -32 lines 0 comments Download
M skia/ext/image_operations_bench.cc View 1 chunk +1 line, -1 line 0 comments Download
M sql/connection.cc View 1 chunk +2 lines, -1 line 0 comments Download
M tools/gn/filesystem_utils.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/base/l10n/l10n_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/render_text_harfbuzz.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/test/fontconfig_util_linux.cc View 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 70 (35 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224553010/40001
5 years, 5 months ago (2015-07-07 21:26:10 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224553010/60001
5 years, 5 months ago (2015-07-07 21:40:55 UTC) #4
brettw
.
5 years, 5 months ago (2015-07-07 21:52:24 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224553010/80001
5 years, 5 months ago (2015-07-07 21:54:53 UTC) #7
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_rel_device_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_ninja/builds/84895) mac_chromium_rel_ng on ...
5 years, 5 months ago (2015-07-07 22:23:11 UTC) #9
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224553010/100001
5 years, 5 months ago (2015-07-07 22:43:05 UTC) #11
brettw
Another part of removing locale-dependent case comparison calls.
5 years, 5 months ago (2015-07-07 22:43:31 UTC) #13
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/84857) win_chromium_rel_ng on ...
5 years, 5 months ago (2015-07-08 00:08:37 UTC) #15
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224553010/120001
5 years, 5 months ago (2015-07-08 20:09:07 UTC) #17
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_dbg/builds/89452) android_chromium_gn_compile_rel on ...
5 years, 5 months ago (2015-07-08 20:23:24 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224553010/140001
5 years, 5 months ago (2015-07-08 21:00:50 UTC) #21
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/106252)
5 years, 5 months ago (2015-07-08 21:24:13 UTC) #23
Nico
https://codereview.chromium.org/1224553010/diff/140001/base/strings/string_util.h File base/strings/string_util.h (right): https://codereview.chromium.org/1224553010/diff/140001/base/strings/string_util.h#newcode98 base/strings/string_util.h:98: // DO NOT USE. tolower() will given incorrect results ...
5 years, 5 months ago (2015-07-08 21:58:24 UTC) #24
brettw
Thanks for the thorough review! https://codereview.chromium.org/1224553010/diff/140001/chrome/chrome_tests_unit.gypi File chrome/chrome_tests_unit.gypi (left): https://codereview.chromium.org/1224553010/diff/140001/chrome/chrome_tests_unit.gypi#oldcode714 chrome/chrome_tests_unit.gypi:714: 'browser/extensions/app_sync_data_unittest.cc', On 2015/07/08 21:58:23, ...
5 years, 5 months ago (2015-07-08 22:35:17 UTC) #25
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224553010/160001
5 years, 5 months ago (2015-07-08 22:37:37 UTC) #27
Nico
lgtm except for the gyp file which still removes test files randomly (and that minor ...
5 years, 5 months ago (2015-07-08 22:44:34 UTC) #28
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_dbg/builds/89564) mac_chromium_compile_dbg_ng on ...
5 years, 5 months ago (2015-07-08 22:49:05 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224553010/180001
5 years, 5 months ago (2015-07-09 17:24:50 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/77482)
5 years, 5 months ago (2015-07-09 17:36:46 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224553010/200001
5 years, 5 months ago (2015-07-09 18:01:49 UTC) #38
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/77503)
5 years, 5 months ago (2015-07-09 18:13:56 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224553010/200002
5 years, 5 months ago (2015-07-09 19:25:22 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/77555)
5 years, 5 months ago (2015-07-09 19:38:29 UTC) #45
brettw
rsleevi: net
5 years, 5 months ago (2015-07-09 20:01:01 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224553010/230001
5 years, 5 months ago (2015-07-09 20:26:02 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/43656) ios_rel_device_ninja on tryserver.chromium.mac (JOB_FAILED, ...
5 years, 5 months ago (2015-07-09 20:29:23 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224553010/250001
5 years, 5 months ago (2015-07-09 22:18:42 UTC) #56
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/77646)
5 years, 5 months ago (2015-07-09 22:34:47 UTC) #58
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224553010/270001
5 years, 5 months ago (2015-07-09 23:08:54 UTC) #61
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/77671)
5 years, 5 months ago (2015-07-09 23:20:05 UTC) #63
Ryan Sleevi
There's one BUG here indicated below. Given that the CQ seems to be over eager ...
5 years, 5 months ago (2015-07-10 12:43:38 UTC) #64
brettw
https://codereview.chromium.org/1224553010/diff/270001/net/base/mime_sniffer.cc File net/base/mime_sniffer.cc (right): https://codereview.chromium.org/1224553010/diff/270001/net/base/mime_sniffer.cc#newcode626 net/base/mime_sniffer.cc:626: } else if ((pos + kDocTypePrefixLength - 1 <= ...
5 years, 5 months ago (2015-07-10 17:01:01 UTC) #65
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224553010/290001
5 years, 5 months ago (2015-07-10 17:02:17 UTC) #68
commit-bot: I haz the power
Committed patchset #16 (id:290001)
5 years, 5 months ago (2015-07-10 18:28:48 UTC) #69
commit-bot: I haz the power
5 years, 5 months ago (2015-07-10 18:29:50 UTC) #70
Message was sent while issue was closed.
Patchset 16 (id:??) landed as
https://crrev.com/8a800901b78a29e33bc91b48621cec72964a1f14
Cr-Commit-Position: refs/heads/master@{#338324}

Powered by Google App Engine
This is Rietveld 408576698