| 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/synchronous_task_graph_runner.h" | 5 #include "cc/raster/synchronous_task_graph_runner.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/threading/simple_thread.h" | 12 #include "base/threading/simple_thread.h" |
| 13 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
| 14 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
| 15 | 15 |
| 16 namespace cc { | 16 namespace cc { |
| 17 | 17 |
| 18 SynchronousTaskGraphRunner::SynchronousTaskGraphRunner() {} | 18 SynchronousTaskGraphRunner::SynchronousTaskGraphRunner() : work_queue_(this) {} |
| 19 | 19 |
| 20 SynchronousTaskGraphRunner::~SynchronousTaskGraphRunner() { | 20 SynchronousTaskGraphRunner::~SynchronousTaskGraphRunner() { |
| 21 DCHECK(!work_queue_.HasReadyToRunTasks()); | 21 DCHECK(!work_queue_.HasReadyToRunTasks()); |
| 22 } | 22 } |
| 23 | 23 |
| 24 NamespaceToken SynchronousTaskGraphRunner::GetNamespaceToken() { | 24 NamespaceToken SynchronousTaskGraphRunner::GetNamespaceToken() { |
| 25 return work_queue_.GetNamespaceToken(); | 25 return work_queue_.GetNamespaceToken(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void SynchronousTaskGraphRunner::ScheduleTasks(NamespaceToken token, | 28 void SynchronousTaskGraphRunner::ScheduleTasks(NamespaceToken token, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 task->WillRun(); | 88 task->WillRun(); |
| 89 task->RunOnWorkerThread(); | 89 task->RunOnWorkerThread(); |
| 90 task->DidRun(); | 90 task->DidRun(); |
| 91 | 91 |
| 92 work_queue_.CompleteTask(prioritized_task); | 92 work_queue_.CompleteTask(prioritized_task); |
| 93 | 93 |
| 94 return true; | 94 return true; |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace cc | 97 } // namespace cc |
| OLD | NEW |