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

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

Issue 2637463002: Add an idle task to periodically sweep canceled delayed tasks (Closed)
Patch Set: Fix issue with tracked_objects::Location spotted by asan Created 3 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_MANAGER_H_ 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_H_
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_H_ 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/atomic_sequence_num.h" 10 #include "base/atomic_sequence_num.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 DCHECK(main_thread_checker_.CalledOnValidThread()); 133 DCHECK(main_thread_checker_.CalledOnValidThread());
134 return currently_executing_task_queue_; 134 return currently_executing_task_queue_;
135 } 135 }
136 136
137 // Return number of pending tasks in task queues. 137 // Return number of pending tasks in task queues.
138 size_t GetNumberOfPendingTasks() const; 138 size_t GetNumberOfPendingTasks() const;
139 139
140 // Returns true if there is a task that could be executed immediately. 140 // Returns true if there is a task that could be executed immediately.
141 bool HasImmediateWorkForTesting() const; 141 bool HasImmediateWorkForTesting() const;
142 142
143 // Removes all canceled delayed tasks.
144 void SweepCanceledDelayedTasks();
145
143 private: 146 private:
144 friend class LazyNow; 147 friend class LazyNow;
145 friend class internal::TaskQueueImpl; 148 friend class internal::TaskQueueImpl;
146 friend class TaskQueueManagerTest; 149 friend class TaskQueueManagerTest;
147 150
148 class DeletionSentinel : public base::RefCounted<DeletionSentinel> { 151 class DeletionSentinel : public base::RefCounted<DeletionSentinel> {
149 private: 152 private:
150 friend class base::RefCounted<DeletionSentinel>; 153 friend class base::RefCounted<DeletionSentinel>;
151 ~DeletionSentinel() {} 154 ~DeletionSentinel() {}
152 }; 155 };
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 scoped_refptr<DeletionSentinel> deletion_sentinel_; 259 scoped_refptr<DeletionSentinel> deletion_sentinel_;
257 base::WeakPtrFactory<TaskQueueManager> weak_factory_; 260 base::WeakPtrFactory<TaskQueueManager> weak_factory_;
258 261
259 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager); 262 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager);
260 }; 263 };
261 264
262 } // namespace scheduler 265 } // namespace scheduler
263 } // namespace blink 266 } // namespace blink
264 267
265 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_ H_ 268 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698