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

Issue 2657603004: Clear PostTaskAndReply task on the destination thread (3) (Closed)

Created:
3 years, 11 months ago by tzik
Modified:
3 years, 8 months ago
Reviewers:
gab, dcheng
CC:
chromium-reviews, fdoray+watch_chromium.org, robliao+watch_chromium.org, gab+watch_chromium.org, sadrul, vmpstr+watch_chromium.org, danakj
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Clear PostTaskAndReply task on the destination thread This is the behavior-changing part of base::TaskRunner migration from base::Callback to base::OnceCallback. In the previous code, PostTaskAndReply and its family guarantee that |task| is destroyed on the origin thread. If that is not possible, PTAR leaks |task|. However, it's hard to keep that with OnceCallback, and the behavior makes less sense on Blink classes, since most of its types are thread-unsafe and need special handling for thread hop. Destroying the bound object on the original thread requires extra thread hop on the bound object just. On the new code, |task| is destroyed on the target thread unless the caller holds a reference on the origin thread. BUG=680359 Review-Url: https://codereview.chromium.org/2657603004 Cr-Commit-Position: refs/heads/master@{#460821} Committed: https://chromium.googlesource.com/chromium/src/+/e5de8d551e80115b21e0e3ca7d5451d3cee6f3ba

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : +WithResult. ios, cancelable, quota. #

Patch Set 4 : +disk_cache::File fix #

Patch Set 5 : rebase #

Total comments: 16

Patch Set 6 : rebase #

Patch Set 7 : rebase on split CLs #

Patch Set 8 : rename a test case. +comment #

Patch Set 9 : rebase #

Patch Set 10 : rebase #

Patch Set 11 : rebase on DCHECK in RefCount CL #

Patch Set 12 : rebase #

Patch Set 13 : rebase #

Patch Set 14 : rebase onto master without dcheck_in_ref_counted #

Total comments: 2

Patch Set 15 : test #

Patch Set 16 : -#include #

Total comments: 2

Patch Set 17 : mod test #

Total comments: 2

Patch Set 18 : reorder delete_flag check. +comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -26 lines) Patch
M base/message_loop/message_loop_task_runner_unittest.cc View 1 2 3 4 5 6 7 3 chunks +7 lines, -4 lines 0 comments Download
M base/threading/post_task_and_reply_impl.cc View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -6 lines 0 comments Download
M base/threading/post_task_and_reply_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +9 lines, -16 lines 0 comments Download

Messages

Total messages: 118 (97 generated)
tzik
PTAL
3 years, 10 months ago (2017-01-30 21:07:47 UTC) #46
dcheng
On 2017/01/30 21:07:47, tzik wrote: > PTAL Nit: I think the CL description might be ...
3 years, 10 months ago (2017-01-31 01:55:40 UTC) #49
danakj
On Mon, Jan 30, 2017 at 8:55 PM, <dcheng@chromium.org> wrote: > On 2017/01/30 21:07:47, tzik ...
3 years, 10 months ago (2017-01-31 15:37:08 UTC) #50
gab
On 2017/01/31 15:37:08, danakj (slow) wrote: > On Mon, Jan 30, 2017 at 8:55 PM, ...
3 years, 10 months ago (2017-01-31 19:34:59 UTC) #52
dcheng
On 2017/01/31 19:34:59, gab (travel until 5th) wrote: > On 2017/01/31 15:37:08, danakj (slow) wrote: ...
3 years, 10 months ago (2017-02-01 07:53:26 UTC) #54
tzik
On 2017/01/31 01:55:40, dcheng wrote: > On 2017/01/30 21:07:47, tzik wrote: > > PTAL > ...
3 years, 10 months ago (2017-02-07 07:07:45 UTC) #55
dcheng
LGTM with nits https://codereview.chromium.org/2657603004/diff/80001/base/message_loop/message_loop_task_runner_unittest.cc File base/message_loop/message_loop_task_runner_unittest.cc (right): https://codereview.chromium.org/2657603004/diff/80001/base/message_loop/message_loop_task_runner_unittest.cc#newcode203 base/message_loop/message_loop_task_runner_unittest.cc:203: TEST_F(MessageLoopTaskRunnerTest, PostTaskAndReply_DeadReplyLoopDoesNotDelete) { On 2017/01/31 19:34:59, ...
3 years, 10 months ago (2017-02-07 07:28:44 UTC) #56
tzik
https://codereview.chromium.org/2657603004/diff/80001/base/message_loop/message_loop_task_runner_unittest.cc File base/message_loop/message_loop_task_runner_unittest.cc (right): https://codereview.chromium.org/2657603004/diff/80001/base/message_loop/message_loop_task_runner_unittest.cc#newcode203 base/message_loop/message_loop_task_runner_unittest.cc:203: TEST_F(MessageLoopTaskRunnerTest, PostTaskAndReply_DeadReplyLoopDoesNotDelete) { On 2017/02/07 07:28:44, dcheng wrote: > ...
3 years, 10 months ago (2017-02-07 08:05:35 UTC) #57
tzik
https://codereview.chromium.org/2657603004/diff/80001/base/message_loop/message_loop_task_runner_unittest.cc File base/message_loop/message_loop_task_runner_unittest.cc (right): https://codereview.chromium.org/2657603004/diff/80001/base/message_loop/message_loop_task_runner_unittest.cc#newcode203 base/message_loop/message_loop_task_runner_unittest.cc:203: TEST_F(MessageLoopTaskRunnerTest, PostTaskAndReply_DeadReplyLoopDoesNotDelete) { On 2017/02/07 07:28:44, dcheng wrote: > ...
3 years, 10 months ago (2017-02-07 08:33:26 UTC) #62
gab
On 2017/02/07 07:07:45, tzik wrote: > On 2017/01/31 01:55:40, dcheng wrote: > > On 2017/01/30 ...
3 years, 10 months ago (2017-02-07 16:01:06 UTC) #65
tzik
On 2017/02/07 16:01:06, gab wrote: > On 2017/02/07 07:07:45, tzik wrote: > > On 2017/01/31 ...
3 years, 10 months ago (2017-02-08 09:24:49 UTC) #66
tzik
On 2017/02/07 16:01:06, gab wrote: > On 2017/02/07 07:07:45, tzik wrote: > > On 2017/01/31 ...
3 years, 10 months ago (2017-02-23 10:06:49 UTC) #75
gab
On 2017/02/23 10:06:49, tzik wrote: > On 2017/02/07 16:01:06, gab wrote: > > On 2017/02/07 ...
3 years, 10 months ago (2017-02-23 19:14:28 UTC) #76
gab
https://codereview.chromium.org/2657603004/diff/260001/base/threading/post_task_and_reply_impl_unittest.cc File base/threading/post_task_and_reply_impl_unittest.cc (right): https://codereview.chromium.org/2657603004/diff/260001/base/threading/post_task_and_reply_impl_unittest.cc#newcode64 base/threading/post_task_and_reply_impl_unittest.cc:64: EXPECT_TRUE(*delete_flag); This test is kind of outdated with this ...
3 years, 8 months ago (2017-03-29 16:33:43 UTC) #97
tzik
https://codereview.chromium.org/2657603004/diff/260001/base/threading/post_task_and_reply_impl_unittest.cc File base/threading/post_task_and_reply_impl_unittest.cc (right): https://codereview.chromium.org/2657603004/diff/260001/base/threading/post_task_and_reply_impl_unittest.cc#newcode64 base/threading/post_task_and_reply_impl_unittest.cc:64: EXPECT_TRUE(*delete_flag); On 2017/03/29 16:33:42, gab wrote: > This test ...
3 years, 8 months ago (2017-03-29 18:03:36 UTC) #102
gab
https://codereview.chromium.org/2657603004/diff/300001/base/threading/post_task_and_reply_impl_unittest.cc File base/threading/post_task_and_reply_impl_unittest.cc (right): https://codereview.chromium.org/2657603004/diff/300001/base/threading/post_task_and_reply_impl_unittest.cc#newcode75 base/threading/post_task_and_reply_impl_unittest.cc:75: class WrappedTaskRunner : public SingleThreadTaskRunner { Hmmm sorry I ...
3 years, 8 months ago (2017-03-29 18:21:35 UTC) #103
tzik
https://codereview.chromium.org/2657603004/diff/300001/base/threading/post_task_and_reply_impl_unittest.cc File base/threading/post_task_and_reply_impl_unittest.cc (right): https://codereview.chromium.org/2657603004/diff/300001/base/threading/post_task_and_reply_impl_unittest.cc#newcode75 base/threading/post_task_and_reply_impl_unittest.cc:75: class WrappedTaskRunner : public SingleThreadTaskRunner { On 2017/03/29 18:21:35, ...
3 years, 8 months ago (2017-03-30 09:01:18 UTC) #108
gab
lgtm w/ comment https://codereview.chromium.org/2657603004/diff/320001/base/threading/post_task_and_reply_impl_unittest.cc File base/threading/post_task_and_reply_impl_unittest.cc (right): https://codereview.chromium.org/2657603004/diff/320001/base/threading/post_task_and_reply_impl_unittest.cc#newcode97 base/threading/post_task_and_reply_impl_unittest.cc:97: EXPECT_TRUE(delete_flag); Move to line 93, right ...
3 years, 8 months ago (2017-03-30 14:40:22 UTC) #111
tzik
https://codereview.chromium.org/2657603004/diff/320001/base/threading/post_task_and_reply_impl_unittest.cc File base/threading/post_task_and_reply_impl_unittest.cc (right): https://codereview.chromium.org/2657603004/diff/320001/base/threading/post_task_and_reply_impl_unittest.cc#newcode97 base/threading/post_task_and_reply_impl_unittest.cc:97: EXPECT_TRUE(delete_flag); On 2017/03/30 14:40:22, gab wrote: > Move to ...
3 years, 8 months ago (2017-03-30 16:22:00 UTC) #112
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/2657603004/340001
3 years, 8 months ago (2017-03-30 16:22:49 UTC) #115
commit-bot: I haz the power
3 years, 8 months ago (2017-03-30 18:06:40 UTC) #118
Message was sent while issue was closed.
Committed patchset #18 (id:340001) as
https://chromium.googlesource.com/chromium/src/+/e5de8d551e80115b21e0e3ca7d54...

Powered by Google App Engine
This is Rietveld 408576698