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

Issue 2470043004: Fix vector resize logic when encoding non-BMP chars to latin1 as ?s (Closed)

Created:
4 years, 1 month ago by jsbell
Modified:
4 years, 1 month ago
Reviewers:
tkent, bsittler
CC:
blink-reviews, blink-reviews-wtf_chromium.org, bsittler, chromium-reviews, jshin+watch_chromium.org, jungshik at Google, Mikhail
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix vector resize logic when encoding non-BMP chars to latin1 as ?s Since non-BMP characters take two UChars, when encoding to latin1 with replacement characters ('?') may result the output being shorter than the input. The encoding logic assumed the replacement would always be larger, and vectors don't like being shrunk. Correct the logic and make it more readable, add tests. BUG=661367 R=tkent@chromium.org Committed: https://crrev.com/9d2d2e8409c21feca88979245ce75f9ac4a00f05 Cr-Commit-Position: refs/heads/master@{#429610}

Patch Set 1 #

Patch Set 2 : Add test with LChars #

Patch Set 3 : minor optmization #

Patch Set 4 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+100 lines, -3 lines) Patch
A third_party/WebKit/LayoutTests/fast/encoding/latin1-unencodables.html View 1 chunk +39 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/encoding/latin1-unencodables-expected.txt View 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/wtf/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/wtf/text/TextCodecLatin1.cpp View 1 2 2 chunks +18 lines, -3 lines 0 comments Download
A third_party/WebKit/Source/wtf/text/TextCodecLatin1Test.cpp View 1 1 chunk +39 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 20 (12 generated)
jsbell
tkent@ - please take a look? (r? cq?)
4 years, 1 month ago (2016-11-02 20:12:20 UTC) #2
bsittler
lgtm
4 years, 1 month ago (2016-11-02 20:29:19 UTC) #5
jsbell
Whoops - further experimenting found that the DCHECK_EQ(sizeof(CharType), sizeof(UChar)); fails. So hold off for now.
4 years, 1 month ago (2016-11-02 22:27:19 UTC) #6
jsbell
On 2016/11/02 22:27:19, jsbell wrote: > Whoops - further experimenting found that the DCHECK_EQ(sizeof(CharType), > ...
4 years, 1 month ago (2016-11-02 22:41:18 UTC) #8
tkent
lgtm
4 years, 1 month ago (2016-11-03 12:10:55 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2470043004/60001
4 years, 1 month ago (2016-11-03 16:10:43 UTC) #17
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 1 month ago (2016-11-03 16:16:04 UTC) #18
commit-bot: I haz the power
4 years, 1 month ago (2016-11-03 16:21:01 UTC) #20
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/9d2d2e8409c21feca88979245ce75f9ac4a00f05
Cr-Commit-Position: refs/heads/master@{#429610}

Powered by Google App Engine
This is Rietveld 408576698