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

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

Issue 2806623004: Worker: Introduce per-global-scope task scheduler (Closed)
Patch Set: address review comments Created 3 years, 8 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
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

Powered by Google App Engine
This is Rietveld 408576698