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

Issue 2340583005: Base ObserverList: Add basic support for standard C++ iterators. (Closed)

Created:
4 years, 3 months ago by loyso (OOO)
Modified:
4 years, 2 months ago
Reviewers:
dcheng
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Base ObserverList: Add basic support for standard C++ iterators. Also add a support for const_iterator. The range-based for loop support follows for free. See the use case in the dependent CL. BUG=634916 Committed: https://crrev.com/29025b60361ec76cf02bab720703c66ae8047be9 Cr-Commit-Position: refs/heads/master@{#424381}

Patch Set 1 #

Patch Set 2 : Remove ValueType. #

Patch Set 3 : Fix gcc and msvc. #

Total comments: 1

Patch Set 4 : Erase postfix ++ version. Add comments on deprecation. #

Total comments: 4

Patch Set 5 : Fix code review issues. #

Patch Set 6 : An attempt to fix strange Win7 behavior. #

Patch Set 7 : Revert it to be as in patch set 4 to check win7. #

Patch Set 8 : Revert it to be as in patch set 4 to understand win7. #

Patch Set 9 : DCHECK in operator-> #

Patch Set 10 : Add the optimization change. #

Patch Set 11 : Add a comment on MSVC. #

Total comments: 10

Patch Set 12 : Add explicit zeroes in ctor's member initializors. #

Patch Set 13 : Address code review issues. #

Patch Set 14 : Some usages expect macro to be an expression, not a statement. #

Total comments: 11

Patch Set 15 : Just rebase. #

Patch Set 16 : Revert GetCurrent (wm_unittests start to fail) #

Patch Set 17 : Fix bugs. Add new tests. #

Total comments: 2

Patch Set 18 : Rename GetNonNullIndex. Add more tests. #

Patch Set 19 : Remove excessive mutable. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+545 lines, -55 lines) Patch
M base/observer_list.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +151 lines, -32 lines 0 comments Download
M base/observer_list_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 10 chunks +394 lines, -23 lines 0 comments Download

Messages

Total messages: 82 (49 generated)
loyso (OOO)
4 years, 3 months ago (2016-09-15 07:48:45 UTC) #5
loyso (OOO)
Do not review please - to be fixed.
4 years, 3 months ago (2016-09-15 08:07:59 UTC) #9
loyso (OOO)
PTAL! It's ready to be landed.
4 years, 3 months ago (2016-09-16 03:11:09 UTC) #14
dcheng
I haven't reviewed the entire patch yet, but can we completely remove the old FOR_EACH_OBSERVER ...
4 years, 3 months ago (2016-09-16 21:44:17 UTC) #16
loyso (OOO)
On 2016/09/16 21:44:17, dcheng wrote: > I haven't reviewed the entire patch yet, but can ...
4 years, 3 months ago (2016-09-19 00:09:06 UTC) #17
loyso (OOO)
PTAL! My CLs are blocked on this change.
4 years, 3 months ago (2016-09-19 02:43:28 UTC) #22
loyso (OOO)
Anyone, please? Feel free to reassign if you are busy.
4 years, 3 months ago (2016-09-20 00:19:00 UTC) #23
dcheng
On 2016/09/20 00:19:00, loyso wrote: > Anyone, please? Feel free to reassign if you are ...
4 years, 3 months ago (2016-09-20 00:36:36 UTC) #24
loyso (OOO)
Friendly ping.
4 years, 3 months ago (2016-09-23 00:01:23 UTC) #26
dcheng
I think my largest concern is whether it's important to keep the might_have_observers() short-circuiting logic. ...
4 years, 3 months ago (2016-09-23 07:39:02 UTC) #27
loyso (OOO)
On 2016/09/23 07:39:02, dcheng wrote: > I think my largest concern is whether it's important ...
4 years, 2 months ago (2016-09-26 04:26:15 UTC) #28
loyso (OOO)
https://codereview.chromium.org/2340583005/diff/60001/base/observer_list.h File base/observer_list.h (right): https://codereview.chromium.org/2340583005/diff/60001/base/observer_list.h#newcode112 base/observer_list.h:112: size_t checked_max_index() const { On 2016/09/23 07:39:01, dcheng wrote: ...
4 years, 2 months ago (2016-09-26 04:26:24 UTC) #29
loyso (OOO)
In progress. MSVC is special (as usual).
4 years, 2 months ago (2016-09-26 08:14:39 UTC) #34
loyso (OOO)
All done. PTAL!
4 years, 2 months ago (2016-09-27 06:21:23 UTC) #37
loyso (OOO)
dcheng@, ping?
4 years, 2 months ago (2016-09-28 00:02:44 UTC) #40
loyso (OOO)
dcheng@, friendly ping again. It's ready to be landed.
4 years, 2 months ago (2016-09-29 06:34:34 UTC) #41
dcheng
Also, which benchmarking these things is notoriously hard, I think it'd be worth trying to ...
4 years, 2 months ago (2016-10-03 07:29:18 UTC) #42
loyso (OOO)
https://codereview.chromium.org/2340583005/diff/200001/base/observer_list.h File base/observer_list.h (right): https://codereview.chromium.org/2340583005/diff/200001/base/observer_list.h#newcode88 base/observer_list.h:88: class Iter { On 2016/10/03 07:29:18, dcheng wrote: > ...
4 years, 2 months ago (2016-10-04 03:46:57 UTC) #43
loyso (OOO)
On 2016/10/03 07:29:18, dcheng wrote: > Also, which benchmarking these things is notoriously hard, I ...
4 years, 2 months ago (2016-10-04 04:08:16 UTC) #44
loyso (OOO)
https://codereview.chromium.org/2340583005/diff/200001/base/observer_list.h File base/observer_list.h (right): https://codereview.chromium.org/2340583005/diff/200001/base/observer_list.h#newcode88 base/observer_list.h:88: class Iter { Also, please notice that ObserverList isn't ...
4 years, 2 months ago (2016-10-04 04:12:02 UTC) #45
dcheng
https://codereview.chromium.org/2340583005/diff/200001/base/observer_list.h File base/observer_list.h (right): https://codereview.chromium.org/2340583005/diff/200001/base/observer_list.h#newcode88 base/observer_list.h:88: class Iter { On 2016/10/04 04:12:02, loyso wrote: > ...
4 years, 2 months ago (2016-10-04 23:53:40 UTC) #46
loyso (OOO)
On 2016/10/04 23:53:40, dcheng wrote: > On 2016/10/04 04:12:02, loyso wrote: > > Also, please ...
4 years, 2 months ago (2016-10-05 04:31:37 UTC) #51
loyso (OOO)
On 2016/10/04 23:53:40, dcheng wrote: > As discussed offline, this does work (e.g. p.s. That ...
4 years, 2 months ago (2016-10-05 05:02:29 UTC) #52
dcheng
https://codereview.chromium.org/2340583005/diff/260001/base/observer_list.h File base/observer_list.h (right): https://codereview.chromium.org/2340583005/diff/260001/base/observer_list.h#newcode122 base/observer_list.h:122: size_t index_; Let's add a comment to document the ...
4 years, 2 months ago (2016-10-05 07:08:24 UTC) #55
loyso (OOO)
https://codereview.chromium.org/2340583005/diff/200001/base/observer_list.h File base/observer_list.h (right): https://codereview.chromium.org/2340583005/diff/200001/base/observer_list.h#newcode349 base/observer_list.h:349: if ((observer_list).might_have_observers()) { \ On 2016/10/04 23:53:39, dcheng wrote: ...
4 years, 2 months ago (2016-10-05 07:24:42 UTC) #58
dcheng
https://codereview.chromium.org/2340583005/diff/260001/base/observer_list.h File base/observer_list.h (right): https://codereview.chromium.org/2340583005/diff/260001/base/observer_list.h#newcode277 base/observer_list.h:277: ObserverType* current = GetNonNullCurrent(); On 2016/10/05 07:08:24, dcheng wrote: ...
4 years, 2 months ago (2016-10-05 21:01:15 UTC) #59
loyso (OOO)
PTAL! https://codereview.chromium.org/2340583005/diff/260001/base/observer_list.h File base/observer_list.h (right): https://codereview.chromium.org/2340583005/diff/260001/base/observer_list.h#newcode122 base/observer_list.h:122: size_t index_; On 2016/10/05 07:08:24, dcheng wrote: > ...
4 years, 2 months ago (2016-10-07 03:45:08 UTC) #66
dcheng
WDYT? https://codereview.chromium.org/2340583005/diff/320001/base/observer_list.h File base/observer_list.h (right): https://codereview.chromium.org/2340583005/diff/320001/base/observer_list.h#newcode217 base/observer_list.h:217: if (is_end() && other.is_end()) Good catch on the ...
4 years, 2 months ago (2016-10-07 05:43:17 UTC) #69
loyso (OOO)
On 2016/10/07 05:43:17, dcheng wrote: > WDYT? That loss of information doesn't work for GetNext ...
4 years, 2 months ago (2016-10-10 04:14:52 UTC) #72
dcheng
LGTM. I'm hoping we can simplify the internal implementation down the road (the end iterator ...
4 years, 2 months ago (2016-10-11 05:02:13 UTC) #75
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/2340583005/360001
4 years, 2 months ago (2016-10-11 05:15:04 UTC) #78
commit-bot: I haz the power
Committed patchset #19 (id:360001)
4 years, 2 months ago (2016-10-11 06:51:57 UTC) #80
commit-bot: I haz the power
4 years, 2 months ago (2016-10-11 06:53:45 UTC) #82
Message was sent while issue was closed.
Patchset 19 (id:??) landed as
https://crrev.com/29025b60361ec76cf02bab720703c66ae8047be9
Cr-Commit-Position: refs/heads/master@{#424381}

Powered by Google App Engine
This is Rietveld 408576698