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

Issue 1709483002: Support move-only type on base::Callback::Run (Closed)

Created:
4 years, 10 months ago by tzik
Modified:
4 years, 9 months ago
Reviewers:
danakj, Nico, dcheng
CC:
chromium-reviews, danakj, vmpstr+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Support move-only type on base::Callback::Run Change base::Callback<R(Args...)>::Run argument signature from CallbackParamTraits<Args>::ForwardType to bare Arg, and forward the arguments in the rest of the callchain to the bound function. This implies making an extra copy when a pass-by-value argument of Callback::Run() is a copyable-but-not-efficiently-movable types. That is due to broken Perfect Forwarding from the callchain from Callback::Run() to the bound function. However, Perfect Forwarding idiom is not fully applicable to the callchain, since we have to determine the type of a function pointer in the Callback ctor, before Callback::Run() is called. Also, this CL converts a copy construction to a move construction when a pass-by-value argument of Callback::Run() is a general movable type. E.g. std::string, std::map and others movable class without DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND. BUG=554299 Committed: https://crrev.com/a43eff01d5024ee6722ebd637c30890681fbfe21 Cr-Commit-Position: refs/heads/master@{#380080}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : rebase #

Patch Set 8 : remove Passed() whitelist check #

Total comments: 9

Patch Set 9 : +comment #

Total comments: 6

Patch Set 10 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -38 lines) Patch
M base/bind_helpers.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -5 lines 0 comments Download
M base/bind_internal.h View 2 chunks +10 lines, -14 lines 0 comments Download
M base/bind_unittest.cc View 5 chunks +22 lines, -12 lines 0 comments Download
M base/callback.h View 1 2 3 4 5 6 7 8 9 1 chunk +14 lines, -7 lines 0 comments Download

Messages

Total messages: 67 (32 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1709483002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1709483002/1
4 years, 10 months ago (2016-02-17 06:05:12 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/174840)
4 years, 10 months ago (2016-02-17 06:53:58 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1709483002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1709483002/20001
4 years, 10 months ago (2016-02-17 07:41:08 UTC) #7
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/169177)
4 years, 10 months ago (2016-02-17 08:22:24 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1709483002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1709483002/40001
4 years, 10 months ago (2016-02-17 08:25:12 UTC) #15
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/146464)
4 years, 10 months ago (2016-02-17 09:24:34 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1709483002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1709483002/60001
4 years, 10 months ago (2016-02-17 09:26:16 UTC) #18
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_32_ng/builds/159750) linux_chromium_rel_ng on ...
4 years, 10 months ago (2016-02-17 09:49:52 UTC) #20
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1709483002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1709483002/100001
4 years, 10 months ago (2016-02-17 11:46:11 UTC) #23
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1709483002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1709483002/120001
4 years, 10 months ago (2016-02-17 12:26:41 UTC) #25
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-17 14:26:55 UTC) #29
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1709483002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1709483002/140001
4 years, 10 months ago (2016-02-20 09:50:39 UTC) #32
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/26448)
4 years, 10 months ago (2016-02-20 12:54:20 UTC) #34
dcheng
Does this mean behavior is going to differ between early-bound and late-bound arguments? Will we ...
4 years, 10 months ago (2016-02-22 18:18:21 UTC) #35
tzik
On 2016/02/22 18:18:21, dcheng wrote: > Does this mean behavior is going to differ between ...
4 years, 10 months ago (2016-02-22 20:14:04 UTC) #36
tzik
On 2016/02/22 20:14:04, tzik wrote: > On 2016/02/22 18:18:21, dcheng wrote: > > Does this ...
4 years, 10 months ago (2016-02-24 01:46:44 UTC) #38
tzik
PTAL
4 years, 10 months ago (2016-02-24 01:47:16 UTC) #39
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1709483002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1709483002/160001
4 years, 10 months ago (2016-02-24 01:50:13 UTC) #40
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/149935)
4 years, 10 months ago (2016-02-24 05:30:35 UTC) #42
tzik
+danakj@. dcheng@, thakis@: Could you take a look? Do you have any comment?
4 years, 9 months ago (2016-02-29 18:06:16 UTC) #44
dcheng
From my recollection of hacking on this, the extra copies seem unavoidable, but I have ...
4 years, 9 months ago (2016-03-01 02:05:47 UTC) #45
tzik
On 2016/03/01 02:05:47, dcheng wrote: > From my recollection of hacking on this, the extra ...
4 years, 9 months ago (2016-03-01 07:18:32 UTC) #46
dcheng
https://codereview.chromium.org/1709483002/diff/160001/base/bind_helpers.h File base/bind_helpers.h (right): https://codereview.chromium.org/1709483002/diff/160001/base/bind_helpers.h#newcode566 base/bind_helpers.h:566: typename std::enable_if<!std::is_lvalue_reference<T>::value>::type* = Is it worth trying to catch ...
4 years, 9 months ago (2016-03-02 00:25:45 UTC) #47
tzik
https://codereview.chromium.org/1709483002/diff/160001/base/bind_helpers.h File base/bind_helpers.h (right): https://codereview.chromium.org/1709483002/diff/160001/base/bind_helpers.h#newcode566 base/bind_helpers.h:566: typename std::enable_if<!std::is_lvalue_reference<T>::value>::type* = On 2016/03/02 00:25:45, dcheng wrote: > ...
4 years, 9 months ago (2016-03-02 01:04:21 UTC) #48
dcheng
https://codereview.chromium.org/1709483002/diff/160001/base/bind_helpers.h File base/bind_helpers.h (right): https://codereview.chromium.org/1709483002/diff/160001/base/bind_helpers.h#newcode566 base/bind_helpers.h:566: typename std::enable_if<!std::is_lvalue_reference<T>::value>::type* = On 2016/03/02 at 01:04:21, tzik wrote: ...
4 years, 9 months ago (2016-03-02 08:06:51 UTC) #49
tzik
https://codereview.chromium.org/1709483002/diff/160001/base/bind_helpers.h File base/bind_helpers.h (right): https://codereview.chromium.org/1709483002/diff/160001/base/bind_helpers.h#newcode566 base/bind_helpers.h:566: typename std::enable_if<!std::is_lvalue_reference<T>::value>::type* = On 2016/03/02 08:06:51, dcheng wrote: > ...
4 years, 9 months ago (2016-03-02 12:44:51 UTC) #51
dcheng
LGTM, just a few comment suggestions. https://codereview.chromium.org/1709483002/diff/180001/base/callback.h File base/callback.h (right): https://codereview.chromium.org/1709483002/diff/180001/base/callback.h#newcode390 base/callback.h:390: // if an ...
4 years, 9 months ago (2016-03-02 23:00:57 UTC) #52
tzik
https://codereview.chromium.org/1709483002/diff/180001/base/callback.h File base/callback.h (right): https://codereview.chromium.org/1709483002/diff/180001/base/callback.h#newcode390 base/callback.h:390: // if an item of |args| is passed-by-value and ...
4 years, 9 months ago (2016-03-03 18:53:19 UTC) #53
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1709483002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1709483002/200001
4 years, 9 months ago (2016-03-07 16:14:49 UTC) #55
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/177324)
4 years, 9 months ago (2016-03-07 17:45:05 UTC) #57
Nico
mojo::String and maybe MemoryUsageStats sound possibly a bit worrying. Should the places that pass them ...
4 years, 9 months ago (2016-03-08 20:24:12 UTC) #58
tzik
On 2016/03/08 20:24:12, Nico wrote: > mojo::String and maybe MemoryUsageStats sound possibly a bit worrying. ...
4 years, 9 months ago (2016-03-09 03:50:49 UTC) #60
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1709483002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1709483002/200001
4 years, 9 months ago (2016-03-09 03:51:34 UTC) #63
commit-bot: I haz the power
Committed patchset #10 (id:200001)
4 years, 9 months ago (2016-03-09 05:46:14 UTC) #65
commit-bot: I haz the power
4 years, 9 months ago (2016-03-09 05:47:25 UTC) #67
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/a43eff01d5024ee6722ebd637c30890681fbfe21
Cr-Commit-Position: refs/heads/master@{#380080}

Powered by Google App Engine
This is Rietveld 408576698