| OLD | NEW |
| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 LazyNow CreateLazyNow() const; | 131 LazyNow CreateLazyNow() const; |
| 132 | 132 |
| 133 // Returns the currently executing TaskQueue if any. Must be called on the | 133 // Returns the currently executing TaskQueue if any. Must be called on the |
| 134 // thread this class was created on. | 134 // thread this class was created on. |
| 135 TaskQueue* currently_executing_task_queue() const { | 135 TaskQueue* currently_executing_task_queue() const { |
| 136 DCHECK(main_thread_checker_.CalledOnValidThread()); | 136 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 137 return currently_executing_task_queue_; | 137 return currently_executing_task_queue_; |
| 138 } | 138 } |
| 139 | 139 |
| 140 // Return number of pending tasks in task queues. |
| 141 size_t GetNumberOfPendingTasks() const; |
| 142 |
| 140 private: | 143 private: |
| 141 friend class LazyNow; | 144 friend class LazyNow; |
| 142 friend class internal::TaskQueueImpl; | 145 friend class internal::TaskQueueImpl; |
| 143 friend class TaskQueueManagerTest; | 146 friend class TaskQueueManagerTest; |
| 144 | 147 |
| 145 class DeletionSentinel : public base::RefCounted<DeletionSentinel> { | 148 class DeletionSentinel : public base::RefCounted<DeletionSentinel> { |
| 146 private: | 149 private: |
| 147 friend class base::RefCounted<DeletionSentinel>; | 150 friend class base::RefCounted<DeletionSentinel>; |
| 148 ~DeletionSentinel() {} | 151 ~DeletionSentinel() {} |
| 149 }; | 152 }; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 scoped_refptr<DeletionSentinel> deletion_sentinel_; | 255 scoped_refptr<DeletionSentinel> deletion_sentinel_; |
| 253 base::WeakPtrFactory<TaskQueueManager> weak_factory_; | 256 base::WeakPtrFactory<TaskQueueManager> weak_factory_; |
| 254 | 257 |
| 255 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager); | 258 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager); |
| 256 }; | 259 }; |
| 257 | 260 |
| 258 } // namespace scheduler | 261 } // namespace scheduler |
| 259 } // namespace blink | 262 } // namespace blink |
| 260 | 263 |
| 261 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_
H_ | 264 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_
H_ |
| OLD | NEW |