OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_RENDERER_RASTER_WORKER_POOL_H_ | 5 #ifndef CONTENT_RENDERER_RASTER_WORKER_POOL_H_ |
6 #define CONTENT_RENDERER_RASTER_WORKER_POOL_H_ | 6 #define CONTENT_RENDERER_RASTER_WORKER_POOL_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Create a new sequenced task graph runner. | 67 // Create a new sequenced task graph runner. |
68 scoped_refptr<base::SequencedTaskRunner> CreateSequencedTaskRunner(); | 68 scoped_refptr<base::SequencedTaskRunner> CreateSequencedTaskRunner(); |
69 | 69 |
70 protected: | 70 protected: |
71 ~RasterWorkerPool() override; | 71 ~RasterWorkerPool() override; |
72 | 72 |
73 private: | 73 private: |
74 class RasterWorkerPoolSequencedTaskRunner; | 74 class RasterWorkerPoolSequencedTaskRunner; |
75 friend class RasterWorkerPoolSequencedTaskRunner; | 75 friend class RasterWorkerPoolSequencedTaskRunner; |
76 | 76 |
77 // Run next task. Caller must acquire |lock_| prior to calling this function. | 77 // Run next task. Caller must acquire |lock_| prior to calling this function |
78 // Returns true if there was a task available to run. | 78 // and make sure at least one task is ready to run. |
79 bool RunTaskWithLockAcquired(); | 79 void RunTaskWithLockAcquired(); |
80 | 80 |
81 // Simple Task for the TaskGraphRunner that wraps a closure. | 81 // Simple Task for the TaskGraphRunner that wraps a closure. |
82 // This class is used to schedule TaskRunner tasks on the | 82 // This class is used to schedule TaskRunner tasks on the |
83 // |task_graph_runner_|. | 83 // |task_graph_runner_|. |
84 class ClosureTask : public cc::Task { | 84 class ClosureTask : public cc::Task { |
85 public: | 85 public: |
86 explicit ClosureTask(const base::Closure& closure); | 86 explicit ClosureTask(const base::Closure& closure); |
87 | 87 |
88 // Overridden from cc::Task: | 88 // Overridden from cc::Task: |
89 void RunOnWorkerThread() override; | 89 void RunOnWorkerThread() override; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // Condition variable that is waited on by origin threads until a namespace | 125 // Condition variable that is waited on by origin threads until a namespace |
126 // has finished running all associated tasks. | 126 // has finished running all associated tasks. |
127 base::ConditionVariable has_namespaces_with_finished_running_tasks_cv_; | 127 base::ConditionVariable has_namespaces_with_finished_running_tasks_cv_; |
128 // Set during shutdown. Tells Run() to return when no more tasks are pending. | 128 // Set during shutdown. Tells Run() to return when no more tasks are pending. |
129 bool shutdown_; | 129 bool shutdown_; |
130 }; | 130 }; |
131 | 131 |
132 } // namespace content | 132 } // namespace content |
133 | 133 |
134 #endif // CONTENT_RENDERER_RASTER_WORKER_POOL_H_ | 134 #endif // CONTENT_RENDERER_RASTER_WORKER_POOL_H_ |
OLD | NEW |