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

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

Issue 2653643002: Move has_incoming_immediate_work to the TaskQueueManager (Closed)
Patch Set: Add some tracing 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 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
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 // Returns true if a posted immediate task could run (i.e. the queue is
144 // enabled and not blocked by a fence). Must only be called from the thread
145 // this task queue was created on.
146 bool ImmediateTaskCouldRun() const;
147
143 // Must only be called from the thread this task queue was created on. 148 // Must only be called from the thread this task queue was created on.
144 void ReloadImmediateWorkQueueIfEmpty(); 149 void ReloadImmediateWorkQueueIfEmpty();
145 150
146 void AsValueInto(base::trace_event::TracedValue* state) const; 151 void AsValueInto(base::trace_event::TracedValue* state) const;
147 152
148 bool GetQuiescenceMonitored() const { return should_monitor_quiescence_; } 153 bool GetQuiescenceMonitored() const { return should_monitor_quiescence_; }
149 bool GetShouldNotifyObservers() const { return should_notify_observers_; } 154 bool GetShouldNotifyObservers() const { return should_notify_observers_; }
150 155
151 void NotifyWillProcessTask(const base::PendingTask& pending_task); 156 void NotifyWillProcessTask(const base::PendingTask& pending_task);
152 void NotifyDidProcessTask(const base::PendingTask& pending_task); 157 void NotifyDidProcessTask(const base::PendingTask& pending_task);
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 const tracked_objects::Location& posted_from, 296 const tracked_objects::Location& posted_from,
292 const base::Closure& task, 297 const base::Closure& task,
293 base::TimeTicks desired_run_time, 298 base::TimeTicks desired_run_time,
294 EnqueueOrder sequence_number, 299 EnqueueOrder sequence_number,
295 bool nestable); 300 bool nestable);
296 301
297 // Extracts all the tasks from the immediate incoming queue and clears it. 302 // Extracts all the tasks from the immediate incoming queue and clears it.
298 // Can be called from any thread. 303 // Can be called from any thread.
299 WTF::Deque<TaskQueueImpl::Task> TakeImmediateIncomingQueue(); 304 WTF::Deque<TaskQueueImpl::Task> TakeImmediateIncomingQueue();
300 305
301 // As BlockedByFence but safe to be called while locked.
302 bool BlockedByFenceLocked() const;
303
304 void TraceQueueSize(bool is_locked) const; 306 void TraceQueueSize(bool is_locked) const;
305 static void QueueAsValueInto(const WTF::Deque<Task>& queue, 307 static void QueueAsValueInto(const WTF::Deque<Task>& queue,
306 base::trace_event::TracedValue* state); 308 base::trace_event::TracedValue* state);
307 static void QueueAsValueInto(const std::priority_queue<Task>& queue, 309 static void QueueAsValueInto(const std::priority_queue<Task>& queue,
308 base::trace_event::TracedValue* state); 310 base::trace_event::TracedValue* state);
309 static void TaskAsValueInto(const Task& task, 311 static void TaskAsValueInto(const Task& task,
310 base::trace_event::TracedValue* state); 312 base::trace_event::TracedValue* state);
311 313
312 void RemoveQueueEnabledVoter(const QueueEnabledVoterImpl* voter); 314 void RemoveQueueEnabledVoter(const QueueEnabledVoterImpl* voter);
313 void OnQueueEnabledVoteChanged(bool enabled); 315 void OnQueueEnabledVoteChanged(bool enabled);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 const bool should_report_when_execution_blocked_; 349 const bool should_report_when_execution_blocked_;
348 350
349 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl); 351 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl);
350 }; 352 };
351 353
352 } // namespace internal 354 } // namespace internal
353 } // namespace scheduler 355 } // namespace scheduler
354 } // namespace blink 356 } // namespace blink
355 357
356 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ 358 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698