Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: cc/test/task_graph_runner_test_template.cc

Issue 1866043006: cc: Remove ScheduleOnOriginThread() and CompleteOnOriginThread(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/test/task_graph_runner_test_template.h" 5 #include "cc/test/task_graph_runner_test_template.h"
6 6
7 namespace cc { 7 namespace cc {
8 8
9 const int TaskGraphRunnerTestBase::kNamespaceCount; 9 const int TaskGraphRunnerTestBase::kNamespaceCount;
10 10
(...skipping 11 matching lines...) Expand all
22 task_graph_runner_->WaitForTasksToFinishRunning( 22 task_graph_runner_->WaitForTasksToFinishRunning(
23 namespace_token_[namespace_index]); 23 namespace_token_[namespace_index]);
24 24
25 Task::Vector completed_tasks; 25 Task::Vector completed_tasks;
26 task_graph_runner_->CollectCompletedTasks(namespace_token_[namespace_index], 26 task_graph_runner_->CollectCompletedTasks(namespace_token_[namespace_index],
27 &completed_tasks); 27 &completed_tasks);
28 for (Task::Vector::const_iterator it = completed_tasks.begin(); 28 for (Task::Vector::const_iterator it = completed_tasks.begin();
29 it != completed_tasks.end(); ++it) { 29 it != completed_tasks.end(); ++it) {
30 FakeTaskImpl* task = static_cast<FakeTaskImpl*>(it->get()); 30 FakeTaskImpl* task = static_cast<FakeTaskImpl*>(it->get());
31 task->CompleteOnOriginThread(); 31 task->CompleteOnOriginThread();
32 task->state().DidComplete();
32 } 33 }
33 } 34 }
34 35
35 void TaskGraphRunnerTestBase::RunTaskOnWorkerThread(int namespace_index, 36 void TaskGraphRunnerTestBase::RunTaskOnWorkerThread(int namespace_index,
36 unsigned id) { 37 unsigned id) {
37 base::AutoLock lock(run_task_ids_lock_); 38 base::AutoLock lock(run_task_ids_lock_);
38 run_task_ids_[namespace_index].push_back(id); 39 run_task_ids_[namespace_index].push_back(id);
39 } 40 }
40 41
41 void TaskGraphRunnerTestBase::OnTaskCompleted(int namespace_index, 42 void TaskGraphRunnerTestBase::OnTaskCompleted(int namespace_index,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 91
91 void TaskGraphRunnerTestBase::FakeTaskImpl::RunOnWorkerThread() { 92 void TaskGraphRunnerTestBase::FakeTaskImpl::RunOnWorkerThread() {
92 test_->RunTaskOnWorkerThread(namespace_index_, id_); 93 test_->RunTaskOnWorkerThread(namespace_index_, id_);
93 } 94 }
94 95
95 void TaskGraphRunnerTestBase::FakeTaskImpl::CompleteOnOriginThread() { 96 void TaskGraphRunnerTestBase::FakeTaskImpl::CompleteOnOriginThread() {
96 test_->OnTaskCompleted(namespace_index_, id_); 97 test_->OnTaskCompleted(namespace_index_, id_);
97 } 98 }
98 99
99 } // namespace cc 100 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698