Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 base::MessageLoop::TaskObserver* task_observer) override; | 133 base::MessageLoop::TaskObserver* task_observer) override; |
| 134 void SetTimeDomain(TimeDomain* time_domain) override; | 134 void SetTimeDomain(TimeDomain* time_domain) override; |
| 135 TimeDomain* GetTimeDomain() const override; | 135 TimeDomain* GetTimeDomain() const override; |
| 136 void SetBlameContext(base::trace_event::BlameContext* blame_context) override; | 136 void SetBlameContext(base::trace_event::BlameContext* blame_context) override; |
| 137 void InsertFence(InsertFencePosition position) override; | 137 void InsertFence(InsertFencePosition position) override; |
| 138 void RemoveFence() override; | 138 void RemoveFence() override; |
| 139 bool BlockedByFence() const override; | 139 bool BlockedByFence() const override; |
| 140 const char* GetName() const override; | 140 const char* GetName() const override; |
| 141 QueueType GetQueueType() const override; | 141 QueueType GetQueueType() const override; |
| 142 | 142 |
| 143 // If this returns false then future updates for this queue are not needed | 143 // Returns the current queue of immediate incoming tasks. |
|
Sami
2017/01/18 17:57:04
nit: Something like "Extracts all the tasks from t
alex clarke (OOO till 29th)
2017/01/19 08:50:52
Done.
| |
| 144 // unless requested. | 144 WTF::Deque<TaskQueueImpl::Task> TakeImmediateIncomingQueue(); |
| 145 bool MaybeUpdateImmediateWorkQueues(); | 145 |
| 146 // Must only be called from the thread this task queue was created on. | |
| 147 void ReloadImmediateWorkQueueIfEmpty(); | |
| 146 | 148 |
| 147 void AsValueInto(base::trace_event::TracedValue* state) const; | 149 void AsValueInto(base::trace_event::TracedValue* state) const; |
| 148 | 150 |
| 149 bool GetQuiescenceMonitored() const { return should_monitor_quiescence_; } | 151 bool GetQuiescenceMonitored() const { return should_monitor_quiescence_; } |
| 150 bool GetShouldNotifyObservers() const { return should_notify_observers_; } | 152 bool GetShouldNotifyObservers() const { return should_notify_observers_; } |
| 151 | 153 |
| 152 void NotifyWillProcessTask(const base::PendingTask& pending_task); | 154 void NotifyWillProcessTask(const base::PendingTask& pending_task); |
| 153 void NotifyDidProcessTask(const base::PendingTask& pending_task); | 155 void NotifyDidProcessTask(const base::PendingTask& pending_task); |
| 154 | 156 |
| 155 WorkQueue* delayed_work_queue() { | 157 WorkQueue* delayed_work_queue() { |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 186 main_thread_only().scheduled_time_domain_wakeup = | 188 main_thread_only().scheduled_time_domain_wakeup = |
| 187 scheduled_time_domain_wakeup; | 189 scheduled_time_domain_wakeup; |
| 188 } | 190 } |
| 189 | 191 |
| 190 HeapHandle heap_handle() const { return main_thread_only().heap_handle; } | 192 HeapHandle heap_handle() const { return main_thread_only().heap_handle; } |
| 191 | 193 |
| 192 void set_heap_handle(HeapHandle heap_handle) { | 194 void set_heap_handle(HeapHandle heap_handle) { |
| 193 main_thread_only().heap_handle = heap_handle; | 195 main_thread_only().heap_handle = heap_handle; |
| 194 } | 196 } |
| 195 | 197 |
| 198 void PushImmediateIncomingTaskForTest(TaskQueueImpl::Task&& task); | |
| 196 EnqueueOrder GetFenceForTest() const; | 199 EnqueueOrder GetFenceForTest() const; |
| 197 | 200 |
| 198 class QueueEnabledVoterImpl : public QueueEnabledVoter { | 201 class QueueEnabledVoterImpl : public QueueEnabledVoter { |
| 199 public: | 202 public: |
| 200 explicit QueueEnabledVoterImpl(TaskQueueImpl* task_queue); | 203 explicit QueueEnabledVoterImpl(TaskQueueImpl* task_queue); |
| 201 ~QueueEnabledVoterImpl() override; | 204 ~QueueEnabledVoterImpl() override; |
| 202 | 205 |
| 203 // QueueEnabledVoter implementation. | 206 // QueueEnabledVoter implementation. |
| 204 void SetQueueEnabled(bool enabled) override; | 207 void SetQueueEnabled(bool enabled) override; |
| 205 | 208 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 316 struct AnyThread& any_thread() { | 319 struct AnyThread& any_thread() { |
| 317 any_thread_lock_.AssertAcquired(); | 320 any_thread_lock_.AssertAcquired(); |
| 318 return any_thread_; | 321 return any_thread_; |
| 319 } | 322 } |
| 320 const struct AnyThread& any_thread() const { | 323 const struct AnyThread& any_thread() const { |
| 321 any_thread_lock_.AssertAcquired(); | 324 any_thread_lock_.AssertAcquired(); |
| 322 return any_thread_; | 325 return any_thread_; |
| 323 } | 326 } |
| 324 | 327 |
| 325 const QueueType type_; | 328 const QueueType type_; |
| 326 const char* name_; | 329 const char* const name_; |
| 327 const char* disabled_by_default_tracing_category_; | 330 const char* const disabled_by_default_tracing_category_; |
| 328 const char* disabled_by_default_verbose_tracing_category_; | 331 const char* const disabled_by_default_verbose_tracing_category_; |
| 329 | 332 |
| 330 base::ThreadChecker main_thread_checker_; | 333 base::ThreadChecker main_thread_checker_; |
| 331 MainThreadOnly main_thread_only_; | 334 MainThreadOnly main_thread_only_; |
| 332 MainThreadOnly& main_thread_only() { | 335 MainThreadOnly& main_thread_only() { |
| 333 DCHECK(main_thread_checker_.CalledOnValidThread()); | 336 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 334 return main_thread_only_; | 337 return main_thread_only_; |
| 335 } | 338 } |
| 336 const MainThreadOnly& main_thread_only() const { | 339 const MainThreadOnly& main_thread_only() const { |
| 337 DCHECK(main_thread_checker_.CalledOnValidThread()); | 340 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 338 return main_thread_only_; | 341 return main_thread_only_; |
| 339 } | 342 } |
| 340 | 343 |
| 341 const bool should_monitor_quiescence_; | 344 const bool should_monitor_quiescence_; |
| 342 const bool should_notify_observers_; | 345 const bool should_notify_observers_; |
| 343 const bool should_report_when_execution_blocked_; | 346 const bool should_report_when_execution_blocked_; |
| 344 | 347 |
| 345 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl); | 348 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl); |
| 346 }; | 349 }; |
| 347 | 350 |
| 348 } // namespace internal | 351 } // namespace internal |
| 349 } // namespace scheduler | 352 } // namespace scheduler |
| 350 } // namespace blink | 353 } // namespace blink |
| 351 | 354 |
| 352 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ | 355 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ |
| OLD | NEW |