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

Issue 2250373002: Readd base::UnwrapTraits to support rvalue-reference wrappers (Closed)

Created:
4 years, 4 months ago by tzik
Modified:
4 years, 3 months ago
Reviewers:
Yuta Kitamura, dcheng
CC:
chromium-reviews, blink-reviews, blink-reviews-wtf_chromium.org, Mikhail
Base URL:
https://chromium.googlesource.com/chromium/src.git@20_oneshot
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Readd base::UnwrapTraits to support rvalue-reference wrappers base::Bind implementation uses the function overload resolution with ADL to dispatch bound parameters to Unwrap function. However, this works only when the bound parameter is passed as a const reference. And other form of bound parameters, such as rvalue-reference, are fallback to default Unwrap and fails to compile. This CL introduces UnwrapTraits<> as a traits struct, and converts Unwap() function to UnwrapTraits<>::Unwrap(), so that the unwrapping function is looked up by the normalized type name. BUG=554299 Committed: https://crrev.com/001315c4accb9d245badf6244c42d861610d630e Cr-Commit-Position: refs/heads/master@{#415008}

Patch Set 1 #

Patch Set 2 : +comment #

Patch Set 3 : forward decl for build fix #

Total comments: 2

Patch Set 4 : update base_unittests for OneShotCallback #

Patch Set 5 : s/Callback/RepeatingCallback/ #

Patch Set 6 : remove unused "using" #

Total comments: 4

Patch Set 7 : revert tests. rebase #

Patch Set 8 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+148 lines, -56 lines) Patch
M base/BUILD.gn View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M base/base.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M base/bind_helpers.h View 1 2 3 chunks +50 lines, -26 lines 0 comments Download
A base/bind_helpers_unittest.cc View 1 chunk +50 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/wtf/Functional.h View 4 chunks +31 lines, -25 lines 0 comments Download
M third_party/WebKit/Source/wtf/FunctionalTest.cpp View 2 chunks +15 lines, -5 lines 0 comments Download

Messages

Total messages: 42 (30 generated)
tzik
PTAL
4 years, 4 months ago (2016-08-18 04:19:46 UTC) #15
Yuta Kitamura
wtf/ LGTM
4 years, 4 months ago (2016-08-18 05:02:34 UTC) #16
dcheng
https://codereview.chromium.org/2250373002/diff/40001/base/bind_helpers_unittest.cc File base/bind_helpers_unittest.cc (right): https://codereview.chromium.org/2250373002/diff/40001/base/bind_helpers_unittest.cc#newcode16 base/bind_helpers_unittest.cc:16: EXPECT_EQ(&i, internal::Unwrap(unretained)); I feel like we should be testing ...
4 years, 4 months ago (2016-08-19 04:32:15 UTC) #17
tzik
https://codereview.chromium.org/2250373002/diff/40001/base/bind_helpers_unittest.cc File base/bind_helpers_unittest.cc (right): https://codereview.chromium.org/2250373002/diff/40001/base/bind_helpers_unittest.cc#newcode16 base/bind_helpers_unittest.cc:16: EXPECT_EQ(&i, internal::Unwrap(unretained)); On 2016/08/19 04:32:15, dcheng wrote: > I ...
4 years, 4 months ago (2016-08-23 04:00:16 UTC) #26
dcheng
https://codereview.chromium.org/2250373002/diff/100001/base/bind_helpers.h File base/bind_helpers.h (right): https://codereview.chromium.org/2250373002/diff/100001/base/bind_helpers.h#newcode286 base/bind_helpers.h:286: return Unwrapper<T>::Unwrap(std::forward<T>(o)); Just curious, but can't we just invoke ...
4 years, 4 months ago (2016-08-23 05:25:38 UTC) #27
tzik
https://codereview.chromium.org/2250373002/diff/100001/base/bind_helpers.h File base/bind_helpers.h (right): https://codereview.chromium.org/2250373002/diff/100001/base/bind_helpers.h#newcode286 base/bind_helpers.h:286: return Unwrapper<T>::Unwrap(std::forward<T>(o)); On 2016/08/23 05:25:38, dcheng wrote: > Just ...
4 years, 4 months ago (2016-08-23 07:01:09 UTC) #30
dcheng
On 2016/08/23 07:01:09, tzik wrote: > https://codereview.chromium.org/2250373002/diff/100001/base/bind_helpers.h > File base/bind_helpers.h (right): > > https://codereview.chromium.org/2250373002/diff/100001/base/bind_helpers.h#newcode286 > ...
4 years, 3 months ago (2016-08-24 20:22:13 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2250373002/140001
4 years, 3 months ago (2016-08-29 01:43:56 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/287961)
4 years, 3 months ago (2016-08-29 03:44:57 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2250373002/140001
4 years, 3 months ago (2016-08-29 12:54:20 UTC) #38
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 3 months ago (2016-08-29 14:45:13 UTC) #40
commit-bot: I haz the power
4 years, 3 months ago (2016-08-29 14:46:41 UTC) #42
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/001315c4accb9d245badf6244c42d861610d630e
Cr-Commit-Position: refs/heads/master@{#415008}

Powered by Google App Engine
This is Rietveld 408576698