Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(889)

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h

Issue 2915993003: Revert of [scheduler] Change TaskQueue observer call mechanism. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 fc20922acf9f2f25d30d021e42658bce175fb55a..dc36b1c12446eed6579e10f9a21292c8b21031a4 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 @@
bool IsQueueEnabled() const override;
bool IsEmpty() const override;
size_t GetNumberOfPendingTasks() const override;
- bool HasTaskToRunImmediately() const override;
+ bool HasPendingImmediateWork() const override;
base::Optional<base::TimeTicks> GetNextScheduledWakeUp() override;
void SetQueuePriority(QueuePriority priority) override;
QueuePriority GetQueuePriority() const override;
@@ -177,18 +177,6 @@
void NotifyWillProcessTask(const base::PendingTask& pending_task);
void NotifyDidProcessTask(const base::PendingTask& pending_task);
- // Called by TimeDomain when the wake-up for this queue has changed.
- // There is only one wake-up, new wake-up cancels any previous wake-ups.
- // If |scheduled_time_domain_wake_up| is base::nullopt then the wake-up
- // has been cancelled.
- // Must be called from the main thread.
- void SetScheduledTimeDomainWakeUp(
- base::Optional<base::TimeTicks> scheduled_time_domain_wake_up);
-
- // Check for available tasks in immediate work queues.
- // 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();
}
@@ -214,8 +202,14 @@
// any. Must be called from the main thread.
base::Optional<DelayedWakeUp> WakeUpForDelayedWork(LazyNow* lazy_now);
- base::Optional<base::TimeTicks> scheduled_time_domain_wake_up() const {
+ base::TimeTicks scheduled_time_domain_wake_up() const {
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; }
@@ -291,7 +285,7 @@
int voter_refcount;
base::trace_event::BlameContext* blame_context; // Not owned.
EnqueueOrder current_fence;
- base::Optional<base::TimeTicks> scheduled_time_domain_wake_up;
+ base::TimeTicks scheduled_time_domain_wake_up;
};
~TaskQueueImpl() override;
@@ -353,6 +347,8 @@
// 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_;

Powered by Google App Engine
This is Rietveld 408576698