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

Issue 977573002: content: Add an overridable task runner to ChildThreadImpl (Closed)

Created:
5 years, 9 months ago by Sami
Modified:
5 years, 7 months ago
CC:
chromium-reviews, mkwst+moarreviews-renderer_chromium.org, darin-cc_chromium.org, kinuko+watch, mlamouri+watch-content_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

content: Add an overridable task runner to ChildThreadImpl Make it possible to get a task runner for the main thread via ChildThreadImpl::Get()->GetTaskRunner(). This lets the renderer scheduler override the main thread task runner for the message filters which get created by ChildThreadImpl to ensure correct task ordering. This fixes a task ordering issue with WebWorkers. Previously the worker's IPC message filter was configured to post tasks directly to the main message loop. This caused them to run out of order w.r.t. other worker tasks posted through the renderer scheduler. As a result, the http/tests/serviceworker/ready.html layout test started timing out because the notification from worker registration was getting dropped due to an inconsistent internal state. BUG=444764

Patch Set 1 #

Patch Set 2 : Rebased. #

Patch Set 3 : Rebased. #

Total comments: 2

Patch Set 4 : Rebased. #

Total comments: 4

Patch Set 5 : Review comments. #

Patch Set 6 : Test build fix. #

Total comments: 1

Patch Set 7 : Work around MSVC bug. #

Total comments: 7

Patch Set 8 : Explicit tweaks. #

Patch Set 9 : Move GetTaskRunner back to the RenderThread. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+81 lines, -29 lines) Patch
M content/child/child_thread_impl.h View 1 2 3 4 5 6 7 8 5 chunks +11 lines, -0 lines 0 comments Download
M content/child/child_thread_impl.cc View 1 2 3 4 5 6 6 chunks +16 lines, -3 lines 0 comments Download
M content/child/worker_thread_message_filter.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -1 line 0 comments Download
M content/public/child/child_thread.h View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -0 lines 0 comments Download
M content/renderer/in_process_renderer_thread.cc View 2 chunks +4 lines, -1 line 0 comments Download
M content/renderer/render_thread_impl.h View 1 2 3 4 5 6 7 1 chunk +5 lines, -3 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 2 chunks +30 lines, -18 lines 0 comments Download
M content/renderer/render_thread_impl_browsertest.cc View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
M content/renderer/renderer_main.cc View 4 chunks +5 lines, -2 lines 0 comments Download

Messages

Total messages: 51 (18 generated)
Sami
PTAL, depends on https://codereview.chromium.org/974933002/
5 years, 9 months ago (2015-03-03 15:53:12 UTC) #2
rmcilroy
lgtm with one comment for a followon CL (which may or may not be possible) ...
5 years, 9 months ago (2015-03-03 19:57:15 UTC) #3
Sami
Thanks Ross. Daniel, could you check this one too? https://codereview.chromium.org/977573002/diff/40001/content/child/worker_thread_message_filter.cc File content/child/worker_thread_message_filter.cc (left): https://codereview.chromium.org/977573002/diff/40001/content/child/worker_thread_message_filter.cc#oldcode16 content/child/worker_thread_message_filter.cc:16: ...
5 years, 9 months ago (2015-03-04 11:48:18 UTC) #5
no sievers
lgtm https://codereview.chromium.org/977573002/diff/60001/content/child/child_thread_impl.h File content/child/child_thread_impl.h (right): https://codereview.chromium.org/977573002/diff/60001/content/child/child_thread_impl.h#newcode83 content/child/child_thread_impl.h:83: scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override; Is there a way (at ...
5 years, 9 months ago (2015-03-04 19:15:02 UTC) #6
Sami
Thanks! https://codereview.chromium.org/977573002/diff/60001/content/child/child_thread_impl.h File content/child/child_thread_impl.h (right): https://codereview.chromium.org/977573002/diff/60001/content/child/child_thread_impl.h#newcode83 content/child/child_thread_impl.h:83: scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override; On 2015/03/04 19:15:02, sievers wrote: ...
5 years, 9 months ago (2015-03-04 19:39:28 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/977573002/80001
5 years, 9 months ago (2015-03-05 11:37:38 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: android_rel_tests_recipe on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_rel_tests_recipe/builds/8855)
5 years, 9 months ago (2015-03-05 12:40:16 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/977573002/100001
5 years, 9 months ago (2015-03-05 12:53:44 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/32748)
5 years, 9 months ago (2015-03-05 16:41:53 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/977573002/100001
5 years, 9 months ago (2015-03-05 17:18:09 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: win8_chromium_rel on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_rel/builds/61148)
5 years, 9 months ago (2015-03-05 22:06:53 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/977573002/100001
5 years, 9 months ago (2015-03-06 00:39:28 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: win8_chromium_rel on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_rel/builds/61380)
5 years, 9 months ago (2015-03-06 05:53:47 UTC) #25
Sami
https://codereview.chromium.org/977573002/diff/100001/content/child/child_thread_impl.cc File content/child/child_thread_impl.cc (right): https://codereview.chromium.org/977573002/diff/100001/content/child/child_thread_impl.cc#newcode304 content/child/child_thread_impl.cc:304: : ChildThreadImpl(Options::Builder().Build()) { So turns out this was triggering ...
5 years, 9 months ago (2015-03-06 17:01:34 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/977573002/120001
5 years, 9 months ago (2015-03-06 17:02:44 UTC) #29
Ryan Sleevi
https://codereview.chromium.org/977573002/diff/120001/content/renderer/render_thread_impl.h File content/renderer/render_thread_impl.h (right): https://codereview.chromium.org/977573002/diff/120001/content/renderer/render_thread_impl.h#newcode134 content/renderer/render_thread_impl.h:134: RenderThreadImpl(scoped_ptr<RendererScheduler> renderer_scheduler); This should be explicit.
5 years, 9 months ago (2015-03-06 17:55:23 UTC) #32
jabdelmalek
https://codereview.chromium.org/977573002/diff/120001/content/public/child/child_thread.h File content/public/child/child_thread.h (right): https://codereview.chromium.org/977573002/diff/120001/content/public/child/child_thread.h#newcode33 content/public/child/child_thread.h:33: // going to the message loop directly. this seems ...
5 years, 9 months ago (2015-03-06 18:06:13 UTC) #34
Sami
https://codereview.chromium.org/977573002/diff/120001/content/renderer/render_thread_impl.h File content/renderer/render_thread_impl.h (right): https://codereview.chromium.org/977573002/diff/120001/content/renderer/render_thread_impl.h#newcode134 content/renderer/render_thread_impl.h:134: RenderThreadImpl(scoped_ptr<RendererScheduler> renderer_scheduler); On 2015/03/06 17:55:23, Ryan Sleevi wrote: > ...
5 years, 9 months ago (2015-03-06 18:08:41 UTC) #35
Sami
https://codereview.chromium.org/977573002/diff/120001/content/public/child/child_thread.h File content/public/child/child_thread.h (right): https://codereview.chromium.org/977573002/diff/120001/content/public/child/child_thread.h#newcode33 content/public/child/child_thread.h:33: // going to the message loop directly. On 2015/03/06 ...
5 years, 9 months ago (2015-03-06 18:41:46 UTC) #36
Ryan Sleevi
https://codereview.chromium.org/977573002/diff/120001/content/public/child/child_thread.h File content/public/child/child_thread.h (right): https://codereview.chromium.org/977573002/diff/120001/content/public/child/child_thread.h#newcode33 content/public/child/child_thread.h:33: // going to the message loop directly. On 2015/03/06 ...
5 years, 9 months ago (2015-03-06 19:00:31 UTC) #37
jam
On 2015/03/06 18:41:46, Sami wrote: > https://codereview.chromium.org/977573002/diff/120001/content/public/child/child_thread.h > File content/public/child/child_thread.h (right): > > https://codereview.chromium.org/977573002/diff/120001/content/public/child/child_thread.h#newcode33 > ...
5 years, 9 months ago (2015-03-06 19:09:01 UTC) #38
no sievers
I think it was obvious that this would be a drawback of making the renderer ...
5 years, 9 months ago (2015-03-06 19:24:21 UTC) #39
Sami
On 2015/03/06 19:00:31, Ryan Sleevi wrote: > https://codereview.chromium.org/977573002/diff/120001/content/public/child/child_thread.h > File content/public/child/child_thread.h (right): > > https://codereview.chromium.org/977573002/diff/120001/content/public/child/child_thread.h#newcode33 ...
5 years, 9 months ago (2015-03-06 19:47:05 UTC) #40
Sami
On 2015/03/06 19:09:01, jam wrote: > On 2015/03/06 18:41:46, Sami wrote: > > > https://codereview.chromium.org/977573002/diff/120001/content/public/child/child_thread.h ...
5 years, 9 months ago (2015-03-06 19:59:29 UTC) #41
Sami
What do people feel about landing this patch now and iterating on a more general ...
5 years, 9 months ago (2015-03-06 20:26:33 UTC) #42
no sievers
I'm not sure that we even need to enforce changing any usage patterns or semantics ...
5 years, 9 months ago (2015-03-06 20:29:46 UTC) #43
jabdelmalek
On 2015/03/06 20:26:33, Sami wrote: > What do people feel about landing this patch now ...
5 years, 9 months ago (2015-03-06 20:42:35 UTC) #44
Sami
On 2015/03/06 20:42:35, jabdelmalek wrote: > On 2015/03/06 20:26:33, Sami wrote: > > What do ...
5 years, 9 months ago (2015-03-06 20:55:13 UTC) #45
jabdelmalek
On 2015/03/06 20:55:13, Sami wrote: > On 2015/03/06 20:42:35, jabdelmalek wrote: > > On 2015/03/06 ...
5 years, 9 months ago (2015-03-06 21:42:40 UTC) #46
kinuko
This just caught my attention... not meant to stir up more, but have a meta ...
5 years, 9 months ago (2015-03-08 11:11:24 UTC) #47
Sami
On 2015/03/08 11:11:24, kinuko wrote: > This just caught my attention... not meant to stir ...
5 years, 9 months ago (2015-03-09 15:29:28 UTC) #48
Sami
On 2015/03/06 21:42:40, jabdelmalek wrote: > Yep I understand that. Perhaps my concern wasn't clear. ...
5 years, 9 months ago (2015-03-09 17:08:49 UTC) #49
Sami
5 years, 9 months ago (2015-03-10 18:44:24 UTC) #51
Here's a design doc with a proposal to make using the wrong task runner
impossible:
https://docs.google.com/a/chromium.org/document/d/1qxdh2I61_aB_Uzh1QgNqvdWFBC...

With this approach we wouldn't need to chance any task posting practices for any
code running in the renderer. All comments welcome!

Powered by Google App Engine
This is Rietveld 408576698