|
Callback API Change: Reimplement Bind(); support IgnoreResult, full currying, and use less types.
The main API change IgnoreResult() and fully currying. See unittest for what the new API looks like. The rest of the changes are done to support that.
Previously, IgnoreReturn could not be used with WeakPtr<> Bind()s as it was applied after the fact to the Callback object. Now, IgnoreResult() wraps the function like Unretained().
As an incidental benefit, the new implementation gave us fully currying for free.
Also, the new implementation scales better when supporting higher arities of functions. The new type growth is:
(n^2 + 20n) / 2
as opposed to
(3n^2 + 17n) / 2
where n == arity.
For n = 6 and n=10, the new implementation has 81 and 155 templates respectively.
The old implementation had 105 and 235 templates respectively.
BUG= 35233, 98919, 98542
TEST=existing unittests
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=110975
Total comments: 6
Total comments: 18
Total comments: 2
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+3286 lines, -2702 lines) |
Patch |
|
M |
base/at_exit_unittest.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
base/bind.h
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+356 lines, -86 lines |
0 comments
|
Download
|
|
M |
base/bind.h.pump
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+73 lines, -42 lines |
0 comments
|
Download
|
|
M |
base/bind_helpers.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
|
6 chunks |
+98 lines, -25 lines |
0 comments
|
Download
|
|
M |
base/bind_internal.h
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+1769 lines, -1816 lines |
0 comments
|
Download
|
|
M |
base/bind_internal.h.pump
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+365 lines, -266 lines |
0 comments
|
Download
|
|
M |
base/bind_internal_win.h
|
View
|
1
2
4
|
2 chunks |
+239 lines, -149 lines |
0 comments
|
Download
|
|
M |
base/bind_internal_win.h.pump
|
View
|
1
2
4
|
3 chunks |
+27 lines, -29 lines |
0 comments
|
Download
|
|
M |
base/bind_unittest.cc
|
View
|
1
2
3
4
5
6
|
4 chunks |
+60 lines, -34 lines |
0 comments
|
Download
|
|
M |
base/bind_unittest.nc
|
View
|
1
2
3
|
4 chunks |
+6 lines, -5 lines |
0 comments
|
Download
|
|
M |
base/callback.h
|
View
|
1
|
10 chunks |
+154 lines, -126 lines |
0 comments
|
Download
|
|
M |
base/callback.h.pump
|
View
|
1
|
4 chunks |
+25 lines, -21 lines |
0 comments
|
Download
|
|
M |
base/callback_internal.h
|
View
|
1
|
5 chunks |
+19 lines, -19 lines |
0 comments
|
Download
|
|
M |
base/callback_internal.cc
|
View
|
1
|
1 chunk |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
base/callback_unittest.cc
|
View
|
1
|
3 chunks |
+9 lines, -9 lines |
0 comments
|
Download
|
|
M |
base/file_util_proxy.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
base/task_unittest.cc
|
View
|
1
2
3
4
5
6
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
base/template_util.h
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
base/template_util_unittest.cc
|
View
|
1
2
3
4
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
build/nocompile.gypi
|
View
|
1
2
3
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/chrome_browser_main_x11.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/extension_service.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/extension_updater.cc
|
View
|
1
2
3
4
5
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/net/net_pref_observer.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/net/predictor.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/password_manager/password_store_x.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
chrome/common/profiling.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/browser/cancelable_request.h
|
View
|
1
2
3
|
6 chunks |
+48 lines, -42 lines |
0 comments
|
Download
|
|
M |
content/browser/debugger/worker_devtools_manager.cc
|
View
|
1
2
3
4
5
6
7
|
6 chunks |
+5 lines, -6 lines |
0 comments
|
Download
|
|
M |
content/browser/plugin_service_browsertest.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/render_widget_fullscreen_pepper.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
media/tools/player_x11/player_x11.cc
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
remoting/protocol/jingle_session_unittest.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
Total messages: 12 (0 generated)
|