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 #ifndef CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ |
6 #define CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ | 6 #define CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 void SetQueuePriority(QueuePriority priority) override; | 98 void SetQueuePriority(QueuePriority priority) override; |
99 QueuePriority GetQueuePriority() const override; | 99 QueuePriority GetQueuePriority() const override; |
100 void PumpQueue(bool may_post_dowork) override; | 100 void PumpQueue(bool may_post_dowork) override; |
101 void SetPumpPolicy(PumpPolicy pump_policy) override; | 101 void SetPumpPolicy(PumpPolicy pump_policy) override; |
102 PumpPolicy GetPumpPolicy() const override; | 102 PumpPolicy GetPumpPolicy() const override; |
103 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override; | 103 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override; |
104 void RemoveTaskObserver( | 104 void RemoveTaskObserver( |
105 base::MessageLoop::TaskObserver* task_observer) override; | 105 base::MessageLoop::TaskObserver* task_observer) override; |
106 void SetTimeDomain(TimeDomain* time_domain) override; | 106 void SetTimeDomain(TimeDomain* time_domain) override; |
107 TimeDomain* GetTimeDomain() const override; | 107 TimeDomain* GetTimeDomain() const override; |
| 108 void SetBlameContext(base::trace_event::BlameContext* blame_context) override; |
108 | 109 |
109 void UpdateImmediateWorkQueue(bool should_trigger_wakeup, | 110 void UpdateImmediateWorkQueue(bool should_trigger_wakeup, |
110 const Task* previous_task); | 111 const Task* previous_task); |
111 void UpdateDelayedWorkQueue(LazyNow* lazy_now, | 112 void UpdateDelayedWorkQueue(LazyNow* lazy_now, |
112 bool should_trigger_wakeup, | 113 bool should_trigger_wakeup, |
113 const Task* previous_task); | 114 const Task* previous_task); |
114 | 115 |
115 WakeupPolicy wakeup_policy() const { | 116 WakeupPolicy wakeup_policy() const { |
116 DCHECK(main_thread_checker_.CalledOnValidThread()); | 117 DCHECK(main_thread_checker_.CalledOnValidThread()); |
117 return wakeup_policy_; | 118 return wakeup_policy_; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 TaskQueueManager* task_queue_manager; | 197 TaskQueueManager* task_queue_manager; |
197 PumpPolicy pump_policy; | 198 PumpPolicy pump_policy; |
198 TimeDomain* time_domain; | 199 TimeDomain* time_domain; |
199 | 200 |
200 scoped_ptr<WorkQueue> delayed_work_queue; | 201 scoped_ptr<WorkQueue> delayed_work_queue; |
201 scoped_ptr<WorkQueue> immediate_work_queue; | 202 scoped_ptr<WorkQueue> immediate_work_queue; |
202 std::priority_queue<Task> delayed_incoming_queue; | 203 std::priority_queue<Task> delayed_incoming_queue; |
203 base::ObserverList<base::MessageLoop::TaskObserver> task_observers; | 204 base::ObserverList<base::MessageLoop::TaskObserver> task_observers; |
204 size_t set_index; | 205 size_t set_index; |
205 bool is_enabled; | 206 bool is_enabled; |
| 207 base::trace_event::BlameContext* blame_context; // Not owned. |
206 }; | 208 }; |
207 | 209 |
208 ~TaskQueueImpl() override; | 210 ~TaskQueueImpl() override; |
209 | 211 |
210 bool PostImmediateTaskImpl(const tracked_objects::Location& from_here, | 212 bool PostImmediateTaskImpl(const tracked_objects::Location& from_here, |
211 const base::Closure& task, | 213 const base::Closure& task, |
212 TaskType task_type); | 214 TaskType task_type); |
213 bool PostDelayedTaskImpl(const tracked_objects::Location& from_here, | 215 bool PostDelayedTaskImpl(const tracked_objects::Location& from_here, |
214 const base::Closure& task, | 216 const base::Closure& task, |
215 base::TimeDelta delay, | 217 base::TimeDelta delay, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 const bool should_notify_observers_; | 299 const bool should_notify_observers_; |
298 const bool should_report_when_execution_blocked_; | 300 const bool should_report_when_execution_blocked_; |
299 | 301 |
300 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl); | 302 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl); |
301 }; | 303 }; |
302 | 304 |
303 } // namespace internal | 305 } // namespace internal |
304 } // namespace scheduler | 306 } // namespace scheduler |
305 | 307 |
306 #endif // CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ | 308 #endif // CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ |
OLD | NEW |