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 d15176dc0dead87715ba29689b25106187b4e8cf..9389cdbcee5dd86f8dc2d2a10287962537eae4cd 100644 |
--- a/third_party/WebKit/Source/core/dom/TaskRunnerHelper.h |
+++ b/third_party/WebKit/Source/core/dom/TaskRunnerHelper.h |
@@ -16,6 +16,8 @@ class ExecutionContext; |
class LocalFrame; |
class ScriptState; |
class WebTaskRunner; |
+class WorkerOrWorkletGlobalScope; |
+class WorkerThread; |
enum class TaskType : unsigned { |
// Speced tasks and related internal tasks should be posted to one of |
@@ -146,6 +148,14 @@ class CORE_EXPORT TaskRunnerHelper final { |
static RefPtr<WebTaskRunner> Get(TaskType, Document*); |
static RefPtr<WebTaskRunner> Get(TaskType, ExecutionContext*); |
static RefPtr<WebTaskRunner> Get(TaskType, ScriptState*); |
+ static RefPtr<WebTaskRunner> Get(TaskType, WorkerOrWorkletGlobalScope*); |
+ |
+ // Returns a WebTaskRunner that is associated to the worker / worklet global |
+ // scope that corresponds to the given WorkerThread. Note that WorkerThread is |
+ // a per-global-scope object while the naming might sound differently. |
+ // TODO(nhiroki): Rename WorkerThread to something that clarifies it's a |
+ // per-global-scope object. |
+ static RefPtr<WebTaskRunner> Get(TaskType, WorkerThread*); |
}; |
} // namespace blink |