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

Unified Diff: third_party/WebKit/Source/core/dom/TaskRunnerHelper.h

Issue 2209023002: Introduce TaskRunnerHelper::get() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/TaskRunnerHelper.h
diff --git a/third_party/WebKit/Source/core/dom/TaskRunnerHelper.h b/third_party/WebKit/Source/core/dom/TaskRunnerHelper.h
index 19a0983c82539672a0586d69189df381806c98a5..94e37e6d2f515799793e4913d3c9aaa14a090e6a 100644
--- a/third_party/WebKit/Source/core/dom/TaskRunnerHelper.h
+++ b/third_party/WebKit/Source/core/dom/TaskRunnerHelper.h
@@ -16,9 +16,45 @@ class LocalFrame;
class ScriptState;
class WebTaskRunner;
+enum TaskRunnerType {
Sami 2016/08/04 10:32:29 FWIW we could use an enum class for this, e.g., Ta
haraken 2016/08/04 13:45:31 Used an enum class.
+ // Speced tasks and related internal tasks should be posted to one of
+ // the following task runners. These task runners may be throttled.
+ DOMManipulationTask,
+ UserInteractionTask,
+ NetworkingTask,
+ HistoryTraversalTask,
+ EmbedTask,
+ MediaElementEventTask,
+ CanvasBlobSerializationTask,
+ MicrotaskTask,
+ TimerTask,
+ RemoteEventTask,
+ WebSocketTask,
+ PostedMessageTask,
+ UnshippedPortMessageTask,
+
+ // Other internal tasks that cannot fit any of the above task runners
+ // can be posted here, but the usage is not encouraged. The task runner
+ // may be throttled.
+ InternalTask,
+
+ // Idle tasks should be posted here.
+ IdleTask,
Sami 2016/08/04 10:32:29 Idle tasks need a different kind of task runner (o
haraken 2016/08/04 13:45:31 Agreed. Removed IdleTask.
+
+ // Tasks that must not be throttled should be posted here, but the usage
+ // should be very limited.
+ UnthrottledTask,
+};
+
class CORE_EXPORT TaskRunnerHelper final {
STATIC_ONLY(TaskRunnerHelper);
public:
+ static WebTaskRunner* get(TaskRunnerType, LocalFrame*);
+ static WebTaskRunner* get(TaskRunnerType, Document*);
+ static WebTaskRunner* get(TaskRunnerType, ExecutionContext*);
+ static WebTaskRunner* get(TaskRunnerType, ScriptState*);
+
+ // TODO(haraken): Remove the following APIs.
static WebTaskRunner* getUnthrottledTaskRunner(LocalFrame*);
static WebTaskRunner* getTimerTaskRunner(LocalFrame*);
static WebTaskRunner* getLoadingTaskRunner(LocalFrame*);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698