Chromium Code Reviews| Index: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h |
| diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h |
| index 3de8f3bc34b8ba610005798116ccb4758e9de41e..454a05956838ce4a9caea0dd309f1dbb82b3617e 100644 |
| --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h |
| +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h |
| @@ -142,7 +142,7 @@ class PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue { |
| bool IsQueueEnabled() const override; |
| bool IsEmpty() const override; |
| size_t GetNumberOfPendingTasks() const override; |
| - bool HasPendingImmediateWork() const override; |
| + bool HasTaskToRunImmediately() const override; |
| base::Optional<base::TimeTicks> GetNextScheduledWakeUp() override; |
| void SetQueuePriority(QueuePriority priority) override; |
| QueuePriority GetQueuePriority() const override; |
| @@ -177,6 +177,14 @@ class PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue { |
| void NotifyWillProcessTask(const base::PendingTask& pending_task); |
| void NotifyDidProcessTask(const base::PendingTask& pending_task); |
| + void SetScheduledTimeDomainWakeUp( |
|
alex clarke (OOO till 29th)
2017/05/09 12:50:50
Can you please add a brief comment mentioning that
altimin
2017/05/09 13:15:04
Done.
|
| + base::Optional<base::TimeTicks> scheduled_time_domain_wake_up); |
|
alex clarke (OOO till 29th)
2017/05/09 12:50:50
Also please document which threads these two calls
altimin
2017/05/09 13:15:04
Done.
|
| + |
| + // Check for pending immediate work, but do not look in |
|
alex clarke (OOO till 29th)
2017/05/09 11:51:28
s/but do not look in/but does not look in
Also pl
altimin
2017/05/09 13:15:04
Done.
|
| + // delayed_incoming_queue. |
| + // Used to check if we need to generate notifications about delayed work. |
| + bool HasPendingImmediateWork(); |
| + |
| WorkQueue* delayed_work_queue() { |
| return main_thread_only().delayed_work_queue.get(); |
| } |
| @@ -202,16 +210,10 @@ class PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue { |
| // any. Must be called from the main thread. |
| base::Optional<DelayedWakeUp> WakeUpForDelayedWork(LazyNow* lazy_now); |
| - base::TimeTicks scheduled_time_domain_wake_up() const { |
| + base::Optional<base::TimeTicks> scheduled_time_domain_wake_up() const { |
|
alex clarke (OOO till 29th)
2017/05/09 11:51:28
Why do we need to use optional here? What's wrong
altimin
2017/05/09 13:15:04
I prefer explicit base::nullopt to describe "no wa
|
| return main_thread_only().scheduled_time_domain_wake_up; |
| } |
| - void set_scheduled_time_domain_wake_up( |
| - base::TimeTicks scheduled_time_domain_wake_up) { |
| - main_thread_only().scheduled_time_domain_wake_up = |
| - scheduled_time_domain_wake_up; |
| - } |
| - |
| HeapHandle heap_handle() const { return main_thread_only().heap_handle; } |
| void set_heap_handle(HeapHandle heap_handle) { |
| @@ -285,7 +287,7 @@ class PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue { |
| int voter_refcount; |
| base::trace_event::BlameContext* blame_context; // Not owned. |
| EnqueueOrder current_fence; |
| - base::TimeTicks scheduled_time_domain_wake_up; |
| + base::Optional<base::TimeTicks> scheduled_time_domain_wake_up; |
| }; |
| ~TaskQueueImpl() override; |
| @@ -347,8 +349,6 @@ class PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue { |
| // Schedules delayed work on time domain and calls the observer. |
| void ScheduleDelayedWorkInTimeDomain(base::TimeTicks now); |
| - void NotifyWakeUpChangedOnMainThread(base::TimeTicks wake_up); |
| - |
| const base::PlatformThreadId thread_id_; |
| mutable base::Lock any_thread_lock_; |