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

Issue 2180953002: Support PostTaskAndReply from a sequenced task. (Closed)

Created:
4 years, 5 months ago by fdoray
Modified:
4 years, 4 months ago
Reviewers:
robliao, danakj, gab
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Support PostTaskAndReply from a sequenced task. Currently, TaskRunner::PostTaskAndReply and WorkerPool::PostTaskAndReply can only be called when ThreadTaskRunnerHandle::IsSet(). The reply is posted back to the thread on which PostTaskAndReply was invoked. With this CL, these methods can also be called when SequencedTaskRunnerHandle::IsSet(). The reply is posted back to the sequence on which PostTaskReply was invoked. This change is a prerequisite to implement base::PostTaskAndReply which must work from a sequenced task https://docs.google.com/document/d/1S2AAeoo1xa_vsLbDYBsDHCqhrkfiMgoIPlyRi6kxa5k/edit#heading=h.gf6e3bwrxqqs BUG=553459 Committed: https://crrev.com/2b295de8104e97a4fd186e03a465ffa46747cf4a Cr-Commit-Position: refs/heads/master@{#408794}

Patch Set 1 #

Total comments: 23

Patch Set 2 : CR gab #3 #

Total comments: 4

Patch Set 3 : rebase #

Patch Set 4 : CR gab #5 #

Patch Set 5 : self-review #

Patch Set 6 : self-review #

Total comments: 13

Patch Set 7 : CR robliao #8 #

Patch Set 8 : ASSERT -> EXPECT in constructor #

Patch Set 9 : CR danakj #11 (no callback) #

Patch Set 10 : rebase + self-review #

Patch Set 11 : rebase #

Total comments: 4

Patch Set 12 : CR dankaj #13 #

Patch Set 13 : fix build error #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+156 lines, -36 lines) Patch
M base/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M base/base.gyp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M base/threading/post_task_and_reply_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -11 lines 0 comments Download
M base/threading/post_task_and_reply_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +27 lines, -25 lines 3 comments Download
A base/threading/post_task_and_reply_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +117 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (8 generated)
fdoray
PTAL
4 years, 5 months ago (2016-07-25 17:16:58 UTC) #2
gab
Woot, this was next on my TODO list from https://groups.google.com/a/chromium.org/d/topic/chromium-dev/cd9hldEhIEc/discussion :-) Can you link the ...
4 years, 5 months ago (2016-07-25 17:57:45 UTC) #3
fdoray
gab@: PTAnL https://codereview.chromium.org/2180953002/diff/1/base/task_runner.cc File base/task_runner.cc (right): https://codereview.chromium.org/2180953002/diff/1/base/task_runner.cc#newcode8 base/task_runner.cc:8: #include "base/bind_helpers.h" On 2016/07/25 17:57:44, gab wrote: ...
4 years, 5 months ago (2016-07-25 20:40:04 UTC) #4
gab
lgtm w/ comments, thanks! https://codereview.chromium.org/2180953002/diff/20001/base/threading/post_task_and_reply_impl.cc File base/threading/post_task_and_reply_impl.cc (right): https://codereview.chromium.org/2180953002/diff/20001/base/threading/post_task_and_reply_impl.cc#newcode78 base/threading/post_task_and_reply_impl.cc:78: const PostTaskCallback& post_task_callback) { To ...
4 years, 4 months ago (2016-07-26 20:55:47 UTC) #5
fdoray
danakj@: PTAL https://codereview.chromium.org/2180953002/diff/20001/base/threading/post_task_and_reply_impl.cc File base/threading/post_task_and_reply_impl.cc (right): https://codereview.chromium.org/2180953002/diff/20001/base/threading/post_task_and_reply_impl.cc#newcode78 base/threading/post_task_and_reply_impl.cc:78: const PostTaskCallback& post_task_callback) { On 2016/07/26 20:55:47, ...
4 years, 4 months ago (2016-07-27 14:23:33 UTC) #7
robliao
https://codereview.chromium.org/2180953002/diff/100001/base/task_runner.h File base/task_runner.h (right): https://codereview.chromium.org/2180953002/diff/100001/base/task_runner.h#newcode88 base/task_runner.h:88: // PostTaskAndReply() is invoked. This allows objects that must ...
4 years, 4 months ago (2016-07-27 17:50:07 UTC) #8
fdoray
robliao@: PTAnL danakj@: PTAL https://codereview.chromium.org/2180953002/diff/100001/base/task_runner.h File base/task_runner.h (right): https://codereview.chromium.org/2180953002/diff/100001/base/task_runner.h#newcode88 base/task_runner.h:88: // PostTaskAndReply() is invoked. This ...
4 years, 4 months ago (2016-07-28 13:40:48 UTC) #9
robliao
lgtm https://codereview.chromium.org/2180953002/diff/100001/base/threading/post_task_and_reply_impl_unittest.cc File base/threading/post_task_and_reply_impl_unittest.cc (right): https://codereview.chromium.org/2180953002/diff/100001/base/threading/post_task_and_reply_impl_unittest.cc#newcode27 base/threading/post_task_and_reply_impl_unittest.cc:27: EXPECT_FALSE(*delete_flag_); On 2016/07/28 13:40:48, fdoray wrote: > On ...
4 years, 4 months ago (2016-07-28 19:25:26 UTC) #10
danakj
I think I'd prefer if you just did the sequence task runner bits in this ...
4 years, 4 months ago (2016-07-28 20:45:32 UTC) #11
fdoray
danakj@: PTAnL
4 years, 4 months ago (2016-07-29 14:40:56 UTC) #12
danakj
LGTM https://codereview.chromium.org/2180953002/diff/200001/base/threading/post_task_and_reply_impl_unittest.cc File base/threading/post_task_and_reply_impl_unittest.cc (right): https://codereview.chromium.org/2180953002/diff/200001/base/threading/post_task_and_reply_impl_unittest.cc#newcode75 base/threading/post_task_and_reply_impl_unittest.cc:75: scoped_refptr<TestSimpleTaskRunner> task_runner(new TestSimpleTaskRunner); nit: post_runner and reply_runner as ...
4 years, 4 months ago (2016-07-29 19:52:06 UTC) #13
fdoray
https://codereview.chromium.org/2180953002/diff/200001/base/threading/post_task_and_reply_impl_unittest.cc File base/threading/post_task_and_reply_impl_unittest.cc (right): https://codereview.chromium.org/2180953002/diff/200001/base/threading/post_task_and_reply_impl_unittest.cc#newcode75 base/threading/post_task_and_reply_impl_unittest.cc:75: scoped_refptr<TestSimpleTaskRunner> task_runner(new TestSimpleTaskRunner); On 2016/07/29 19:52:06, danakj wrote: > ...
4 years, 4 months ago (2016-07-29 20:14:43 UTC) #14
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/2180953002/210001
4 years, 4 months ago (2016-07-29 20:15:29 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-generic_chromium_compile_only_ng/builds/175561)
4 years, 4 months ago (2016-07-29 20:26:24 UTC) #19
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/2180953002/230001
4 years, 4 months ago (2016-07-29 20:47:27 UTC) #22
commit-bot: I haz the power
Committed patchset #13 (id:230001)
4 years, 4 months ago (2016-07-29 22:50:08 UTC) #23
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/2b295de8104e97a4fd186e03a465ffa46747cf4a Cr-Commit-Position: refs/heads/master@{#408794}
4 years, 4 months ago (2016-07-29 23:05:09 UTC) #25
gab
Took a post-commit peak at last modifications : one nit below. https://codereview.chromium.org/2180953002/diff/230001/base/threading/post_task_and_reply_impl.cc File base/threading/post_task_and_reply_impl.cc (right): ...
4 years, 4 months ago (2016-07-30 16:57:55 UTC) #26
fdoray
https://codereview.chromium.org/2180953002/diff/230001/base/threading/post_task_and_reply_impl.cc File base/threading/post_task_and_reply_impl.cc (right): https://codereview.chromium.org/2180953002/diff/230001/base/threading/post_task_and_reply_impl.cc#newcode32 base/threading/post_task_and_reply_impl.cc:32: : sequence_checker_(), On 2016/07/30 16:57:54, gab wrote: > Not ...
4 years, 4 months ago (2016-08-01 13:22:22 UTC) #27
gab
4 years, 4 months ago (2016-08-01 13:26:22 UTC) #28
Message was sent while issue was closed.
https://codereview.chromium.org/2180953002/diff/230001/base/threading/post_ta...
File base/threading/post_task_and_reply_impl.cc (right):

https://codereview.chromium.org/2180953002/diff/230001/base/threading/post_ta...
base/threading/post_task_and_reply_impl.cc:32: : sequence_checker_(),
On 2016/08/01 13:22:22, fdoray wrote:
> On 2016/07/30 16:57:54, gab wrote:
> > Not necessary, member should be automatically initialized with its default
> > constructor.
> 
> Build error with clang when const member is not explicitly initialized. See
> difference between patch set 12 and 13.

Uh, that surprises me, I don't see why that's necessary, but okay.

Powered by Google App Engine
This is Rietveld 408576698