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

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

Issue 2718293003: scheduler: Ensure consistent delayed task ordering between task queues (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 const WorkQueue* immediate_work_queue() const { 171 const WorkQueue* immediate_work_queue() const {
172 return main_thread_only().immediate_work_queue.get(); 172 return main_thread_only().immediate_work_queue.get();
173 } 173 }
174 174
175 bool should_report_when_execution_blocked() const { 175 bool should_report_when_execution_blocked() const {
176 return should_report_when_execution_blocked_; 176 return should_report_when_execution_blocked_;
177 } 177 }
178 178
179 // Enqueues any delayed tasks which should be run now on the 179 // Enqueues any delayed tasks which should be run now on the
180 // |delayed_work_queue|. Returns the deadline if a subsequent wakeup is 180 // |delayed_work_queue|. Returns true and fills |out_next_wake_up_time| and
181 // required. Must be called from the main thread. 181 // |out_next_wake_up_sequence_num| if a subsequent wakeup is required. Must be
182 base::Optional<base::TimeTicks> WakeUpForDelayedWork(LazyNow* lazy_now); 182 // called from the main thread.
183 bool WakeUpForDelayedWork(LazyNow* lazy_now,
184 base::TimeTicks* out_next_wake_up_time,
altimin 2017/03/01 11:23:17 Nit: time ticks and sequence number seem related.
Sami 2017/03/01 12:17:42 The other option I considered was to just return a
185 int* out_next_wake_up_sequence_num);
183 186
184 base::TimeTicks scheduled_time_domain_wakeup() const { 187 base::TimeTicks scheduled_time_domain_wakeup() const {
185 return main_thread_only().scheduled_time_domain_wakeup; 188 return main_thread_only().scheduled_time_domain_wakeup;
186 } 189 }
187 190
188 void set_scheduled_time_domain_wakeup( 191 void set_scheduled_time_domain_wakeup(
189 base::TimeTicks scheduled_time_domain_wakeup) { 192 base::TimeTicks scheduled_time_domain_wakeup) {
190 main_thread_only().scheduled_time_domain_wakeup = 193 main_thread_only().scheduled_time_domain_wakeup =
191 scheduled_time_domain_wakeup; 194 scheduled_time_domain_wakeup;
192 } 195 }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 const bool should_report_when_execution_blocked_; 352 const bool should_report_when_execution_blocked_;
350 353
351 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl); 354 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl);
352 }; 355 };
353 356
354 } // namespace internal 357 } // namespace internal
355 } // namespace scheduler 358 } // namespace scheduler
356 } // namespace blink 359 } // namespace blink
357 360
358 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ 361 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698