| Index: third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp b/third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp
|
| index 631c5de8c0ec7a26c67b96aea14956e1c38bf507..afed2a87eab6e828831f3a4f4c1824631bd61046 100644
|
| --- a/third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp
|
| @@ -17,6 +17,7 @@
|
| namespace blink {
|
|
|
| RefPtr<WebTaskRunner> TaskRunnerHelper::Get(TaskType type, LocalFrame* frame) {
|
| + DCHECK(WTF::IsMainThread());
|
| // TODO(haraken): Optimize the mapping from TaskTypes to task runners.
|
| switch (type) {
|
| case TaskType::kTimer:
|
| @@ -61,20 +62,18 @@ RefPtr<WebTaskRunner> TaskRunnerHelper::Get(TaskType type, LocalFrame* frame) {
|
| }
|
|
|
| RefPtr<WebTaskRunner> TaskRunnerHelper::Get(TaskType type, Document* document) {
|
| + DCHECK(!document || document->IsContextThread());
|
| return Get(type, document ? document->GetFrame() : nullptr);
|
| }
|
|
|
| RefPtr<WebTaskRunner> TaskRunnerHelper::Get(
|
| TaskType type,
|
| - ExecutionContext* executionContext) {
|
| - if (!executionContext)
|
| - return Get(type, ToDocument(executionContext));
|
| - if (executionContext->IsDocument())
|
| - return Get(type, ToDocument(executionContext));
|
| - if (executionContext->IsWorkerOrWorkletGlobalScope())
|
| - return Get(type, ToWorkerOrWorkletGlobalScope(executionContext));
|
| - executionContext = nullptr;
|
| - return Get(type, ToDocument(executionContext));
|
| + ExecutionContext* execution_context) {
|
| + DCHECK(!execution_context || execution_context->IsContextThread());
|
| + if (!execution_context || execution_context->IsDocument())
|
| + return Get(type, ToDocument(execution_context));
|
| + DCHECK(execution_context->IsWorkerOrWorkletGlobalScope());
|
| + return Get(type, ToWorkerOrWorkletGlobalScope(execution_context));
|
| }
|
|
|
| RefPtr<WebTaskRunner> TaskRunnerHelper::Get(TaskType type,
|
|
|