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

Issue 485043003: cc: Use correct message loop proxy in BlockingTaskRunner (Closed)

Created:
6 years, 4 months ago by Sami
Modified:
6 years, 3 months ago
Reviewers:
danakj, jamesr, piman
CC:
chromium-reviews, cc-bugs_chromium.org
Project:
chromium
Visibility:
Public.

Description

cc: Use correct message loop proxy in BlockingTaskRunner The compositor makes it possible to customize the message loop proxy both on the main and impl threads. However BlockingTaskRunner just uses base::MessageLoopProxy::current() directly and thus overrides this choice. Using the correct message loop proxy is important because clients of BlockingTaskRunner have an implicit dependency on the ordering of tasks posted to BlockingTaskRunner vs. all other tasks posted to the task runner for that same thread. This patch fixes the problem by removing the thread-local BlockingTaskRunner::current() instance in favor of an explicitly constructed instance which is given a specific SingleThreadTaskRunner to use. The resource provider is changed to pass a Proxy-owned blocking task runner to the clients which need one. BUG=391005 TEST=1. Apply https://codereview.chromium.org/363383002 2. out/Debug/chrome --disable-impl-side-painting --ignore-gpu-blacklist tools/perf/page_sets/tough_scheduling_cases/raf_canvas.html Committed: https://crrev.com/3976a3f8509145051ff2865ccba0fffe79fe32e6 Cr-Commit-Position: refs/heads/master@{#293353}

Patch Set 1 #

Patch Set 2 : Cleanup and tests. #

Patch Set 3 : Fix tests. #

Total comments: 2

Patch Set 4 : Rebased. #

Patch Set 5 : WIP with some test failures. #

Patch Set 6 : Fixed tests. #

Patch Set 7 : Rebased. #

Patch Set 8 : Update BUILD.gn and fixed win build. #

Patch Set 9 : Help gn deal with it. #

Total comments: 23

Patch Set 10 : Comments. #

Total comments: 15

Patch Set 11 : Rebased. #

Patch Set 12 : thread_id_ is back + other comments. #

Total comments: 4

Patch Set 13 : Nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+972 lines, -402 lines) Patch
M cc/BUILD.gn View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -0 lines 0 comments Download
M cc/cc.gyp View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M cc/cc_tests.gyp View 1 2 3 5 6 1 chunk +1 line, -0 lines 0 comments Download
M cc/layers/delegated_frame_resource_collection.h View 1 2 3 4 2 chunks +0 lines, -2 lines 0 comments Download
M cc/layers/delegated_frame_resource_collection.cc View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -6 lines 0 comments Download
M cc/layers/delegated_frame_resource_collection_unittest.cc View 1 2 3 4 5 6 7 8 9 5 chunks +10 lines, -4 lines 0 comments Download
M cc/layers/delegated_renderer_layer.h View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M cc/layers/delegated_renderer_layer.cc View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M cc/layers/texture_layer.h View 1 2 3 4 5 6 7 8 9 5 chunks +8 lines, -5 lines 0 comments Download
M cc/layers/texture_layer.cc View 1 2 3 4 5 6 7 8 9 6 chunks +14 lines, -11 lines 0 comments Download
M cc/layers/texture_layer_impl.h View 1 2 3 4 5 6 3 chunks +5 lines, -4 lines 0 comments Download
M cc/layers/texture_layer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +7 lines, -4 lines 0 comments Download
M cc/layers/texture_layer_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -2 lines 0 comments Download
M cc/layers/texture_layer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 33 chunks +85 lines, -59 lines 0 comments Download
M cc/layers/tiled_layer_unittest.cc View 1 2 3 4 5 6 1 chunk +7 lines, -3 lines 0 comments Download
M cc/layers/video_layer_impl.h View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M cc/layers/video_layer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +7 lines, -4 lines 0 comments Download
M cc/output/gl_renderer_unittest.cc View 1 2 3 4 5 6 14 chunks +109 lines, -34 lines 0 comments Download
M cc/output/overlay_unittest.cc View 1 2 3 4 5 6 7 8 9 5 chunks +16 lines, -10 lines 0 comments Download
M cc/output/renderer_pixeltest.cc View 1 2 3 4 5 6 1 chunk +4 lines, -4 lines 0 comments Download
M cc/output/renderer_unittest.cc View 1 2 3 4 5 6 1 chunk +2 lines, -3 lines 0 comments Download
M cc/output/software_renderer_unittest.cc View 1 2 3 4 5 6 1 chunk +7 lines, -3 lines 0 comments Download
M cc/resources/picture_layer_tiling_perftest.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M cc/resources/picture_layer_tiling_set_unittest.cc View 1 2 3 4 5 1 chunk +8 lines, -2 lines 0 comments Download
M cc/resources/picture_layer_tiling_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M cc/resources/prioritized_resource_unittest.cc View 1 2 3 4 5 1 chunk +7 lines, -3 lines 0 comments Download
M cc/resources/prioritized_tile_set_unittest.cc View 1 2 3 4 5 6 1 chunk +7 lines, -5 lines 0 comments Download
M cc/resources/raster_worker_pool_perftest.cc View 1 2 3 4 5 6 1 chunk +7 lines, -4 lines 0 comments Download
M cc/resources/raster_worker_pool_unittest.cc View 1 2 3 4 5 6 1 chunk +7 lines, -4 lines 0 comments Download
A cc/resources/release_callback_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +20 lines, -0 lines 0 comments Download
M cc/resources/resource_provider.h View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +8 lines, -4 lines 0 comments Download
M cc/resources/resource_provider.cc View 1 2 3 4 5 6 8 chunks +21 lines, -13 lines 0 comments Download
M cc/resources/resource_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 49 chunks +286 lines, -99 lines 0 comments Download
M cc/resources/resource_update_controller_unittest.cc View 1 2 3 4 1 chunk +7 lines, -3 lines 0 comments Download
M cc/resources/return_callback.h View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -1 line 0 comments Download
M cc/resources/scoped_resource_unittest.cc View 1 2 3 4 5 6 4 chunks +32 lines, -8 lines 0 comments Download
A cc/resources/single_release_callback_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +36 lines, -0 lines 0 comments Download
A cc/resources/single_release_callback_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +34 lines, -0 lines 0 comments Download
M cc/resources/tile_manager_unittest.cc View 1 2 3 4 5 6 1 chunk +7 lines, -3 lines 0 comments Download
M cc/resources/video_resource_updater.h View 1 2 3 4 5 6 7 8 9 3 chunks +7 lines, -5 lines 0 comments Download
M cc/resources/video_resource_updater.cc View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -2 lines 0 comments Download
M cc/resources/video_resource_updater_unittest.cc View 1 2 3 4 5 6 2 chunks +9 lines, -3 lines 0 comments Download
M cc/surfaces/display.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -0 lines 0 comments Download
M cc/surfaces/display.cc View 1 2 3 4 5 6 7 8 9 3 chunks +9 lines, -1 line 0 comments Download
M cc/surfaces/surface_aggregator.cc View 1 2 3 4 5 6 7 8 9 3 chunks +9 lines, -2 lines 0 comments Download
M cc/surfaces/surface_aggregator_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M cc/test/fake_delegated_renderer_layer_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -1 line 0 comments Download
M cc/test/pixel_test.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M cc/test/pixel_test.cc View 1 2 3 4 5 6 7 8 9 4 chunks +19 lines, -6 lines 0 comments Download
M cc/test/render_pass_test_common.cc View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -3 lines 0 comments Download
M cc/trees/blocking_task_runner.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +22 lines, -18 lines 0 comments Download
M cc/trees/blocking_task_runner.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +7 lines, -39 lines 0 comments Download
A cc/trees/blocking_task_runner_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +42 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/layer_tree_host_perftest.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_context.cc View 1 2 3 4 5 6 2 chunks +9 lines, -3 lines 0 comments Download
M cc/trees/layer_tree_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/layer_tree_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -0 lines 0 comments Download
M cc/trees/proxy.h View 1 2 3 4 5 6 7 8 9 3 chunks +7 lines, -1 line 0 comments Download
M cc/trees/proxy.cc View 1 2 3 4 2 chunks +7 lines, -1 line 0 comments Download
M cc/trees/single_thread_proxy.cc View 1 2 3 4 5 6 3 chunks +6 lines, -3 lines 0 comments Download
M cc/trees/thread_proxy.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 34 (7 generated)
Sami
skyostil@chromium.org changed reviewers: + danakj@chromium.org
6 years, 3 months ago (2014-08-26 15:15:59 UTC) #1
Sami
PTAL Dana. I considered changing all the clients of BlockingTaskRunner to pass in an explicit ...
6 years, 3 months ago (2014-08-26 15:20:35 UTC) #2
danakj
https://codereview.chromium.org/485043003/diff/40001/cc/trees/blocking_task_runner.h File cc/trees/blocking_task_runner.h (right): https://codereview.chromium.org/485043003/diff/40001/cc/trees/blocking_task_runner.h#newcode75 cc/trees/blocking_task_runner.h:75: // Forward the tasks to a specific task runner ...
6 years, 3 months ago (2014-08-26 15:59:00 UTC) #3
Sami
https://codereview.chromium.org/485043003/diff/40001/cc/trees/blocking_task_runner.h File cc/trees/blocking_task_runner.h (right): https://codereview.chromium.org/485043003/diff/40001/cc/trees/blocking_task_runner.h#newcode75 cc/trees/blocking_task_runner.h:75: // Forward the tasks to a specific task runner ...
6 years, 3 months ago (2014-08-26 16:19:17 UTC) #4
danakj
On 2014/08/26 16:19:17, Sami wrote: > https://codereview.chromium.org/485043003/diff/40001/cc/trees/blocking_task_runner.h > File cc/trees/blocking_task_runner.h (right): > > https://codereview.chromium.org/485043003/diff/40001/cc/trees/blocking_task_runner.h#newcode75 > ...
6 years, 3 months ago (2014-08-26 16:22:40 UTC) #5
danakj
danakj@chromium.org changed reviewers: + jamesr@chromium.org, piman@chromium.org
6 years, 3 months ago (2014-08-26 16:31:54 UTC) #6
danakj
As seen on IRC: https://code.google.com/p/chromium/codesearch#chromium/src/content/renderer/child_frame_compositing_helper.cc&sq=package:chromium&type=cs&l=190&rcl=1408957789 That code uses DelegatedResourceCollection but has only a WebLayer API ...
6 years, 3 months ago (2014-08-26 16:31:54 UTC) #7
danakj
After more discussion on IRC skyostil and I came up with the following: 1. Change ...
6 years, 3 months ago (2014-08-26 16:59:50 UTC) #8
Sami
Thanks for helping figure out the right way to do this Dana. Now did I ...
6 years, 3 months ago (2014-08-28 15:01:44 UTC) #9
danakj
*does the no more current() dance* https://codereview.chromium.org/485043003/diff/160001/cc/layers/texture_layer.cc File cc/layers/texture_layer.cc (left): https://codereview.chromium.org/485043003/diff/160001/cc/layers/texture_layer.cc#oldcode323 cc/layers/texture_layer.cc:323: DCHECK(message_loop_->BelongsToCurrentThread()); can we ...
6 years, 3 months ago (2014-08-28 17:10:47 UTC) #10
Sami
https://codereview.chromium.org/485043003/diff/160001/cc/layers/texture_layer.cc File cc/layers/texture_layer.cc (left): https://codereview.chromium.org/485043003/diff/160001/cc/layers/texture_layer.cc#oldcode323 cc/layers/texture_layer.cc:323: DCHECK(message_loop_->BelongsToCurrentThread()); On 2014/08/28 17:10:46, danakj wrote: > can we ...
6 years, 3 months ago (2014-08-28 18:21:17 UTC) #11
Sami
https://codereview.chromium.org/485043003/diff/160001/cc/trees/blocking_task_runner.cc File cc/trees/blocking_task_runner.cc (right): https://codereview.chromium.org/485043003/diff/160001/cc/trees/blocking_task_runner.cc#newcode31 cc/trees/blocking_task_runner.cc:31: return task_runner_ ? task_runner_->BelongsToCurrentThread() : true; On 2014/08/28 18:21:16, ...
6 years, 3 months ago (2014-08-28 18:24:41 UTC) #12
Sami
Another look Dana? I'll join in on the "no more current" dance as soon as ...
6 years, 3 months ago (2014-09-03 10:32:57 UTC) #13
danakj
https://codereview.chromium.org/485043003/diff/180001/cc/layers/texture_layer.cc File cc/layers/texture_layer.cc (right): https://codereview.chromium.org/485043003/diff/180001/cc/layers/texture_layer.cc#newcode288 cc/layers/texture_layer.cc:288: is_lost_(false) { can you CalledOnValidThread() here, so we show ...
6 years, 3 months ago (2014-09-03 16:09:36 UTC) #14
Sami
Woo, all addressed. https://codereview.chromium.org/485043003/diff/180001/cc/layers/texture_layer.cc File cc/layers/texture_layer.cc (right): https://codereview.chromium.org/485043003/diff/180001/cc/layers/texture_layer.cc#newcode288 cc/layers/texture_layer.cc:288: is_lost_(false) { On 2014/09/03 16:09:36, danakj ...
6 years, 3 months ago (2014-09-03 17:59:13 UTC) #15
piman
LGTM once Dana is happy. This is a great change.
6 years, 3 months ago (2014-09-03 18:55:44 UTC) #16
danakj
LGTM! w/ couple nits https://codereview.chromium.org/485043003/diff/180001/cc/layers/texture_layer.cc File cc/layers/texture_layer.cc (right): https://codereview.chromium.org/485043003/diff/180001/cc/layers/texture_layer.cc#newcode288 cc/layers/texture_layer.cc:288: is_lost_(false) { On 2014/09/03 17:59:12, ...
6 years, 3 months ago (2014-09-03 19:47:42 UTC) #17
Sami
Thanks all! https://codereview.chromium.org/485043003/diff/220001/cc/trees/blocking_task_runner.h File cc/trees/blocking_task_runner.h (right): https://codereview.chromium.org/485043003/diff/220001/cc/trees/blocking_task_runner.h#newcode46 cc/trees/blocking_task_runner.h:46: virtual ~BlockingTaskRunner(); On 2014/09/03 19:47:41, danakj wrote: ...
6 years, 3 months ago (2014-09-04 09:30:47 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/485043003/240001
6 years, 3 months ago (2014-09-04 09:32:23 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: mac_gpu_retina_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/mac_gpu_retina_triggered_tests/builds/43650)
6 years, 3 months ago (2014-09-04 16:27:32 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/485043003/240001
6 years, 3 months ago (2014-09-04 16:29:15 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: linux_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/linux_gpu_triggered_tests/builds/53615) mac_gpu_retina_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/mac_gpu_retina_triggered_tests/builds/43721) mac_gpu_triggered_tests ...
6 years, 3 months ago (2014-09-04 18:02:16 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/485043003/240001
6 years, 3 months ago (2014-09-04 18:08:31 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: win_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu_triggered_tests/builds/47859)
6 years, 3 months ago (2014-09-04 19:36:17 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/485043003/240001
6 years, 3 months ago (2014-09-04 22:05:11 UTC) #32
commit-bot: I haz the power
Committed patchset #13 (id:240001) as c2d572fc808398aeee44342007ff77d13e7fa08f
6 years, 3 months ago (2014-09-04 22:10:23 UTC) #33
commit-bot: I haz the power
6 years, 3 months ago (2014-09-10 03:33:12 UTC) #34
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/3976a3f8509145051ff2865ccba0fffe79fe32e6
Cr-Commit-Position: refs/heads/master@{#293353}

Powered by Google App Engine
This is Rietveld 408576698