| Index: third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
|
| diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
|
| index 8ccb106ab96a23b1832a052f6984c7f504d5c69c..180d3c50b8ce908558b870b9b938256410ab3a89 100644
|
| --- a/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
|
| +++ b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
|
| @@ -43,10 +43,12 @@
|
| #include "core/origin_trials/OriginTrialContext.h"
|
| #include "core/workers/InProcessWorkerBase.h"
|
| #include "core/workers/InProcessWorkerObjectProxy.h"
|
| +#include "core/workers/ParentFrameTaskRunners.h"
|
| #include "core/workers/WorkerClients.h"
|
| #include "core/workers/WorkerGlobalScope.h"
|
| #include "core/workers/WorkerInspectorProxy.h"
|
| #include "core/workers/WorkerThreadStartupData.h"
|
| +#include "public/platform/WebTaskRunner.h"
|
| #include "wtf/WTF.h"
|
| #include <memory>
|
|
|
| @@ -82,6 +84,7 @@ InProcessWorkerMessagingProxy::InProcessWorkerMessagingProxy(InProcessWorkerBase
|
| , m_askedToTerminate(false)
|
| , m_workerInspectorProxy(WorkerInspectorProxy::create())
|
| , m_workerClients(workerClients)
|
| + , m_parentFrameTaskRunners(new ParentFrameTaskRunners(toDocument(m_executionContext.get())->frame()))
|
| {
|
| DCHECK(isParentContextThread());
|
| DCHECK(m_workerObject);
|
| @@ -168,6 +171,8 @@ bool InProcessWorkerMessagingProxy::postTaskToWorkerGlobalScope(const WebTraceLo
|
| void InProcessWorkerMessagingProxy::postTaskToLoader(const WebTraceLocation& location, std::unique_ptr<ExecutionContextTask> task)
|
| {
|
| DCHECK(getExecutionContext()->isDocument());
|
| + // TODO(hiroshige,yuryu): Make this not use ExecutionContextTask and use
|
| + // m_parentFrameTaskRunners->get(TaskType::Networking) instead.
|
| getExecutionContext()->postTask(location, std::move(task));
|
| }
|
|
|
| @@ -223,7 +228,7 @@ void InProcessWorkerMessagingProxy::workerObjectDestroyed()
|
| // cleared before this method gets called.
|
| DCHECK(!m_workerObject);
|
|
|
| - getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InProcessWorkerMessagingProxy::workerObjectDestroyedInternal, crossThreadUnretained(this)));
|
| + m_parentFrameTaskRunners->get(TaskType::Internal)->postTask(BLINK_FROM_HERE, WTF::bind(&InProcessWorkerMessagingProxy::workerObjectDestroyedInternal, unretained(this)));
|
| }
|
|
|
| void InProcessWorkerMessagingProxy::workerObjectDestroyedInternal()
|
| @@ -253,6 +258,7 @@ void InProcessWorkerMessagingProxy::workerThreadTerminated()
|
| void InProcessWorkerMessagingProxy::terminateWorkerGlobalScope()
|
| {
|
| DCHECK(isParentContextThread());
|
| +
|
| if (m_askedToTerminate)
|
| return;
|
| m_askedToTerminate = true;
|
|
|