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

Issue 296593003: Make various string_util functions take StringPieces instead of char[]. (Closed)

Created:
6 years, 7 months ago by Peter Kasting
Modified:
6 years, 6 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, Ilya Sherman, erikwright+watch_chromium.org, nkostylev+watch_chromium.org, estade+watch_chromium.org, benquan, tfarina, browser-components-watch_chromium.org, dyu1, jam, darin-cc_chromium.org, davemoore+watch_chromium.org, oshima+watch_chromium.org, grt+watch_chromium.org, rouslan+autofillwatch_chromium.org, chromium-apps-reviews_chromium.org, James Su, stevenjb+watch_chromium.org, jshin+watch_chromium.org, Dane Wallinga
Visibility:
Public.

Description

Make various string_util functions take StringPieces instead of char[]. This allows most callers to pass string literals or results of ASCIIToUTF16(), rather than construct error-prone character arrays that must be manually nul-terminated. Also cleans up various bits of the callers. BUG=104260 TEST=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=273765

Patch Set 1 #

Patch Set 2 : Fix compile errors #

Patch Set 3 : Rebase #

Total comments: 6

Patch Set 4 : Resync #

Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -191 lines) Patch
M apps/app_window.cc View 1 2 3 1 chunk +3 lines, -4 lines 0 comments Download
M base/strings/string_util.h View 5 chunks +13 lines, -14 lines 0 comments Download
M base/strings/string_util.cc View 1 2 3 12 chunks +36 lines, -35 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_input.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/autocomplete/builtin_provider.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/chromeos/drive/file_system_util.cc View 4 chunks +9 lines, -19 lines 0 comments Download
M chrome/browser/drive/drive_api_util.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/errorpage_browsertest.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/guest_view/ad_view/ad_view_guest.cc View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/guest_view/web_view/web_view_guest.cc View 1 2 3 2 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/profile_resetter/resettable_settings_snapshot.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/renderer_context_menu/render_view_context_menu.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_util.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/omnibox/location_bar_util.cc View 2 chunks +5 lines, -10 lines 0 comments Download
M chrome/common/localized_error.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/installer/setup/install.cc View 1 2 3 18 chunks +35 lines, -35 lines 0 comments Download
M chrome/installer/util/shell_util.cc View 1 2 3 5 chunks +7 lines, -6 lines 0 comments Download
M chrome/renderer/chrome_render_view_observer.cc View 1 2 3 1 chunk +2 lines, -3 lines 0 comments Download
M chromeos/system/name_value_pairs_parser.cc View 3 chunks +2 lines, -4 lines 0 comments Download
M components/autofill/core/browser/autofill_field.cc View 1 2 3 1 chunk +2 lines, -5 lines 0 comments Download
M components/autofill/core/browser/autofill_profile.cc View 1 2 3 1 chunk +2 lines, -3 lines 0 comments Download
M components/autofill/core/browser/credit_card.cc View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M components/autofill/core/browser/phone_number.cc View 2 chunks +1 line, -7 lines 0 comments Download
M components/autofill/core/browser/validation.cc View 4 chunks +7 lines, -15 lines 0 comments Download
M components/cloud_devices/common/cloud_devices_urls.cc View 2 chunks +2 lines, -1 line 0 comments Download
M components/webdata/common/web_database_migration_unittest.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M extensions/common/permissions/socket_permission_entry.cc View 1 1 chunk +2 lines, -5 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Peter Kasting
In a few cases I removed named string constants passed to e.g. RemoveChars() when they ...
6 years, 7 months ago (2014-05-20 18:22:51 UTC) #1
Peter Kasting
Ping
6 years, 7 months ago (2014-05-22 23:33:54 UTC) #2
darin (slow to review)
https://codereview.chromium.org/296593003/diff/40001/chrome/browser/guest_view/ad_view/ad_view_guest.cc File chrome/browser/guest_view/ad_view/ad_view_guest.cc (right): https://codereview.chromium.org/296593003/diff/40001/chrome/browser/guest_view/ad_view/ad_view_guest.cc#newcode54 chrome/browser/guest_view/ad_view/ad_view_guest.cc:54: DCHECK(StartsWithASCII(error_type, "net::", true)); Ditto. https://codereview.chromium.org/296593003/diff/40001/chrome/browser/guest_view/web_view/web_view_guest.cc File chrome/browser/guest_view/web_view/web_view_guest.cc (right): https://codereview.chromium.org/296593003/diff/40001/chrome/browser/guest_view/web_view/web_view_guest.cc#newcode811 ...
6 years, 7 months ago (2014-05-22 23:49:44 UTC) #3
Peter Kasting
https://codereview.chromium.org/296593003/diff/40001/chrome/browser/guest_view/web_view/web_view_guest.cc File chrome/browser/guest_view/web_view/web_view_guest.cc (right): https://codereview.chromium.org/296593003/diff/40001/chrome/browser/guest_view/web_view/web_view_guest.cc#newcode811 chrome/browser/guest_view/web_view/web_view_guest.cc:811: DCHECK(StartsWithASCII(error_type, "net::", true)); On 2014/05/22 23:49:46, darin wrote: > ...
6 years, 7 months ago (2014-05-22 23:54:49 UTC) #4
Peter Kasting
Ping for questions above
6 years, 6 months ago (2014-05-29 23:17:41 UTC) #5
darin (slow to review)
LGTM https://codereview.chromium.org/296593003/diff/40001/chrome/browser/guest_view/web_view/web_view_guest.cc File chrome/browser/guest_view/web_view/web_view_guest.cc (right): https://codereview.chromium.org/296593003/diff/40001/chrome/browser/guest_view/web_view/web_view_guest.cc#newcode811 chrome/browser/guest_view/web_view/web_view_guest.cc:811: DCHECK(StartsWithASCII(error_type, "net::", true)); On 2014/05/22 23:54:50, Peter Kasting ...
6 years, 6 months ago (2014-05-30 00:03:17 UTC) #6
Peter Kasting
The CQ bit was checked by pkasting@chromium.org
6 years, 6 months ago (2014-05-30 00:04:17 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pkasting@chromium.org/296593003/40001
6 years, 6 months ago (2014-05-30 00:04:58 UTC) #8
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: chromium_presubmit on tryserver.chromium ...
6 years, 6 months ago (2014-05-30 01:07:43 UTC) #9
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-05-30 01:13:46 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/chromium_presubmit/builds/70560)
6 years, 6 months ago (2014-05-30 01:13:47 UTC) #11
Peter Kasting
The CQ bit was checked by pkasting@chromium.org
6 years, 6 months ago (2014-05-30 01:36:00 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pkasting@chromium.org/296593003/60001
6 years, 6 months ago (2014-05-30 01:39:15 UTC) #13
commit-bot: I haz the power
6 years, 6 months ago (2014-05-30 08:16:13 UTC) #14
Message was sent while issue was closed.
Change committed as 273765

Powered by Google App Engine
This is Rietveld 408576698