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

Issue 141683004: Use more const references in HTMLCollection / LiveNodeList (Closed)

Created:
6 years, 11 months ago by Inactive
Modified:
6 years, 11 months ago
Reviewers:
esprehn, adamk, eseidel
CC:
blink-reviews, dglazkov+blink, sof, eae+blinkwatch, adamk+blink_chromium.org, Inactive
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Use more const references in HTMLCollection / LiveNodeList The code looks safer as it is now obvious the nodes / lists cannot be null. Also, making them const also makes the code look safer as we know the nodes are not altered by the methods. R=esprehn, adamk, eseidel Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=165504

Patch Set 1 #

Total comments: 4

Patch Set 2 : Get rid of const_cast #

Unified diffs Side-by-side diffs Delta from patch set Stats (+143 lines, -144 lines) Patch
M Source/core/dom/ChildNodeList.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/ChildNodeList.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/dom/ClassNodeList.h View 1 chunk +6 lines, -6 lines 0 comments Download
M Source/core/dom/ClassNodeList.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/LiveNodeList.h View 2 chunks +5 lines, -5 lines 0 comments Download
M Source/core/dom/LiveNodeList.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/NameNodeList.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/NameNodeList.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/dom/TagNodeList.h View 2 chunks +6 lines, -6 lines 0 comments Download
M Source/core/dom/TagNodeList.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M Source/core/html/HTMLCollection.h View 2 chunks +4 lines, -4 lines 0 comments Download
M Source/core/html/HTMLCollection.cpp View 11 chunks +86 lines, -86 lines 0 comments Download
M Source/core/html/HTMLLabelElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLLabelElement.cpp View 1 3 chunks +8 lines, -9 lines 0 comments Download
M Source/core/html/HTMLOptionElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLOptionElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/LabelsNodeList.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/LabelsNodeList.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/RadioNodeList.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/RadioNodeList.cpp View 1 chunk +8 lines, -8 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Inactive
https://codereview.chromium.org/141683004/diff/1/Source/core/html/HTMLLabelElement.cpp File Source/core/html/HTMLLabelElement.cpp (left): https://codereview.chromium.org/141683004/diff/1/Source/core/html/HTMLLabelElement.cpp#oldcode40 Source/core/html/HTMLLabelElement.cpp:40: if (!element || !element->isHTMLElement()) Got rid of a useless ...
6 years, 11 months ago (2014-01-17 21:10:43 UTC) #1
adamk
Overall this looks great, happy to see more constness. https://codereview.chromium.org/141683004/diff/1/Source/core/html/HTMLLabelElement.cpp File Source/core/html/HTMLLabelElement.cpp (right): https://codereview.chromium.org/141683004/diff/1/Source/core/html/HTMLLabelElement.cpp#newcode71 Source/core/html/HTMLLabelElement.cpp:71: ...
6 years, 11 months ago (2014-01-21 21:43:54 UTC) #2
esprehn
On 2014/01/21 21:43:54, adamk wrote: > Overall this looks great, happy to see more constness. ...
6 years, 11 months ago (2014-01-21 21:50:00 UTC) #3
esprehn
On 2014/01/21 21:50:00, esprehn wrote: > ... > > ElementTraversal::next() can be quite expensive jumping ...
6 years, 11 months ago (2014-01-21 21:50:29 UTC) #4
adamk
On 2014/01/21 21:50:29, esprehn wrote: > On 2014/01/21 21:50:00, esprehn wrote: > > ... > ...
6 years, 11 months ago (2014-01-21 21:56:05 UTC) #5
adamk
On 2014/01/21 21:56:05, adamk wrote: > On 2014/01/21 21:50:29, esprehn wrote: > > On 2014/01/21 ...
6 years, 11 months ago (2014-01-21 21:56:38 UTC) #6
Inactive
https://codereview.chromium.org/141683004/diff/1/Source/core/html/HTMLLabelElement.cpp File Source/core/html/HTMLLabelElement.cpp (right): https://codereview.chromium.org/141683004/diff/1/Source/core/html/HTMLLabelElement.cpp#newcode71 Source/core/html/HTMLLabelElement.cpp:71: Element* element = const_cast<HTMLLabelElement*>(this); On 2014/01/21 21:43:55, adamk wrote: ...
6 years, 11 months ago (2014-01-21 23:14:03 UTC) #7
Inactive
https://codereview.chromium.org/141683004/diff/1/Source/core/html/HTMLLabelElement.cpp File Source/core/html/HTMLLabelElement.cpp (right): https://codereview.chromium.org/141683004/diff/1/Source/core/html/HTMLLabelElement.cpp#newcode71 Source/core/html/HTMLLabelElement.cpp:71: Element* element = const_cast<HTMLLabelElement*>(this); On 2014/01/21 21:43:55, adamk wrote: ...
6 years, 11 months ago (2014-01-21 23:40:19 UTC) #8
adamk
lgtm
6 years, 11 months ago (2014-01-21 23:41:38 UTC) #9
esprehn
Lgtm
6 years, 11 months ago (2014-01-22 00:03:07 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/141683004/130001
6 years, 11 months ago (2014-01-22 00:46:04 UTC) #11
commit-bot: I haz the power
6 years, 11 months ago (2014-01-22 02:51:57 UTC) #12
Message was sent while issue was closed.
Change committed as 165504

Powered by Google App Engine
This is Rietveld 408576698