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

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

Issue 2359493002: Prevent redundant DoWorks due to canceled delayed tasks (v2) (Closed)
Patch Set: Added a test and removed some code we probably don't need. Created 4 years, 3 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 const WorkQueue* immediate_work_queue() const { 166 const WorkQueue* immediate_work_queue() const {
167 return main_thread_only().immediate_work_queue.get(); 167 return main_thread_only().immediate_work_queue.get();
168 } 168 }
169 169
170 bool should_report_when_execution_blocked() const { 170 bool should_report_when_execution_blocked() const {
171 return should_report_when_execution_blocked_; 171 return should_report_when_execution_blocked_;
172 } 172 }
173 173
174 // Enqueues any delayed tasks which should be run now on the 174 // Enqueues any delayed tasks which should be run now on the
175 // |delayed_work_queue|. Must be called from the main thread. 175 // |delayed_work_queue|. It also schedules the next wake up with the
176 void MoveReadyDelayedTasksToDelayedWorkQueue(LazyNow* lazy_now); 176 // TimeDomain. Must be called from the main thread.
177 void WakeUpForDelayedWork(LazyNow* lazy_now);
177 178
178 private: 179 private:
179 friend class WorkQueue; 180 friend class WorkQueue;
180 friend class WorkQueueTest; 181 friend class WorkQueueTest;
181 182
182 enum class TaskType { 183 enum class TaskType {
183 NORMAL, 184 NORMAL,
184 NON_NESTABLE, 185 NON_NESTABLE,
185 }; 186 };
186 187
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 const bool should_report_when_execution_blocked_; 297 const bool should_report_when_execution_blocked_;
297 298
298 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl); 299 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl);
299 }; 300 };
300 301
301 } // namespace internal 302 } // namespace internal
302 } // namespace scheduler 303 } // namespace scheduler
303 } // namespace blink 304 } // namespace blink
304 305
305 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ 306 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698