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

Issue 998063002: base: Make it possible to replace the MessageLoop's task runner (Closed)

Created:
5 years, 9 months ago by Sami
Modified:
5 years, 5 months ago
Reviewers:
danakj, alexclarke, jam, kinuko
CC:
chromium-reviews, erikwright+watch_chromium.org, sadrul
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

base: Make it possible to replace the MessageLoop's task runner This patch makes it possible to customize the task posting behavior of a MessageLoop. More specifically, a client can change the value returned by MessageLoop::task_runner() as well as ThreadTaskRunnerHandle::Get() on the target thread. The original task runner can still be used to post tasks to be run on the message loop. The Blink/renderer scheduler will use this functionality to manage task posting on the renderer main thread. This is needed to ensure consistent ordering of tasks posted through the MessageLoop w.r.t. tasks posted to the scheduler. Design doc: https://docs.google.com/a/chromium.org/document/d/1qxdh2I61_aB_Uzh1QgNqvdWFBCL_E65G2smoSySw7KU/edit# Alex Clarke <alexclarke@chromium.org>; also contributed to this patch (https://codereview.chromium.org/1206893003/). BUG=465354 Committed: https://crrev.com/85f43a3185f38eb89c63ad108fd1b73000e0ac56 Cr-Commit-Position: refs/heads/master@{#338564}

Patch Set 1 #

Patch Set 2 : No more subclassing. #

Patch Set 3 : Documentation. #

Patch Set 4 : No more MessageLoopProxy. #

Total comments: 8

Patch Set 5 : Only support swapping after binding to a thread. #

Patch Set 6 : Removed unused forward decl. #

Patch Set 7 : Rebased. #

Patch Set 8 : Fix data race (see https://codereview.chromium.org/1232573002/) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -6 lines) Patch
M base/message_loop/message_loop.h View 1 2 3 4 5 6 7 3 chunks +18 lines, -4 lines 0 comments Download
M base/message_loop/message_loop.cc View 1 2 3 4 5 6 7 4 chunks +24 lines, -2 lines 0 comments Download
M base/message_loop/message_loop_unittest.cc View 1 2 3 4 2 chunks +23 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (8 generated)
Sami
How does this approach look? I think I still want to eradicate ML::PostTask before going ...
5 years, 9 months ago (2015-03-13 17:51:04 UTC) #2
jam
On 2015/03/13 17:51:04, Sami wrote: > How does this approach look? I think I still ...
5 years, 9 months ago (2015-03-13 18:07:52 UTC) #3
Sami
On 2015/03/13 18:07:52, jam wrote: > On 2015/03/13 17:51:04, Sami wrote: > > How does ...
5 years, 9 months ago (2015-03-13 18:13:15 UTC) #4
jam
On 2015/03/13 18:13:15, Sami wrote: > On 2015/03/13 18:07:52, jam wrote: > > On 2015/03/13 ...
5 years, 9 months ago (2015-03-13 21:31:05 UTC) #5
Sami
*pops stack* I've now updated this to a post-MLP world. I'm now adding a setter ...
5 years, 6 months ago (2015-06-19 21:06:00 UTC) #8
Sami
https://codereview.chromium.org/998063002/diff/60001/base/message_loop/message_loop.h File base/message_loop/message_loop.h (left): https://codereview.chromium.org/998063002/diff/60001/base/message_loop/message_loop.h#oldcode300 base/message_loop/message_loop.h:300: // once the internal type matches what is being ...
5 years, 6 months ago (2015-06-19 21:17:35 UTC) #9
alexclarke
https://codereview.chromium.org/998063002/diff/60001/base/message_loop/message_loop.h File base/message_loop/message_loop.h (left): https://codereview.chromium.org/998063002/diff/60001/base/message_loop/message_loop.h#oldcode300 base/message_loop/message_loop.h:300: // once the internal type matches what is being ...
5 years, 6 months ago (2015-06-24 10:27:04 UTC) #11
kinuko
Looks a lot nicer (than the original one) to me =D Made some minor comments. ...
5 years, 6 months ago (2015-06-25 05:58:09 UTC) #13
alexclarke
Thanks for the comments Kinuko. Sami is away on vacation so I'll be taking on ...
5 years, 6 months ago (2015-06-25 09:36:51 UTC) #14
kinuko
https://codereview.chromium.org/998063002/diff/60001/base/message_loop/message_loop.h File base/message_loop/message_loop.h (right): https://codereview.chromium.org/998063002/diff/60001/base/message_loop/message_loop.h#newcode429 base/message_loop/message_loop.h:429: MessagePumpFactoryCallback pump_factory); On 2015/06/25 09:36:51, alexclarke wrote: > On ...
5 years, 6 months ago (2015-06-25 14:31:12 UTC) #15
Sami
Thanks for all the comments in https://codereview.chromium.org/1206893003/! I'll respond to the relevant ones here: >On ...
5 years, 5 months ago (2015-07-07 13:21:33 UTC) #16
danakj
LGTM
5 years, 5 months ago (2015-07-07 21:11:13 UTC) #17
kinuko
This looks neat, lgtm/2!
5 years, 5 months ago (2015-07-08 02:22:33 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/998063002/120001
5 years, 5 months ago (2015-07-08 10:01:41 UTC) #20
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 5 months ago (2015-07-08 10:47:12 UTC) #21
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/698e77997894bf823c45ad1d6e0764fa93e2f3c1 Cr-Commit-Position: refs/heads/master@{#337799}
5 years, 5 months ago (2015-07-08 10:48:06 UTC) #22
Alexander Potapenko
A revert of this CL (patchset #7 id:120001) has been created in https://codereview.chromium.org/1223193004/ by glider@chromium.org. ...
5 years, 5 months ago (2015-07-13 09:10:21 UTC) #23
Sami
Relanding with a fix for the data race (reviewed in https://codereview.chromium.org/1232573002/). I've tested locally that ...
5 years, 5 months ago (2015-07-13 18:42:09 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/998063002/140001
5 years, 5 months ago (2015-07-13 18:44:15 UTC) #27
commit-bot: I haz the power
Committed patchset #8 (id:140001)
5 years, 5 months ago (2015-07-13 21:41:25 UTC) #28
commit-bot: I haz the power
5 years, 5 months ago (2015-07-13 21:42:29 UTC) #29
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/85f43a3185f38eb89c63ad108fd1b73000e0ac56
Cr-Commit-Position: refs/heads/master@{#338564}

Powered by Google App Engine
This is Rietveld 408576698