OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_RESOURCES_RASTER_WORKER_POOL_DELEGATE_H_ | 5 #ifndef CC_RESOURCES_RASTER_WORKER_POOL_DELEGATE_H_ |
6 #define CC_RESOURCES_RASTER_WORKER_POOL_DELEGATE_H_ | 6 #define CC_RESOURCES_RASTER_WORKER_POOL_DELEGATE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "cc/resources/raster_worker_pool.h" | 10 #include "cc/resources/raster_worker_pool.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 | 13 |
14 class RasterWorkerPoolDelegate : public RasterWorkerPoolClient { | 14 class RasterWorkerPoolDelegate : public RasterWorkerPoolClient { |
15 public: | 15 public: |
16 virtual ~RasterWorkerPoolDelegate(); | 16 virtual ~RasterWorkerPoolDelegate(); |
17 | 17 |
18 static scoped_ptr<RasterWorkerPoolDelegate> Create( | 18 static scoped_ptr<RasterWorkerPoolDelegate> Create( |
19 RasterWorkerPoolClient* client, | 19 RasterWorkerPoolClient* client, |
20 RasterWorkerPool** raster_worker_pools, | 20 RasterWorkerPool** raster_worker_pools, |
21 size_t num_raster_worker_pools); | 21 size_t num_raster_worker_pools); |
22 | 22 |
23 void SetClient(RasterWorkerPoolClient* client); | 23 void SetClient(RasterWorkerPoolClient* client); |
24 void Shutdown(); | 24 void Shutdown(); |
25 void ScheduleTasks(RasterWorkerPool::RasterTask::Queue* raster_queue); | 25 void ScheduleTasks(RasterTaskQueue* raster_queue); |
26 void CheckForCompletedTasks(); | 26 void CheckForCompletedTasks(); |
27 | 27 |
28 // Overriden from RasterWorkerPoolClient: | 28 // Overriden from RasterWorkerPoolClient: |
29 virtual bool ShouldForceTasksRequiredForActivationToComplete() const OVERRIDE; | 29 virtual bool ShouldForceTasksRequiredForActivationToComplete() const OVERRIDE; |
30 virtual void DidFinishRunningTasks() OVERRIDE; | 30 virtual void DidFinishRunningTasks() OVERRIDE; |
31 virtual void DidFinishRunningTasksRequiredForActivation() OVERRIDE; | 31 virtual void DidFinishRunningTasksRequiredForActivation() OVERRIDE; |
32 | 32 |
33 private: | 33 private: |
34 RasterWorkerPoolDelegate(RasterWorkerPoolClient* client, | 34 RasterWorkerPoolDelegate(RasterWorkerPoolClient* client, |
35 RasterWorkerPool** raster_worker_pools, | 35 RasterWorkerPool** raster_worker_pools, |
36 size_t num_raster_worker_pools); | 36 size_t num_raster_worker_pools); |
37 | 37 |
38 RasterWorkerPoolClient* client_; | 38 RasterWorkerPoolClient* client_; |
39 typedef std::vector<RasterWorkerPool*> RasterWorkerPoolVector; | 39 typedef std::vector<RasterWorkerPool*> RasterWorkerPoolVector; |
40 RasterWorkerPoolVector raster_worker_pools_; | 40 RasterWorkerPoolVector raster_worker_pools_; |
41 size_t did_finish_running_tasks_pending_count_; | 41 size_t did_finish_running_tasks_pending_count_; |
42 size_t did_finish_running_tasks_required_for_activation_pending_count_; | 42 size_t did_finish_running_tasks_required_for_activation_pending_count_; |
43 }; | 43 }; |
44 | 44 |
45 } // namespace cc | 45 } // namespace cc |
46 | 46 |
47 #endif // CC_RESOURCES_RASTER_WORKER_POOL_DELEGATE_H_ | 47 #endif // CC_RESOURCES_RASTER_WORKER_POOL_DELEGATE_H_ |
OLD | NEW |