Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CC_TILES_TILE_TASK_MANAGER_H_ | |
| 6 #define CC_TILES_TILE_TASK_MANAGER_H_ | |
| 7 | |
| 8 #include <stddef.h> | |
| 9 | |
| 10 #include "cc/playback/raster_source.h" | |
|
ericrk
2016/04/25 20:56:08
do we need raster_source.h or raster_buffer.h?
| |
| 11 #include "cc/raster/raster_buffer.h" | |
| 12 #include "cc/raster/task_graph_runner.h" | |
| 13 #include "cc/raster/tile_task.h" | |
| 14 #include "cc/raster/tile_task_worker_pool.h" | |
| 15 | |
| 16 namespace base { | |
| 17 class SequencedTaskRunner; | |
|
ericrk
2016/04/25 20:56:07
nite: remove this forward decl. - it isn't used in
| |
| 18 } | |
| 19 | |
| 20 namespace cc { | |
| 21 // This class provides the wrapper over TaskGraphRunner for scheduling and | |
| 22 // collecting tasks. The client can call CheckForCompletedTasks() at any time to | |
| 23 // process all completed tasks at the moment that have finished running or | |
| 24 // cancelled. | |
| 25 class CC_EXPORT TileTaskManager { | |
|
ericrk
2016/04/25 20:56:08
It's a bit weird that this class provides full imp
prashant.n
2016/04/26 03:18:08
Hmm. There are 3 functions for which testing class
| |
| 26 public: | |
| 27 virtual ~TileTaskManager(); | |
| 28 | |
| 29 static std::unique_ptr<TileTaskManager> Create( | |
| 30 std::unique_ptr<TileTaskWorkerPool> tile_task_worker_pool, | |
| 31 TaskGraphRunner* task_graph_runner); | |
| 32 | |
| 33 // Schedule running of tile tasks in |graph| and all dependencies. | |
| 34 // Previously scheduled tasks that are not in |graph| will be canceled unless | |
| 35 // already running. Once scheduled, reply callbacks are guaranteed to run for | |
| 36 // all tasks even if they later get canceled by another call to | |
| 37 // ScheduleTasks(). | |
| 38 virtual void ScheduleTasks(TaskGraph* graph); | |
| 39 | |
| 40 // Check for completed tasks and dispatch reply callbacks. | |
| 41 virtual void CheckForCompletedTasks(); | |
| 42 | |
| 43 // Shutdown after canceling all previously scheduled tasks. Reply callbacks | |
| 44 // are still guaranteed to run when CheckForCompletedTasks() is called. | |
| 45 virtual void Shutdown(); | |
| 46 | |
| 47 // Get TileTaskWorkerPool. | |
| 48 virtual TileTaskWorkerPool* GetTileTaskWorkerPool() const; | |
| 49 | |
| 50 protected: | |
| 51 TileTaskManager(std::unique_ptr<TileTaskWorkerPool> tile_task_worker_pool, | |
| 52 TaskGraphRunner* task_graph_runner); | |
| 53 | |
| 54 // For testing. | |
| 55 explicit TileTaskManager( | |
| 56 std::unique_ptr<TileTaskWorkerPool> tile_task_worker_pool); | |
| 57 | |
| 58 std::unique_ptr<TileTaskWorkerPool> tile_task_worker_pool_; | |
| 59 TaskGraphRunner* task_graph_runner_; | |
| 60 const NamespaceToken namespace_token_; | |
| 61 Task::Vector completed_tasks_; | |
| 62 | |
| 63 private: | |
| 64 DISALLOW_COPY_AND_ASSIGN(TileTaskManager); | |
| 65 }; | |
| 66 | |
| 67 } // namespace cc | |
| 68 | |
| 69 #endif // CC_TILES_TILE_TASK_MANAGER_H_ | |
| OLD | NEW |