| 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 #include "cc/raster/single_thread_task_graph_runner.h" | 5 #include "cc/raster/single_thread_task_graph_runner.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/threading/simple_thread.h" | 11 #include "base/threading/simple_thread.h" |
| 12 #include "base/threading/thread_restrictions.h" | 12 #include "base/threading/thread_restrictions.h" |
| 13 #include "base/trace_event/trace_event.h" | 13 #include "base/trace_event/trace_event.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 | 16 |
| 17 SingleThreadTaskGraphRunner::SingleThreadTaskGraphRunner() | 17 SingleThreadTaskGraphRunner::SingleThreadTaskGraphRunner() |
| 18 : lock_(), | 18 : lock_(), |
| 19 work_queue_(this), |
| 19 has_ready_to_run_tasks_cv_(&lock_), | 20 has_ready_to_run_tasks_cv_(&lock_), |
| 20 has_namespaces_with_finished_running_tasks_cv_(&lock_), | 21 has_namespaces_with_finished_running_tasks_cv_(&lock_), |
| 21 shutdown_(false) {} | 22 shutdown_(false) {} |
| 22 | 23 |
| 23 SingleThreadTaskGraphRunner::~SingleThreadTaskGraphRunner() {} | 24 SingleThreadTaskGraphRunner::~SingleThreadTaskGraphRunner() {} |
| 24 | 25 |
| 25 void SingleThreadTaskGraphRunner::Start( | 26 void SingleThreadTaskGraphRunner::Start( |
| 26 const std::string& thread_name, | 27 const std::string& thread_name, |
| 27 const base::SimpleThread::Options& thread_options) { | 28 const base::SimpleThread::Options& thread_options) { |
| 28 thread_.reset( | 29 thread_.reset( |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 164 |
| 164 // If namespace has finished running all tasks, wake up origin thread. | 165 // If namespace has finished running all tasks, wake up origin thread. |
| 165 if (work_queue_.HasFinishedRunningTasksInNamespace( | 166 if (work_queue_.HasFinishedRunningTasksInNamespace( |
| 166 prioritized_task.task_namespace)) | 167 prioritized_task.task_namespace)) |
| 167 has_namespaces_with_finished_running_tasks_cv_.Signal(); | 168 has_namespaces_with_finished_running_tasks_cv_.Signal(); |
| 168 | 169 |
| 169 return true; | 170 return true; |
| 170 } | 171 } |
| 171 | 172 |
| 172 } // namespace cc | 173 } // namespace cc |
| OLD | NEW |