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

Issue 1854723002: cc: Simplify task and its derived classes. (Closed)

Created:
4 years, 8 months ago by prashant.n
Modified:
4 years, 8 months ago
Reviewers:
esprehn, reveman, vmpstr, ericrk
CC:
blink-worker-reviews_chromium.org, cc-bugs_chromium.org, chromium-reviews, darin-cc_chromium.org, jam, kinuko+watch, mkwst+moarreviews-renderer_chromium.org, 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

cc: Simplify task and its derived classes. This patch merges TileTask, ImageDecodeTask and RasterTask into one class to create a single class capable of handling dependencies, scheduling and completing and is moved to its own file. Now this new task has following functions for doing job by the task. ScheduleOnOriginThread - must be called on origin thread CompleteOnOriginThread - must be called on origin thread RunOnWorkerThread - mab be called origin or worker thread All the implementation classes like RasterTaskImpl, ImageDecodeTaskImpl, etc. are derived directly from Task. The TileTaskClient is renamed to RasterBufferProvider and TileTaskRunner is inherited from it. BUG=599863 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Patch Set 1 #

Total comments: 10

Patch Set 2 : Review comments. #

Patch Set 3 : Rebase. #

Total comments: 2

Patch Set 4 : Review comments. #

Patch Set 5 : Remove unnecessary static cast. #

Total comments: 4

Patch Set 6 : Removed dependency from Task #

Total comments: 1

Patch Set 7 : Corrected scope of dependencies. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+449 lines, -467 lines) Patch
M cc/BUILD.gn View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M cc/cc.gyp View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M cc/raster/bitmap_tile_task_worker_pool.h View 1 2 3 3 chunks +8 lines, -9 lines 0 comments Download
M cc/raster/bitmap_tile_task_worker_pool.cc View 1 2 3 4 3 chunks +3 lines, -4 lines 0 comments Download
M cc/raster/gpu_tile_task_worker_pool.h View 1 2 3 3 chunks +8 lines, -9 lines 0 comments Download
M cc/raster/gpu_tile_task_worker_pool.cc View 1 2 3 3 chunks +4 lines, -7 lines 0 comments Download
M cc/raster/one_copy_tile_task_worker_pool.h View 1 2 3 3 chunks +7 lines, -8 lines 0 comments Download
M cc/raster/one_copy_tile_task_worker_pool.cc View 1 2 3 4 3 chunks +3 lines, -4 lines 0 comments Download
M cc/raster/raster_buffer.h View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
A cc/raster/task.h View 1 2 3 4 5 1 chunk +57 lines, -0 lines 0 comments Download
A cc/raster/task.cc View 1 2 3 4 5 1 chunk +67 lines, -0 lines 0 comments Download
M cc/raster/task_graph_runner.h View 1 2 3 1 chunk +1 line, -26 lines 0 comments Download
M cc/raster/task_graph_runner.cc View 1 chunk +0 lines, -22 lines 0 comments Download
M cc/raster/task_graph_runner_perftest.cc View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M cc/raster/tile_task_runner.h View 1 2 3 2 chunks +4 lines, -64 lines 0 comments Download
M cc/raster/tile_task_runner.cc View 1 chunk +0 lines, -48 lines 0 comments Download
M cc/raster/tile_task_worker_pool.h View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M cc/raster/tile_task_worker_pool.cc View 1 2 3 1 chunk +3 lines, -4 lines 0 comments Download
M cc/raster/tile_task_worker_pool_perftest.cc View 1 2 3 4 5 10 chunks +42 lines, -32 lines 0 comments Download
M cc/raster/tile_task_worker_pool_unittest.cc View 1 2 3 4 5 7 chunks +26 lines, -29 lines 0 comments Download
M cc/raster/zero_copy_tile_task_worker_pool.h View 1 2 3 3 chunks +8 lines, -9 lines 0 comments Download
M cc/raster/zero_copy_tile_task_worker_pool.cc View 1 2 3 4 3 chunks +3 lines, -4 lines 0 comments Download
M cc/test/fake_tile_manager.cc View 1 2 3 2 chunks +17 lines, -19 lines 0 comments Download
M cc/test/task_graph_runner_test_template.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M cc/tiles/gpu_image_decode_controller.h View 1 2 3 2 chunks +2 lines, -3 lines 0 comments Download
M cc/tiles/gpu_image_decode_controller.cc View 1 2 3 5 chunks +7 lines, -10 lines 0 comments Download
M cc/tiles/image_decode_controller.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M cc/tiles/software_image_decode_controller.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M cc/tiles/software_image_decode_controller.cc View 1 2 3 7 chunks +10 lines, -12 lines 0 comments Download
M cc/tiles/software_image_decode_controller_unittest.cc View 1 2 3 26 chunks +45 lines, -45 lines 0 comments Download
M cc/tiles/tile.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M cc/tiles/tile_manager.h View 1 2 3 6 3 chunks +6 lines, -7 lines 0 comments Download
M cc/tiles/tile_manager.cc View 1 2 3 4 5 6 17 chunks +48 lines, -42 lines 1 comment Download
M cc/tiles/tile_manager_perftest.cc View 1 2 3 3 chunks +16 lines, -17 lines 0 comments Download
M cc/tiles/tile_manager_unittest.cc View 1 2 3 6 chunks +23 lines, -24 lines 0 comments Download
M content/renderer/raster_worker_pool.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 37 (10 generated)
prashant.n
ptal.
4 years, 8 months ago (2016-04-01 14:21:31 UTC) #4
prashant.n
https://codereview.chromium.org/1854723002/diff/1/cc/raster/dependency_task.h File cc/raster/dependency_task.h (right): https://codereview.chromium.org/1854723002/diff/1/cc/raster/dependency_task.h#newcode27 cc/raster/dependency_task.h:27: virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster( These methods will be made generic ...
4 years, 8 months ago (2016-04-01 14:23:39 UTC) #5
ericrk
This seems like a reasonable simplification - I do like making dependencies more generic. We ...
4 years, 8 months ago (2016-04-01 21:34:31 UTC) #6
prashant.n
https://codereview.chromium.org/1854723002/diff/1/cc/raster/dependency_task.cc File cc/raster/dependency_task.cc (right): https://codereview.chromium.org/1854723002/diff/1/cc/raster/dependency_task.cc#newcode20 cc/raster/dependency_task.cc:20: dependencies_.swap(*dependencies); On 2016/04/01 21:34:30, ericrk wrote: > Rather than ...
4 years, 8 months ago (2016-04-01 23:48:05 UTC) #7
prashant.n
One more thing I'm thinking of is moving task, task graph runner, tile task runner ...
4 years, 8 months ago (2016-04-01 23:55:05 UTC) #8
prashant.n
ptal.
4 years, 8 months ago (2016-04-04 10:07:46 UTC) #12
prashant.n
Would you pls. take a look at this?
4 years, 8 months ago (2016-04-05 17:29:44 UTC) #13
reveman
One question that I think would make this much easier to review. https://codereview.chromium.org/1854723002/diff/80001/cc/raster/dependency_task.h File cc/raster/dependency_task.h ...
4 years, 8 months ago (2016-04-05 19:14:05 UTC) #14
prashant.n
https://codereview.chromium.org/1854723002/diff/80001/cc/raster/dependency_task.h File cc/raster/dependency_task.h (right): https://codereview.chromium.org/1854723002/diff/80001/cc/raster/dependency_task.h#newcode1 cc/raster/dependency_task.h:1: // Copyright 2016 The Chromium Authors. All rights reserved. ...
4 years, 8 months ago (2016-04-06 00:28:11 UTC) #15
reveman
On 2016/04/06 at 00:28:11, prashant.n wrote: > https://codereview.chromium.org/1854723002/diff/80001/cc/raster/dependency_task.h > File cc/raster/dependency_task.h (right): > > https://codereview.chromium.org/1854723002/diff/80001/cc/raster/dependency_task.h#newcode1 ...
4 years, 8 months ago (2016-04-06 01:17:05 UTC) #16
prashant.n
ptal, esprehn for content/renderer/raster_worker_pool.h and .cc
4 years, 8 months ago (2016-04-06 02:12:14 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1854723002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1854723002/120001
4 years, 8 months ago (2016-04-06 11:03:38 UTC) #21
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: cast_shell_linux on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/140413)
4 years, 8 months ago (2016-04-06 11:33:01 UTC) #23
reveman
I recommend trying to split this into as small pieces as possible. https://codereview.chromium.org/1854723002/diff/120001/cc/raster/task.h File cc/raster/task.h ...
4 years, 8 months ago (2016-04-06 12:18:06 UTC) #24
prashant.n
https://codereview.chromium.org/1854723002/diff/120001/cc/raster/task.h File cc/raster/task.h (right): https://codereview.chromium.org/1854723002/diff/120001/cc/raster/task.h#newcode19 cc/raster/task.h:19: class CC_EXPORT Task : public base::RefCountedThreadSafe<Task> { On 2016/04/06 ...
4 years, 8 months ago (2016-04-06 13:11:50 UTC) #25
prashant.n
> One way I can think of implementing this is Having functionality of schedule and ...
4 years, 8 months ago (2016-04-06 14:19:17 UTC) #26
prashant.n
Once review comment 2 is addressed, I'll modify the description accordingly.
4 years, 8 months ago (2016-04-06 14:29:03 UTC) #27
prashant.n
https://codereview.chromium.org/1854723002/diff/140001/cc/tiles/tile_manager.cc File cc/tiles/tile_manager.cc (right): https://codereview.chromium.org/1854723002/diff/140001/cc/tiles/tile_manager.cc#newcode761 cc/tiles/tile_manager.cc:761: tile->raster_task_ = CreateRasterTask(prioritized_tile, &dependencies); When same tile is rescheduled, ...
4 years, 8 months ago (2016-04-06 14:59:47 UTC) #28
prashant.n
We don't create a new task when same tile is rescheduled again. The dependencies_ member ...
4 years, 8 months ago (2016-04-06 22:07:27 UTC) #29
prashant.n
On 2016/04/06 22:07:27, prashant.n wrote: > We don't create a new task when same tile ...
4 years, 8 months ago (2016-04-07 03:31:37 UTC) #30
prashant.n
https://codereview.chromium.org/1854723002/diff/160001/cc/tiles/tile_manager.cc File cc/tiles/tile_manager.cc (right): https://codereview.chromium.org/1854723002/diff/160001/cc/tiles/tile_manager.cc#newcode92 cc/tiles/tile_manager.cc:92: reply_.Run(!HasFinishedRunning()); Due to this, we need to keep scheduling ...
4 years, 8 months ago (2016-04-07 09:22:13 UTC) #31
prashant.n
IMO, current implementation is better. For RasterTaskImpl - ScheduleOnOriginThread() RunOnWorkerThread() CompleteOnOriginThread() then destuctor being called ...
4 years, 8 months ago (2016-04-07 13:00:22 UTC) #32
prashant.n
If we really want to move shedule and complete methods from Task, then in TileTaskRunner ...
4 years, 8 months ago (2016-04-07 13:42:44 UTC) #33
reveman
On 2016/04/06 at 22:07:27, prashant.n wrote: > We don't create a new task when same ...
4 years, 8 months ago (2016-04-07 13:57:30 UTC) #34
prashant.n
> We don't need schedule/complete at all. Those functions are supposed to be Do you ...
4 years, 8 months ago (2016-04-08 00:20:35 UTC) #35
prashant.n
> We don't need schedule/complete at all. Those functions are supposed to be > removed ...
4 years, 8 months ago (2016-04-08 15:20:21 UTC) #36
prashant.n
4 years, 8 months ago (2016-04-14 06:52:59 UTC) #37
I've been submitting this change in small patches by considering dependencies.
So ignore this patch.

Powered by Google App Engine
This is Rietveld 408576698