Chromium Code Reviews| 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 THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ |
| 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 base::TimeDelta delay) override; | 142 base::TimeDelta delay) override; |
| 143 TaskHandle PostCancellableDelayedTask( | 143 TaskHandle PostCancellableDelayedTask( |
| 144 const tracked_objects::Location& from_here, | 144 const tracked_objects::Location& from_here, |
| 145 const base::Closure& task, | 145 const base::Closure& task, |
| 146 base::TimeDelta delay) override; | 146 base::TimeDelta delay) override; |
| 147 bool CancelTask(const TaskHandle& handle) override; | 147 bool CancelTask(const TaskHandle& handle) override; |
| 148 void SetQueueEnabled(bool enabled) override; | 148 void SetQueueEnabled(bool enabled) override; |
| 149 bool IsQueueEnabled() const override; | 149 bool IsQueueEnabled() const override; |
| 150 bool IsEmpty() const override; | 150 bool IsEmpty() const override; |
| 151 bool HasPendingImmediateWork() const override; | 151 bool HasPendingImmediateWork() const override; |
| 152 base::Optional<base::TimeTicks> GetNextScheduledWakeUp() override; | |
| 153 base::Optional<base::TimeTicks> GetNextTaskRunTime() override; | |
|
alex clarke (OOO till 29th)
2016/09/12 17:45:26
I'm fine with adding GetNextScheduledWakeUp but I'
altimin
2016/09/14 11:23:15
I added a comment about this in TaskQueue itself,
| |
| 152 void SetQueuePriority(QueuePriority priority) override; | 154 void SetQueuePriority(QueuePriority priority) override; |
| 153 QueuePriority GetQueuePriority() const override; | 155 QueuePriority GetQueuePriority() const override; |
| 154 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override; | 156 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override; |
| 155 void RemoveTaskObserver( | 157 void RemoveTaskObserver( |
| 156 base::MessageLoop::TaskObserver* task_observer) override; | 158 base::MessageLoop::TaskObserver* task_observer) override; |
| 157 void SetTimeDomain(TimeDomain* time_domain) override; | 159 void SetTimeDomain(TimeDomain* time_domain) override; |
| 158 TimeDomain* GetTimeDomain() const override; | 160 TimeDomain* GetTimeDomain() const override; |
| 159 void SetBlameContext(base::trace_event::BlameContext* blame_context) override; | 161 void SetBlameContext(base::trace_event::BlameContext* blame_context) override; |
| 160 void InsertFence() override; | 162 void InsertFence() override; |
| 161 void RemoveFence() override; | 163 void RemoveFence() override; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 bool BlockedByFenceLocked() const; | 288 bool BlockedByFenceLocked() const; |
| 287 | 289 |
| 288 void TraceQueueSize(bool is_locked) const; | 290 void TraceQueueSize(bool is_locked) const; |
| 289 static void QueueAsValueInto(const ComparatorQueue& queue, | 291 static void QueueAsValueInto(const ComparatorQueue& queue, |
| 290 base::trace_event::TracedValue* state); | 292 base::trace_event::TracedValue* state); |
| 291 static void QueueAsValueInto(const DelayedRunTimeQueue& queue, | 293 static void QueueAsValueInto(const DelayedRunTimeQueue& queue, |
| 292 base::trace_event::TracedValue* state); | 294 base::trace_event::TracedValue* state); |
| 293 static void TaskAsValueInto(const Task& task, | 295 static void TaskAsValueInto(const Task& task, |
| 294 base::trace_event::TracedValue* state); | 296 base::trace_event::TracedValue* state); |
| 295 | 297 |
| 298 // Same as public version, but uses given LazyNow. | |
| 299 bool HasPendingImmediateWork(LazyNow* lazy_now) const; | |
| 300 | |
| 296 const base::PlatformThreadId thread_id_; | 301 const base::PlatformThreadId thread_id_; |
| 297 | 302 |
| 298 mutable base::Lock any_thread_lock_; | 303 mutable base::Lock any_thread_lock_; |
| 299 AnyThread any_thread_; | 304 AnyThread any_thread_; |
| 300 struct AnyThread& any_thread() { | 305 struct AnyThread& any_thread() { |
| 301 any_thread_lock_.AssertAcquired(); | 306 any_thread_lock_.AssertAcquired(); |
| 302 return any_thread_; | 307 return any_thread_; |
| 303 } | 308 } |
| 304 const struct AnyThread& any_thread() const { | 309 const struct AnyThread& any_thread() const { |
| 305 any_thread_lock_.AssertAcquired(); | 310 any_thread_lock_.AssertAcquired(); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 326 const bool should_report_when_execution_blocked_; | 331 const bool should_report_when_execution_blocked_; |
| 327 | 332 |
| 328 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl); | 333 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl); |
| 329 }; | 334 }; |
| 330 | 335 |
| 331 } // namespace internal | 336 } // namespace internal |
| 332 } // namespace scheduler | 337 } // namespace scheduler |
| 333 } // namespace blink | 338 } // namespace blink |
| 334 | 339 |
| 335 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ | 340 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ |
| OLD | NEW |