Chromium Code Reviews| 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..c935980eb9e862cc1ab7aa99af1dcd403a37c1ef 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,13 @@ 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*); |
| + |
| + // Passing WorkerThread could be confusing but it's valid because WorkerThread |
|
kinuko
2017/04/17 05:01:11
Maybe it'd be clearer to document what this Get do
nhiroki
2017/04/17 11:03:46
Yeah, that makes it much clearer. Done.
|
| + // has one-to-one relationship with a context object. |
| + // TODO(nhiroki): Rename WorkerThread to something that clarifies it's a |
| + // per-global-scope object. |
| + static RefPtr<WebTaskRunner> Get(TaskType, WorkerThread*); |
| }; |
| } // namespace blink |