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

Issue 187793004: Fill out the rest of the StringPiece functions for 16-bit. (Closed)

Created:
6 years, 9 months ago by brettw
Modified:
6 years, 9 months ago
Reviewers:
Ben, viettrungluu, akalin
CC:
chromium-reviews, erikwright+watch_chromium.org, jshin+watch_chromium.org
Visibility:
Public.

Description

Fill out the rest of the StringPiece functions for 16-bit. I was originally opposed to these since we didn't need them and they were complicated. But I'm wanting to use some of these functions in a different patch, so it seems like a good time to fill out the std::string-like finding functions for StringPiece16. This deletes the old StringPieceDetails for which the only point was to share the common stuff between the two BasicStringPiece specializations. I used the pattern of having two versions of each function declared in the header and then expanding the template in the .cc file, to avoid template bloat in the header. This replaces all of the size_type goop with size_t. Chrome code assumes these are the same and we encourage people to just use size_t in loops, for example, rather than using the size_type of the template they're iterating over. This makes the code more readable in many places. It also solves a problem with declaration ordering since most of the functions that used size_type are now moved above where the size_type is actually declared. R=viettrungluu@chromium.org TBR=akalin, ben Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=255397 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=256311

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 4

Patch Set 4 : review comments #

Patch Set 5 : try failures #

Patch Set 6 : fix #

Patch Set 7 : #

Patch Set 8 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+583 lines, -376 lines) Patch
M base/strings/string_piece.h View 1 2 3 5 chunks +171 lines, -157 lines 0 comments Download
M base/strings/string_piece.cc View 1 2 3 4 5 6 9 chunks +266 lines, -84 lines 0 comments Download
M base/strings/string_piece_unittest.cc View 1 6 chunks +143 lines, -133 lines 0 comments Download
M net/websockets/websocket_basic_handshake_stream.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M ui/base/resource/data_pack.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
brettw
6 years, 9 months ago (2014-03-05 22:42:49 UTC) #1
viettrungluu
lgtm w/nits https://codereview.chromium.org/187793004/diff/40001/base/strings/string_piece.cc File base/strings/string_piece.cc (right): https://codereview.chromium.org/187793004/diff/40001/base/strings/string_piece.cc#newcode372 base/strings/string_piece.cc:372: --self_i) { nit: this fits on the ...
6 years, 9 months ago (2014-03-05 22:52:23 UTC) #2
brettw
TBR akalin for net TBR ben for ui
6 years, 9 months ago (2014-03-05 23:24:18 UTC) #3
brettw
Committed patchset #5 manually as r255397 (presubmit successful).
6 years, 9 months ago (2014-03-06 17:54:38 UTC) #4
brettw
Trung: PTAL (diff vs. patch 5) for memory fix. I accidentally removed the check when ...
6 years, 9 months ago (2014-03-10 20:07:06 UTC) #5
viettrungluu
lgtm
6 years, 9 months ago (2014-03-10 20:08:47 UTC) #6
brettw
6 years, 9 months ago (2014-03-11 21:15:44 UTC) #7
Message was sent while issue was closed.
Committed patchset #8 manually as r256311 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698