Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1523)

Issue 7353: Create a thread-safe observer list. Will be used (Closed)

Created:
12 years, 2 months ago by Mike Belshe
Modified:
9 years, 5 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Create a thread-safe observer list. Will be used by SystemMonitor. Right now the class requires that Observers be RefCounted<>. This is because we invoke tasks via NewRunnableMethod for them. However, because we manually track lifecycle via AddObserver/RemoveObserver, we could override the RunnableMethodTraits to not require RefCounted<>. This would have the advantage that callers do not need to make all Observers be RefCounted, but makes it more critical that observers not forget to call RemoveObserver(). Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=3787

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Patch Set 15 : '' #

Patch Set 16 : '' #

Patch Set 17 : '' #

Patch Set 18 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+413 lines, -6 lines) Patch
M base/build/base.vcproj View 9 10 11 12 13 14 15 16 17 1 chunk +4 lines, -0 lines 0 comments Download
M base/build/base_unittests.vcproj View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +4 lines, -0 lines 0 comments Download
A base/observer_list_threadsafe.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +190 lines, -0 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 4 chunks +201 lines, -6 lines 0 comments Download
M base/task.h View 9 10 11 12 13 14 15 16 17 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Mike Belshe
12 years, 2 months ago (2008-10-16 21:45:55 UTC) #1
darin (slow to review)
http://codereview.chromium.org/7353/diff/26/29 File base/observer_list_threadsafe.h (right): http://codereview.chromium.org/7353/diff/26/29#newcode190 Line 190: #define NOTIFY_OBSERVERS(ObserverType, observer_list, func, arg) \ since you ...
12 years, 2 months ago (2008-10-16 22:28:49 UTC) #2
Mike Belshe
Thanks, Darin. On 2008/10/16 22:28:49, darin wrote: > http://codereview.chromium.org/7353/diff/26/29 > File base/observer_list_threadsafe.h (right): > > ...
12 years, 2 months ago (2008-10-17 22:18:15 UTC) #3
darin (slow to review)
looks good... just some questions, and i think maybe a potential bug: http://codereview.chromium.org/7353/diff/39/215 File base/observer_list_threadsafe.h ...
12 years, 2 months ago (2008-10-17 22:27:45 UTC) #4
Mike Belshe
On 2008/10/17 22:27:45, darin wrote: > looks good... just some questions, and i think maybe ...
12 years, 2 months ago (2008-10-17 22:46:16 UTC) #5
mendola
General comments http://codereview.chromium.org/7353/diff/45/221 File base/observer_list_threadsafe.h (right): http://codereview.chromium.org/7353/diff/45/221#newcode6 Line 6: #define BASE_OBSERVER_THREADSAFE_LIST_H__ Class, guard and and ...
12 years, 2 months ago (2008-10-18 00:10:20 UTC) #6
Mike Belshe
On 2008/10/18 00:10:20, mendola wrote: > General comments thanks! > > http://codereview.chromium.org/7353/diff/45/221 > File base/observer_list_threadsafe.h ...
12 years, 2 months ago (2008-10-20 04:03:10 UTC) #7
mendola
On 2008/10/20 04:03:10, mbelshe wrote: > On 2008/10/18 00:10:20, mendola wrote: > > General comments ...
12 years, 2 months ago (2008-10-20 10:33:07 UTC) #8
mendola
Typo on the guard name check http://codereview.chromium.org/7353/diff/49/232 File base/observer_list_threadsafe.h (right): http://codereview.chromium.org/7353/diff/49/232#newcode5 Line 5: #ifndef BASE_OBSERVER_LIST_THREADSAFE ...
12 years, 2 months ago (2008-10-20 10:35:27 UTC) #9
Mike Belshe
Regarding the ++it/it++; unless you're in a perf critical loop, it doesn't matter - even ...
12 years, 2 months ago (2008-10-20 16:14:20 UTC) #10
darin (slow to review)
Just some trivial nits and a question about garbage collection. http://codereview.chromium.org/7353/diff/236/62 File base/build/base.vcproj (right): http://codereview.chromium.org/7353/diff/236/62#newcode497 ...
12 years, 2 months ago (2008-10-20 22:25:35 UTC) #11
Mike Belshe
On 2008/10/20 22:25:35, darin wrote: > Just some trivial nits and a question about garbage ...
12 years, 2 months ago (2008-10-21 21:53:32 UTC) #12
Mike Belshe
I went ahead and made the cleanups work. Took a couple of iterations, but I ...
12 years, 2 months ago (2008-10-22 22:04:22 UTC) #13
darin (slow to review)
12 years, 2 months ago (2008-10-22 22:09:03 UTC) #14
LGTM

Powered by Google App Engine
This is Rietveld 408576698