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

Issue 2591323002: [views] Changes iteration over |children_| to use range-based for loops (reland) (Closed)

Created:
4 years ago by varkha
Modified:
3 years, 12 months ago
CC:
chromium-reviews, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[views] Changes iteration over |children_| to use range-based for loops This is a reland of https://codereview.chromium.org/2583343003/ It depends on https://codereview.chromium.org/2597733002/ to eliminate the scenario where |View::children_| was mutated while inside iteration. BUG=NONE TEST=Added DCHECKs that |children_| is not mutated while inside the iterations. Committed: https://crrev.com/bdd2b6f4ac1942a60b5d4323929de9ee666e5276 Cr-Commit-Position: refs/heads/master@{#440549}

Patch Set 1 #

Patch Set 2 : [views] Changes iteration over |children_| to use range-based for loops (DCHECKs) #

Total comments: 6

Patch Set 3 : [views] Changes iteration over |children_| to use range-based for loops (comments) #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -51 lines) Patch
M ui/views/view.h View 1 2 3 chunks +11 lines, -0 lines 1 comment Download
M ui/views/view.cc View 1 2 25 chunks +126 lines, -51 lines 3 comments Download

Messages

Total messages: 35 (23 generated)
varkha
sadrul@, this should be ready for re-land with https://codereview.chromium.org/2597733002/ out of the way. I will ...
3 years, 12 months ago (2016-12-22 19:02:57 UTC) #2
varkha
On 2016/12/22 19:02:57, varkha wrote: > sadrul@, this should be ready for re-land with > ...
3 years, 12 months ago (2016-12-22 19:07:03 UTC) #3
sadrul
It may make sense to add the DCHECK()s in a separate CL. lgtm
3 years, 12 months ago (2016-12-22 19:25:34 UTC) #4
varkha
I thought it would be safer to do it in the same CL, especially since ...
3 years, 12 months ago (2016-12-22 19:54:44 UTC) #7
sadrul
https://codereview.chromium.org/2591323002/diff/40001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2591323002/diff/40001/ui/views/view.cc#newcode192 ui/views/view.cc:192: DCHECK(!iterating_); Since this is in a DCHECK, do you ...
3 years, 12 months ago (2016-12-22 21:37:52 UTC) #17
varkha
https://codereview.chromium.org/2591323002/diff/40001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2591323002/diff/40001/ui/views/view.cc#newcode192 ui/views/view.cc:192: DCHECK(!iterating_); On 2016/12/22 21:37:52, sadrul wrote: > Since this ...
3 years, 12 months ago (2016-12-22 22:36:02 UTC) #19
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/2591323002/80001
3 years, 12 months ago (2016-12-23 00:03:29 UTC) #26
commit-bot: I haz the power
Committed patchset #3 (id:80001)
3 years, 12 months ago (2016-12-23 00:08:22 UTC) #29
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/bdd2b6f4ac1942a60b5d4323929de9ee666e5276 Cr-Commit-Position: refs/heads/master@{#440549}
3 years, 12 months ago (2016-12-23 00:10:48 UTC) #31
Daniele Castagna
https://codereview.chromium.org/2591323002/diff/80001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2591323002/diff/80001/ui/views/view.cc#newcode98 ui/views/view.cc:98: view->iterating_ = true; |iterating_| is private and this code ...
3 years, 12 months ago (2016-12-23 23:45:14 UTC) #33
sadrul
https://codereview.chromium.org/2591323002/diff/80001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2591323002/diff/80001/ui/views/view.cc#newcode98 ui/views/view.cc:98: view->iterating_ = true; On 2016/12/23 23:45:14, Daniele Castagna wrote: ...
3 years, 12 months ago (2016-12-24 00:13:11 UTC) #34
Daniele Castagna
3 years, 12 months ago (2016-12-24 00:48:01 UTC) #35
Message was sent while issue was closed.
https://codereview.chromium.org/2591323002/diff/80001/ui/views/view.cc
File ui/views/view.cc (right):

https://codereview.chromium.org/2591323002/diff/80001/ui/views/view.cc#newcode98
ui/views/view.cc:98: view->iterating_ = true;
On 2016/12/24 at 00:13:11, sadrul wrote:
> On 2016/12/23 23:45:14, Daniele Castagna wrote:
> > |iterating_| is private and this code doesn't compile with DCHECKS on.
> > crrev.com/2606513002 if you are fine making |iterating_| public.
> 
> |iterating_| should remain private. But I think ScopedChildrenLock needs to be
in non-anon namespace for the friend declared in .h to work. But I believe our
trybot/buildbots use dcheck_always_on flag, which means they do exercise the
DCHECKs. It's curious that those bots are not failing to build. Do you have a
link to a failing bot, or if you are getting the failures locally, are you using
some non-standard configs?

I'm not sure why we're not catching that on trybots.

I had trouble building locally for cyan with $GN_ARGS plus
dcheck_always_on=true, so, nothing non-standard.

I noticed ScopedChildrenLock was already friend (or at least, that seemed the
intention), crrev.com/2606513002 has been updated moving that class to internal
namesapce.

Powered by Google App Engine
This is Rietveld 408576698