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

Issue 8728010: Increase Bind/Callback Arity from 6 -> 7. (Closed)

Created:
9 years ago by awong
Modified:
9 years ago
CC:
chromium-reviews, brettw-cc_chromium.org, James Hawkins, darin (slow to review), akalin
Visibility:
Public.

Description

Increase Bind/Callback Arity from 6 -> 7. A few functions need this and the expected compile-speed impact is low. We should be careful when raising this number higher. If you're binding a function that has more parameters than this supports, consider refactoring your API to use a parameter struct or something. Template equation: (n^2 + 26n) / 2 Template growth: 96 -> 116 types. BUG=98542 TEST=try bots Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=111788

Patch Set 1 #

Total comments: 1

Patch Set 2 : Updated comments. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+751 lines, -21 lines) Patch
M base/bind.h View 1 2 chunks +76 lines, -1 line 0 comments Download
M base/bind.h.pump View 1 1 chunk +19 lines, -1 line 0 comments Download
M base/bind_internal.h View 1 7 chunks +538 lines, -7 lines 1 comment Download
M base/bind_internal.h.pump View 1 1 chunk +2 lines, -7 lines 0 comments Download
M base/bind_internal_win.h View 1 2 chunks +50 lines, -1 line 0 comments Download
M base/bind_internal_win.h.pump View 1 1 chunk +2 lines, -1 line 0 comments Download
M base/callback.h View 1 3 chunks +62 lines, -2 lines 0 comments Download
M base/callback.h.pump View 1 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
awong
9 years ago (2011-11-28 19:59:17 UTC) #1
willchan no longer on Chromium
lgtm http://codereview.chromium.org/8728010/diff/1/base/bind.h.pump File base/bind.h.pump (right): http://codereview.chromium.org/8728010/diff/1/base/bind.h.pump#newcode8 base/bind.h.pump:8: $var MAX_ARITY = 7 It'd be great to ...
9 years ago (2011-11-28 20:02:49 UTC) #2
awong
9 years ago (2011-11-28 20:16:38 UTC) #3
Added comments, and removed one stale comment.

http://codereview.chromium.org/8728010/diff/4001/base/bind_internal.h
File base/bind_internal.h (left):

http://codereview.chromium.org/8728010/diff/4001/base/bind_internal.h#oldcode11
base/bind_internal.h:11: // Do we want to allow creating a fully unbound
method??
Stale TODO. I thought this through and realized that our normal enforcement that
refcounted parameters need to take a scoped_refptr already handles this... 
Assume Foo is refcounted.

Callback<void(Foo*)> cb = Bind(&Foo::VoidFunc);

Bind(cb, new Foo());  // Compile failure since you're binding a Foo*.

So yay! All works!

Powered by Google App Engine
This is Rietveld 408576698