|
|
Created:
4 years, 9 months ago by ncarter (slow) Modified:
4 years, 8 months ago CC:
chromium-reviews, darin-cc_chromium.org, nasko+codewatch_chromium.org, jam, creis+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionReplace ConstNodeRange with a const_cast
BUG=None
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation
Committed: https://crrev.com/931d445decae8359a79bebbcff6a3a3d43343b85
Cr-Commit-Position: refs/heads/master@{#383882}
Patch Set 1 #Patch Set 2 : rebase #
Messages
Total messages: 19 (9 generated)
Description was changed from ========== Replace ConstNodeRange with a const_cast BUG= ========== to ========== Replace ConstNodeRange with a const_cast BUG= CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation ==========
Description was changed from ========== Replace ConstNodeRange with a const_cast BUG= CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation ========== to ========== Replace ConstNodeRange with a const_cast BUG=None CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation ==========
nick@chromium.org changed reviewers: + clamy@chromium.org, nasko@chromium.org
This eliminates a duplicate implementation of the traversal logic. I initially tried implementing the non-const iterator in terms of the const iterator, but it only saved about 20 lines of code. When I realized this was only needed for IsLoading, I thought a const_cast was a better solution. const correctness is an explicit non-goal for content/public classes.
Considering that IsLoading was only made const because it is used in WebContentsImpl::IsLoading which is const, can we just unconst WebContentsImpl::IsLoading and even not have to do a const cast? The content/public API should not have const method anyway (I did not change that in my CL because it was already big enough).
On 2016/03/17 10:51:47, clamy wrote: > Considering that IsLoading was only made const because it is used in > WebContentsImpl::IsLoading which is const, can we just unconst > WebContentsImpl::IsLoading and even not have to do a const cast? The > content/public API should not have const method anyway (I did not change that in > my CL because it was already big enough). IsLoading has a bunch of callers, and I'm not sure it's actually worth anybody's time to unconst all of WebContents, even though it's against the content api rules. I am wondering if we should change the rules. That's why I like const_cast as a compromise here: it lets us keep up the facade of const correctness, without forcing us to overcomplicate our implementation.
Acknowledged. Lgtm.
Code removal is best CL! LGTM
The CQ bit was checked by nick@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1802163002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1802163002/1
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: ios_dbg_simulator_gn on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator...) ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator...) ios_rel_device_gn on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_gn...) ios_rel_device_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_ni...) mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_chromium_gn_rel on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_r...) mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by nick@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from clamy@chromium.org, nasko@chromium.org Link to the patchset: https://codereview.chromium.org/1802163002/#ps20001 (title: "rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1802163002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1802163002/20001
Message was sent while issue was closed.
Description was changed from ========== Replace ConstNodeRange with a const_cast BUG=None CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation ========== to ========== Replace ConstNodeRange with a const_cast BUG=None CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation ==========
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Description was changed from ========== Replace ConstNodeRange with a const_cast BUG=None CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation ========== to ========== Replace ConstNodeRange with a const_cast BUG=None CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/931d445decae8359a79bebbcff6a3a3d43343b85 Cr-Commit-Position: refs/heads/master@{#383882} ==========
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/931d445decae8359a79bebbcff6a3a3d43343b85 Cr-Commit-Position: refs/heads/master@{#383882} |