| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/task_scheduler/scheduler_worker_thread.h" | 5 #include "base/task_scheduler/scheduler_worker_thread.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 return nullptr; | 118 return nullptr; |
| 119 --outer_->num_sequences_to_create_; | 119 --outer_->num_sequences_to_create_; |
| 120 } | 120 } |
| 121 | 121 |
| 122 // Create a Sequence with TasksPerSequence() Tasks. | 122 // Create a Sequence with TasksPerSequence() Tasks. |
| 123 scoped_refptr<Sequence> sequence(new Sequence); | 123 scoped_refptr<Sequence> sequence(new Sequence); |
| 124 for (size_t i = 0; i < outer_->TasksPerSequence(); ++i) { | 124 for (size_t i = 0; i < outer_->TasksPerSequence(); ++i) { |
| 125 std::unique_ptr<Task> task(new Task( | 125 std::unique_ptr<Task> task(new Task( |
| 126 FROM_HERE, Bind(&TaskSchedulerWorkerThreadTest::RunTaskCallback, | 126 FROM_HERE, Bind(&TaskSchedulerWorkerThreadTest::RunTaskCallback, |
| 127 Unretained(outer_)), | 127 Unretained(outer_)), |
| 128 TaskTraits(), TimeTicks())); | 128 TaskTraits(), TimeDelta())); |
| 129 EXPECT_TRUE(outer_->task_tracker_.WillPostTask(task.get())); | 129 EXPECT_TRUE(outer_->task_tracker_.WillPostTask(task.get())); |
| 130 sequence->PushTask(std::move(task)); | 130 sequence->PushTask(std::move(task)); |
| 131 } | 131 } |
| 132 | 132 |
| 133 { | 133 { |
| 134 // Add the Sequence to the vector of created Sequences. | 134 // Add the Sequence to the vector of created Sequences. |
| 135 AutoSchedulerLock auto_lock(outer_->lock_); | 135 AutoSchedulerLock auto_lock(outer_->lock_); |
| 136 outer_->created_sequences_.push_back(sequence); | 136 outer_->created_sequences_.push_back(sequence); |
| 137 } | 137 } |
| 138 | 138 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 INSTANTIATE_TEST_CASE_P(OneTaskPerSequence, | 267 INSTANTIATE_TEST_CASE_P(OneTaskPerSequence, |
| 268 TaskSchedulerWorkerThreadTest, | 268 TaskSchedulerWorkerThreadTest, |
| 269 ::testing::Values(1)); | 269 ::testing::Values(1)); |
| 270 INSTANTIATE_TEST_CASE_P(TwoTasksPerSequence, | 270 INSTANTIATE_TEST_CASE_P(TwoTasksPerSequence, |
| 271 TaskSchedulerWorkerThreadTest, | 271 TaskSchedulerWorkerThreadTest, |
| 272 ::testing::Values(2)); | 272 ::testing::Values(2)); |
| 273 | 273 |
| 274 } // namespace | 274 } // namespace |
| 275 } // namespace internal | 275 } // namespace internal |
| 276 } // namespace base | 276 } // namespace base |
| OLD | NEW |