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

Side by Side Diff: third_party/WebKit/public/platform/scheduler/base/task_queue.h

Issue 2533603002: [scheduler] Add options to TaskQueue::InsertFence (Closed)
Patch Set: More nits Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ 5 #ifndef THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_
6 #define THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ 6 #define THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/optional.h" 10 #include "base/optional.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 virtual void SetBlameContext( 165 virtual void SetBlameContext(
166 base::trace_event::BlameContext* blame_context) = 0; 166 base::trace_event::BlameContext* blame_context) = 0;
167 167
168 // Removes the task queue from the previous TimeDomain and adds it to 168 // Removes the task queue from the previous TimeDomain and adds it to
169 // |domain|. This is a moderately expensive operation. 169 // |domain|. This is a moderately expensive operation.
170 virtual void SetTimeDomain(TimeDomain* domain) = 0; 170 virtual void SetTimeDomain(TimeDomain* domain) = 0;
171 171
172 // Returns the queue's current TimeDomain. Can be called from any thread. 172 // Returns the queue's current TimeDomain. Can be called from any thread.
173 virtual TimeDomain* GetTimeDomain() const = 0; 173 virtual TimeDomain* GetTimeDomain() const = 0;
174 174
175 // Inserts a barrier into the task queue which inhibits non-delayed tasks 175 enum class InsertFencePosition {
176 // posted after this point, or delayed tasks which are not yet ready to run, 176 NOW, // Tasks posted on the queue up till this point further may run.
177 // from being executed until the fence is cleared. If a fence already existed 177 // All further tasks are blocked.
178 // the one supersedes it and previously blocked tasks will now run up until 178 BEGINNING_OF_TIME, // No tasks posted on this queue may run.
179 // the new fence is hit. 179 };
180 virtual void InsertFence() = 0; 180
181 // Inserts a barrier into the task queue which prevents tasks with an enqueue
182 // order greater than the fence from running until either the fence has been
183 // removed or a subsequent fence has unblocked some tasks within the queue.
184 // Note: delayed tasks get their enqueue order set once their delay has
185 // expired, and non-delayed tasks get their enqueue order set when posted.
186 virtual void InsertFence(InsertFencePosition position) = 0;
181 187
182 // Removes any previously added fence and unblocks execution of any tasks 188 // Removes any previously added fence and unblocks execution of any tasks
183 // blocked by it. 189 // blocked by it.
184 virtual void RemoveFence() = 0; 190 virtual void RemoveFence() = 0;
185 191
186 virtual bool BlockedByFence() const = 0; 192 virtual bool BlockedByFence() const = 0;
187 193
188 protected: 194 protected:
189 ~TaskQueue() override {} 195 ~TaskQueue() override {}
190 196
191 DISALLOW_COPY_AND_ASSIGN(TaskQueue); 197 DISALLOW_COPY_AND_ASSIGN(TaskQueue);
192 }; 198 };
193 199
194 } // namespace scheduler 200 } // namespace scheduler
195 } // namespace blink 201 } // namespace blink
196 202
197 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ 203 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698