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

Issue 11369061: Disassociate argument type from return type in PostTaskAndReplyWithResult template. (Closed)

Created:
8 years, 1 month ago by awong
Modified:
8 years ago
CC:
chromium-reviews, erikwright+watch_chromium.org, hashimoto
Visibility:
Public.

Description

Disassociate argument type from return type in PostTaskAndReplyWithResult template. This is needed to allow the callback system to perform implicit conversions from the task result to the argument's call. Otherwise, the template resolution will force exact equality between the return type of the task and the reply's argument type which is too strict. For example, you wouldn't be able to take a const int & when returning an int. Also remove some DCHECKs that can't happen. BUG=159114 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=169825

Patch Set 1 #

Total comments: 12

Patch Set 2 : scrubbed impl. Removed some helper funcs and some overzealous sanity checks. #

Patch Set 3 : fix comment #

Patch Set 4 : Don't rely on PTARWR allowing a null reply. #

Total comments: 2

Patch Set 5 : Revert is_null() strictness. #

Total comments: 4

Patch Set 6 : Move null check back into ReplyAdapter. #

Patch Set 7 : fix cut/paste error #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -30 lines) Patch
M base/task_runner_util.h View 1 2 3 4 5 6 2 chunks +20 lines, -30 lines 0 comments Download
M base/task_runner_util_unittest.cc View 1 2 chunks +19 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
awong
8 years, 1 month ago (2012-11-02 20:55:10 UTC) #1
battre
Thanks! LGTM
8 years, 1 month ago (2012-11-05 12:40:43 UTC) #2
Jeffrey Yasskin
https://codereview.chromium.org/11369061/diff/1/base/task_runner_util.h File base/task_runner_util.h (right): https://codereview.chromium.org/11369061/diff/1/base/task_runner_util.h#newcode35 base/task_runner_util.h:35: template <typename ReturnType, typename ResultType> Could you give these ...
8 years, 1 month ago (2012-11-05 22:13:22 UTC) #3
awong
PTAL https://codereview.chromium.org/11369061/diff/1/base/task_runner_util.h File base/task_runner_util.h (right): https://codereview.chromium.org/11369061/diff/1/base/task_runner_util.h#newcode35 base/task_runner_util.h:35: template <typename ReturnType, typename ResultType> On 2012/11/05 22:13:22, ...
8 years, 1 month ago (2012-11-19 05:57:09 UTC) #4
awong
Apparently someone is relying on the "feature" of accepting |reply| Closures that are null. Suck. ...
8 years, 1 month ago (2012-11-19 07:26:25 UTC) #5
Jeffrey Yasskin
LGTM once you figure out the other places that depend on null callback arguments. http://codereview.chromium.org/11369061/diff/1/base/task_runner_util.h ...
8 years, 1 month ago (2012-11-19 10:33:46 UTC) #6
awong
FYI, I had to remove the is_null() DCHECK. Too viral of a change. Instead, I ...
8 years ago (2012-11-26 21:57:26 UTC) #7
awong
darin: will's out. Mind doing OWNERS?
8 years ago (2012-11-27 19:26:41 UTC) #8
darin (slow to review)
https://codereview.chromium.org/11369061/diff/18001/base/task_runner_util.h File base/task_runner_util.h (right): https://codereview.chromium.org/11369061/diff/18001/base/task_runner_util.h#newcode55 base/task_runner_util.h:55: if (reply.is_null()) { What is the use case for ...
8 years ago (2012-11-27 21:26:17 UTC) #9
awong
https://codereview.chromium.org/11369061/diff/18001/base/task_runner_util.h File base/task_runner_util.h (right): https://codereview.chromium.org/11369061/diff/18001/base/task_runner_util.h#newcode55 base/task_runner_util.h:55: if (reply.is_null()) { On 2012/11/27 21:26:17, darin wrote: > ...
8 years ago (2012-11-27 21:30:36 UTC) #10
darin (slow to review)
https://codereview.chromium.org/11369061/diff/18001/base/task_runner_util.h File base/task_runner_util.h (right): https://codereview.chromium.org/11369061/diff/18001/base/task_runner_util.h#newcode55 base/task_runner_util.h:55: if (reply.is_null()) { On 2012/11/27 21:30:36, awong wrote: > ...
8 years ago (2012-11-27 21:35:30 UTC) #11
awong
https://codereview.chromium.org/11369061/diff/18001/base/task_runner_util.h File base/task_runner_util.h (right): https://codereview.chromium.org/11369061/diff/18001/base/task_runner_util.h#newcode55 base/task_runner_util.h:55: if (reply.is_null()) { On 2012/11/27 21:35:30, darin wrote: > ...
8 years ago (2012-11-27 21:40:13 UTC) #12
awong
Moved check back up into ReplyAdapter and added TODO() comment referencing bug.
8 years ago (2012-11-27 23:22:04 UTC) #13
darin (slow to review)
LGTM
8 years ago (2012-11-27 23:58:11 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ajwong@chromium.org/11369061/23012
8 years ago (2012-11-28 00:16:07 UTC) #15
commit-bot: I haz the power
Retried try job too often for step(s) aura_unit_tests
8 years ago (2012-11-28 02:03:52 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ajwong@chromium.org/11369061/23012
8 years ago (2012-11-28 02:18:22 UTC) #17
commit-bot: I haz the power
8 years ago (2012-11-28 03:29:04 UTC) #18
Message was sent while issue was closed.
Change committed as 169825

Powered by Google App Engine
This is Rietveld 408576698