| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/renderer/scheduler/task_queue_manager.h" | 5 #include "content/renderer/scheduler/task_queue_manager.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 return false; | 130 return false; |
| 131 | 131 |
| 132 base::PendingTask pending_task(from_here, task, base::TimeTicks(), | 132 base::PendingTask pending_task(from_here, task, base::TimeTicks(), |
| 133 task_type != NON_NESTABLE_TASK_TYPE); | 133 task_type != NON_NESTABLE_TASK_TYPE); |
| 134 task_queue_manager_->DidQueueTask(&pending_task); | 134 task_queue_manager_->DidQueueTask(&pending_task); |
| 135 | 135 |
| 136 if (delay > base::TimeDelta()) { | 136 if (delay > base::TimeDelta()) { |
| 137 pending_task.delayed_run_time = task_queue_manager_->Now() + delay; | 137 pending_task.delayed_run_time = task_queue_manager_->Now() + delay; |
| 138 delayed_task_run_times_.push(pending_task.delayed_run_time); | 138 delayed_task_run_times_.push(pending_task.delayed_run_time); |
| 139 return task_queue_manager_->PostDelayedTask( | 139 return task_queue_manager_->PostDelayedTask( |
| 140 from_here, Bind(&TaskQueue::EnqueueTask, this, pending_task), delay); | 140 FROM_HERE, Bind(&TaskQueue::EnqueueTask, this, pending_task), delay); |
| 141 } | 141 } |
| 142 EnqueueTaskLocked(pending_task); | 142 EnqueueTaskLocked(pending_task); |
| 143 return true; | 143 return true; |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool TaskQueue::IsQueueEmpty() const { | 146 bool TaskQueue::IsQueueEmpty() const { |
| 147 if (!work_queue_.empty()) | 147 if (!work_queue_.empty()) |
| 148 return false; | 148 return false; |
| 149 | 149 |
| 150 { | 150 { |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 state->EndArray(); | 552 state->EndArray(); |
| 553 state->BeginDictionary("selector"); | 553 state->BeginDictionary("selector"); |
| 554 selector_->AsValueInto(state.get()); | 554 selector_->AsValueInto(state.get()); |
| 555 state->EndDictionary(); | 555 state->EndDictionary(); |
| 556 if (should_run) | 556 if (should_run) |
| 557 state->SetInteger("selected_queue", selected_queue); | 557 state->SetInteger("selected_queue", selected_queue); |
| 558 return state; | 558 return state; |
| 559 } | 559 } |
| 560 | 560 |
| 561 } // namespace content | 561 } // namespace content |
| OLD | NEW |