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

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

Issue 2778123003: [scheduler] Add WakeupBudgetPool. (Closed)
Patch Set: Addressed comments from alexclarke@ Created 3 years, 7 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 void SetQueuePriority(QueuePriority priority) override; 149 void SetQueuePriority(QueuePriority priority) override;
150 QueuePriority GetQueuePriority() const override; 150 QueuePriority GetQueuePriority() const override;
151 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override; 151 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override;
152 void RemoveTaskObserver( 152 void RemoveTaskObserver(
153 base::MessageLoop::TaskObserver* task_observer) override; 153 base::MessageLoop::TaskObserver* task_observer) override;
154 void SetTimeDomain(TimeDomain* time_domain) override; 154 void SetTimeDomain(TimeDomain* time_domain) override;
155 TimeDomain* GetTimeDomain() const override; 155 TimeDomain* GetTimeDomain() const override;
156 void SetBlameContext(base::trace_event::BlameContext* blame_context) override; 156 void SetBlameContext(base::trace_event::BlameContext* blame_context) override;
157 void InsertFence(InsertFencePosition position) override; 157 void InsertFence(InsertFencePosition position) override;
158 void RemoveFence() override; 158 void RemoveFence() override;
159 bool HasFence() const override;
159 bool BlockedByFence() const override; 160 bool BlockedByFence() const override;
160 const char* GetName() const override; 161 const char* GetName() const override;
161 QueueType GetQueueType() const override; 162 QueueType GetQueueType() const override;
162 void SetObserver(Observer* observer) override; 163 void SetObserver(Observer* observer) override;
163 164
164 // Returns true if a (potentially hypothetical) task with the specified 165 // Returns true if a (potentially hypothetical) task with the specified
165 // |enqueue_order| could run on the queue. Must be called from the main 166 // |enqueue_order| could run on the queue. Must be called from the main
166 // thread. 167 // thread.
167 bool CouldTaskRun(EnqueueOrder enqueue_order) const; 168 bool CouldTaskRun(EnqueueOrder enqueue_order) const;
168 169
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 struct AnyThread { 254 struct AnyThread {
254 AnyThread(TaskQueueManager* task_queue_manager, TimeDomain* time_domain); 255 AnyThread(TaskQueueManager* task_queue_manager, TimeDomain* time_domain);
255 ~AnyThread(); 256 ~AnyThread();
256 257
257 // TaskQueueManager, TimeDomain and Observer are maintained in two copies: 258 // TaskQueueManager, TimeDomain and Observer are maintained in two copies:
258 // inside AnyThread and inside MainThreadOnly. They can be changed only from 259 // inside AnyThread and inside MainThreadOnly. They can be changed only from
259 // main thread, so it should be locked before accessing from other threads. 260 // main thread, so it should be locked before accessing from other threads.
260 TaskQueueManager* task_queue_manager; 261 TaskQueueManager* task_queue_manager;
261 TimeDomain* time_domain; 262 TimeDomain* time_domain;
262 Observer* observer; 263 Observer* observer;
264
265 base::Optional<EnqueueOrder> current_enqueue_order;
263 }; 266 };
264 267
265 struct MainThreadOnly { 268 struct MainThreadOnly {
266 MainThreadOnly(TaskQueueManager* task_queue_manager, 269 MainThreadOnly(TaskQueueManager* task_queue_manager,
267 TaskQueueImpl* task_queue, 270 TaskQueueImpl* task_queue,
268 TimeDomain* time_domain); 271 TimeDomain* time_domain);
269 ~MainThreadOnly(); 272 ~MainThreadOnly();
270 273
271 // Another copy of TaskQueueManager, TimeDomain and Observer 274 // Another copy of TaskQueueManager, TimeDomain and Observer
272 // for lock-free access from the main thread. 275 // for lock-free access from the main thread.
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 const bool should_report_when_execution_blocked_; 390 const bool should_report_when_execution_blocked_;
388 391
389 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl); 392 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl);
390 }; 393 };
391 394
392 } // namespace internal 395 } // namespace internal
393 } // namespace scheduler 396 } // namespace scheduler
394 } // namespace blink 397 } // namespace blink
395 398
396 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ 399 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698