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

Issue 7604006: Use MessageLoopProxy instead of MessageLoop to dispatch notifications in ObserverListThreadsafe. (Closed)

Created:
9 years, 4 months ago by adamk
Modified:
9 years, 4 months ago
CC:
chromium-reviews, Paweł Hajdan Jr., brettw-cc_chromium.org
Visibility:
Public.

Description

Use MessageLoopProxy instead of MessageLoop to dispatch notifications in ObserverListThreadsafe. This is nearly identical to the reverted r96013, with the modification that std::map::insert isn't used. Its invocation was complex (such that it worked in some compilers but not in others) and the performance gain is negligible in any use case I've seen in Chromium. BUG=91589 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=96076

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -23 lines) Patch
M base/observer_list_threadsafe.h View 10 chunks +30 lines, -17 lines 2 comments Download
M base/observer_list_unittest.cc View 4 chunks +41 lines, -6 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
adamk
9 years, 4 months ago (2011-08-09 18:45:02 UTC) #1
darin (slow to review)
LGTM http://codereview.chromium.org/7604006/diff/1/base/observer_list_threadsafe.h File base/observer_list_threadsafe.h (right): http://codereview.chromium.org/7604006/diff/1/base/observer_list_threadsafe.h#newcode100 base/observer_list_threadsafe.h:100: observer_lists_[loop] = new ObserverListContext(type_); it is very surprising ...
9 years, 4 months ago (2011-08-09 19:32:31 UTC) #2
adamk
http://codereview.chromium.org/7604006/diff/1/base/observer_list_threadsafe.h File base/observer_list_threadsafe.h (right): http://codereview.chromium.org/7604006/diff/1/base/observer_list_threadsafe.h#newcode100 base/observer_list_threadsafe.h:100: observer_lists_[loop] = new ObserverListContext(type_); On 2011/08/09 19:32:31, darin wrote: ...
9 years, 4 months ago (2011-08-09 20:33:40 UTC) #3
darin (slow to review)
On Tue, Aug 9, 2011 at 1:33 PM, <adamk@chromium.org> wrote: > > http://codereview.chromium.**org/7604006/diff/1/base/** > observer_list_threadsafe.h<http://codereview.chromium.org/7604006/diff/1/base/observer_list_threadsafe.h> ...
9 years, 4 months ago (2011-08-09 20:42:18 UTC) #4
adamk
On Tue, Aug 9, 2011 at 1:42 PM, Darin Fisher <darin@chromium.org> wrote: > > > ...
9 years, 4 months ago (2011-08-09 21:13:00 UTC) #5
adamk
On Tue, Aug 9, 2011 at 2:12 PM, Adam Klein <adamk@chromium.org> wrote: > On Tue, ...
9 years, 4 months ago (2011-08-09 22:10:23 UTC) #6
darin (slow to review)
9 years, 4 months ago (2011-08-09 22:21:52 UTC) #7
On Tue, Aug 9, 2011 at 3:10 PM, Adam Klein <adamk@chromium.org> wrote:

> On Tue, Aug 9, 2011 at 2:12 PM, Adam Klein <adamk@chromium.org> wrote:
> > On Tue, Aug 9, 2011 at 1:42 PM, Darin Fisher <darin@chromium.org> wrote:
> >>
> >>
> >> On Tue, Aug 9, 2011 at 1:33 PM, <adamk@chromium.org> wrote:
> >>>
> >>>
> >>>
> http://codereview.chromium.org/7604006/diff/1/base/observer_list_threadsafe.h
> >>> File base/observer_list_threadsafe.h (right):
> >>>
> >>>
> >>>
>
http://codereview.chromium.org/7604006/diff/1/base/observer_list_threadsafe.h...
> >>> base/observer_list_threadsafe.h:100: observer_lists_[loop] = new
> >>> ObserverListContext(type_);
> >>> On 2011/08/09 19:32:31, darin wrote:
> >>>>
> >>>> it is very surprising that insert did not work.  i'm pretty sure we
> >>>
> >>> use that
> >>>>
> >>>> elsewhere.  what was the failure?
> >>>
> >>> The failure was due to NULL not being "typed" enough.  I originally ran
> >>> into this when using std::make_pair(), and fixed it for all known
> >>> configurations by using std::map::value_type, but apparently that
> wasn't
> >>> good enough for VS2010.  If you'd like, I can _probably_ get it to
> >>> compile with the addition of a static_cast, but it makes the code even
> >>> harder to read. Up to you.
> >>
> >> I think the current code is fine.  I'm surprised the value_type typedef
> >> didn't work.
> >
> > Yeah, I was surprised too.  Here's the compiler output if you're
> interested:
> >
> >
>
http://build.chromium.org/p/chromium/builders/Win%20Builder%202010%20%28dbg%2...
>
> And from
>
http://stackoverflow.com/questions/4596499/how-to-specify-null-as-pointer-typ...
> ,
> sounds like it maybe be C++0x-related.
>
>
Ah, nullptr :-/



> >> -Darin
> >>
> >>>
> >>> http://codereview.chromium.org/7604006/
> >>
> >>
> >
>

Powered by Google App Engine
This is Rietveld 408576698