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

Issue 2921483002: Reorganize member initialization code of TextIterator (Closed)

Created:
3 years, 6 months ago by Xiaocheng
Modified:
3 years, 6 months ago
Reviewers:
yosin_UTC9
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Reorganize member initialization code of TextIterator This patch reorganizes the initialization of TextIterator for better code health. 1. Members originally initialized in the function body of TextIterator::ctor are changed to be initialized in the initialization list. Some wrapper functions are created for members with non-trivial initialization. - start_container_ - start_offset_ - end_container_ - end_offset_ - end_node_ - past_end_node_ - node_ - iteration_progress_ - shadow_depth_ 2. Members with trivial initialization are initialized in class declaration instead of ctor: - needs_another_new_line_ - needs_handle_replaced_element_ - should_stop_ - handle_shadow_root_ BUG=721957 TEST=n/a; no behavioral change Review-Url: https://codereview.chromium.org/2921483002 Cr-Commit-Position: refs/heads/master@{#476393} Committed: https://chromium.googlesource.com/chromium/src/+/c8070f461957f5f2aaaf41147538ebe811b4abce

Patch Set 1 #

Total comments: 6

Patch Set 2 : Thu Jun 1 10:44:24 PDT 2017 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -59 lines) Patch
M third_party/WebKit/Source/core/editing/iterators/TextIterator.h View 3 chunks +14 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp View 1 4 chunks +30 lines, -45 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 19 (12 generated)
Xiaocheng
PTAL.
3 years, 6 months ago (2017-05-31 22:05:59 UTC) #7
yosin_UTC9
lgtm w/ nits https://codereview.chromium.org/2921483002/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp File third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp (right): https://codereview.chromium.org/2921483002/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp#newcode89 third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp:89: Node* StartNode(Node* start_container, int start_offset) { ...
3 years, 6 months ago (2017-06-01 01:43:34 UTC) #10
yosin_UTC9
BTW, another idea of using Position instead of {start,end}_{container, offset}. When we change passed Position ...
3 years, 6 months ago (2017-06-01 02:30:08 UTC) #11
Xiaocheng
On 2017/06/01 at 02:30:08, yosin wrote: > BTW, another idea of using Position instead of ...
3 years, 6 months ago (2017-06-01 17:44:03 UTC) #12
Xiaocheng
Thanks for the ideas! https://codereview.chromium.org/2921483002/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp File third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp (right): https://codereview.chromium.org/2921483002/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp#newcode89 third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp:89: Node* StartNode(Node* start_container, int start_offset) ...
3 years, 6 months ago (2017-06-01 17:45:22 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/2921483002/20001
3 years, 6 months ago (2017-06-01 17:45:49 UTC) #16
commit-bot: I haz the power
3 years, 6 months ago (2017-06-01 19:44:06 UTC) #19
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/c8070f461957f5f2aaaf41147538...

Powered by Google App Engine
This is Rietveld 408576698