| 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_CATEGORIZED_WORKER_POOL_H_ | 5 #ifndef CONTENT_RENDERER_CATEGORIZED_WORKER_POOL_H_ |
| 6 #define CONTENT_RENDERER_CATEGORIZED_WORKER_POOL_H_ | 6 #define CONTENT_RENDERER_CATEGORIZED_WORKER_POOL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // in parallel with other instances of sequenced task runners. | 31 // in parallel with other instances of sequenced task runners. |
| 32 class CONTENT_EXPORT CategorizedWorkerPool : public base::TaskRunner, | 32 class CONTENT_EXPORT CategorizedWorkerPool : public base::TaskRunner, |
| 33 public cc::TaskGraphRunner { | 33 public cc::TaskGraphRunner { |
| 34 public: | 34 public: |
| 35 CategorizedWorkerPool(); | 35 CategorizedWorkerPool(); |
| 36 | 36 |
| 37 // Overridden from base::TaskRunner: | 37 // Overridden from base::TaskRunner: |
| 38 bool PostDelayedTask(const tracked_objects::Location& from_here, | 38 bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 39 base::OnceClosure task, | 39 base::OnceClosure task, |
| 40 base::TimeDelta delay) override; | 40 base::TimeDelta delay) override; |
| 41 bool RunsTasksOnCurrentThread() const override; | 41 bool RunsTasksInCurrentSequence() const override; |
| 42 | 42 |
| 43 // Overridden from cc::TaskGraphRunner: | 43 // Overridden from cc::TaskGraphRunner: |
| 44 cc::NamespaceToken GenerateNamespaceToken() override; | 44 cc::NamespaceToken GenerateNamespaceToken() override; |
| 45 void ScheduleTasks(cc::NamespaceToken token, cc::TaskGraph* graph) override; | 45 void ScheduleTasks(cc::NamespaceToken token, cc::TaskGraph* graph) override; |
| 46 void WaitForTasksToFinishRunning(cc::NamespaceToken token) override; | 46 void WaitForTasksToFinishRunning(cc::NamespaceToken token) override; |
| 47 void CollectCompletedTasks(cc::NamespaceToken token, | 47 void CollectCompletedTasks(cc::NamespaceToken token, |
| 48 cc::Task::Vector* completed_tasks) override; | 48 cc::Task::Vector* completed_tasks) override; |
| 49 | 49 |
| 50 // Runs a task from one of the provided categories. Categories listed first | 50 // Runs a task from one of the provided categories. Categories listed first |
| 51 // have higher priority. | 51 // have higher priority. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // Condition variable that is waited on by origin threads until a namespace | 143 // Condition variable that is waited on by origin threads until a namespace |
| 144 // has finished running all associated tasks. | 144 // has finished running all associated tasks. |
| 145 base::ConditionVariable has_namespaces_with_finished_running_tasks_cv_; | 145 base::ConditionVariable has_namespaces_with_finished_running_tasks_cv_; |
| 146 // Set during shutdown. Tells Run() to return when no more tasks are pending. | 146 // Set during shutdown. Tells Run() to return when no more tasks are pending. |
| 147 bool shutdown_; | 147 bool shutdown_; |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 } // namespace content | 150 } // namespace content |
| 151 | 151 |
| 152 #endif // CONTENT_RENDERER_CATEGORIZED_WORKER_POOL_H_ | 152 #endif // CONTENT_RENDERER_CATEGORIZED_WORKER_POOL_H_ |
| OLD | NEW |