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

Issue 1607213002: Prevent copyTextTo() from Breaking Code Points (Closed)

Created:
4 years, 11 months ago by Xiaocheng
Modified:
4 years, 11 months ago
Reviewers:
yosin_UTC9
CC:
blink-reviews, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Prevent copyTextTo() from Breaking Code Points This CL renames and hides original |copyTextTo()| functions as private |copyCodeUnitsTo()|. New |copyTextTo()| functions are introduced to |TextIterator| and |SimplifiedBackwardsTextIterator| to allow copying a range of characters to a buffer without worrying about breaking code points. The new functions are implemented as wrappers of |copyCodeUnitsTo()|. This is part of a bigger CL [1]. [1] https://codereview.chromium.org/1604783002 BUG=n/a TEST=webkit_unit_tests --gtest_filter=*TextIteratorTest.CopyWholeCodePoints Committed: https://crrev.com/503351d5107ecbf885344e7cf3703bfff238b50b Cr-Commit-Position: refs/heads/master@{#370669}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Hide unsafe |copyTextTo()| #

Patch Set 3 : #

Total comments: 2

Patch Set 4 : #

Patch Set 5 : Introduce |isBetweenSurrogatePair()| #

Patch Set 6 : Rebased #

Total comments: 3

Patch Set 7 : #

Total comments: 1

Patch Set 8 : #

Messages

Total messages: 19 (5 generated)
Xiaocheng
This patch moves the surrogate pairing logic into the text iterators. PTAL.
4 years, 11 months ago (2016-01-20 07:22:12 UTC) #2
yosin_UTC9
https://codereview.chromium.org/1607213002/diff/1/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h File third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h (right): https://codereview.chromium.org/1607213002/diff/1/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h#newcode88 third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h:88: int copyWholeCodePointsTo(BufferType& output, int position, int copyLength) const We ...
4 years, 11 months ago (2016-01-20 08:06:23 UTC) #3
Xiaocheng
On 2016/01/20 at 08:06:23, yosin wrote: > https://codereview.chromium.org/1607213002/diff/1/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h > File third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h (right): > > https://codereview.chromium.org/1607213002/diff/1/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h#newcode88 ...
4 years, 11 months ago (2016-01-20 09:13:37 UTC) #4
yosin_UTC9
On 2016/01/20 at 09:13:37, xiaochengh wrote: > On 2016/01/20 at 08:06:23, yosin wrote: > > ...
4 years, 11 months ago (2016-01-20 09:21:30 UTC) #5
Xiaocheng
Patch 3 hides the original unsafe |copyTextTo()| as private functions, and guards them with surrogate ...
4 years, 11 months ago (2016-01-21 05:36:21 UTC) #7
yosin_UTC9
You may want to rebase "TextIterator.cpp", we renamed |emitCharacter()| to |spliceBuffer()|. What is happen when ...
4 years, 11 months ago (2016-01-21 05:58:04 UTC) #8
Xiaocheng
On 2016/01/21 at 05:58:04, yosin wrote: > You may want to rebase "TextIterator.cpp", we renamed ...
4 years, 11 months ago (2016-01-21 06:43:39 UTC) #9
Xiaocheng
On 2016/01/21 at 06:43:39, Xiaocheng wrote: > On 2016/01/21 at 05:58:04, yosin wrote: > > ...
4 years, 11 months ago (2016-01-21 07:50:19 UTC) #10
yosin_UTC9
https://codereview.chromium.org/1607213002/diff/100001/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h File third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h (right): https://codereview.chromium.org/1607213002/diff/100001/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h#newcode72 third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h:72: int copyTextTo(BufferType& output, int position = 0) const { ...
4 years, 11 months ago (2016-01-21 08:26:26 UTC) #11
Xiaocheng
The methods are moved to .cpp files. PTAL. https://codereview.chromium.org/1607213002/diff/100001/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h File third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h (right): https://codereview.chromium.org/1607213002/diff/100001/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h#newcode91 third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h:91: bool ...
4 years, 11 months ago (2016-01-21 09:05:01 UTC) #12
yosin_UTC9
lgtm w/ small nits https://codereview.chromium.org/1607213002/diff/120001/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h File third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h (right): https://codereview.chromium.org/1607213002/diff/120001/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h#newcode103 third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h:103: if (m_textLength == 0) nit: ...
4 years, 11 months ago (2016-01-21 09:32:24 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1607213002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1607213002/140001
4 years, 11 months ago (2016-01-21 10:10:15 UTC) #16
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 11 months ago (2016-01-21 11:24:55 UTC) #17
commit-bot: I haz the power
4 years, 11 months ago (2016-01-21 11:25:44 UTC) #19
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/503351d5107ecbf885344e7cf3703bfff238b50b
Cr-Commit-Position: refs/heads/master@{#370669}

Powered by Google App Engine
This is Rietveld 408576698