| Index: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
|
| index d30cd1dc2dd20e0dd7ee2a2b847a4f0f8bf1a46b..225290b552a30ba21df9060575e18f359ffbb738 100644
|
| --- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
|
| @@ -39,6 +39,7 @@
|
| #include "core/inspector/ConsoleMessage.h"
|
| #include "core/inspector/InspectorInstrumentation.h"
|
| #include "core/loader/FrameLoadRequest.h"
|
| +#include "core/workers/ParentFrameTaskRunners.h"
|
| #include "core/workers/WorkerClients.h"
|
| #include "core/workers/WorkerGlobalScope.h"
|
| #include "core/workers/WorkerInspectorProxy.h"
|
| @@ -255,6 +256,9 @@ void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message)
|
|
|
| void WebEmbeddedWorkerImpl::postTaskToLoader(const WebTraceLocation& location, std::unique_ptr<ExecutionContextTask> task)
|
| {
|
| + // TODO(hiroshige,yuryu): Make this not use ExecutionContextTask and
|
| + // consider using m_mainThreadTaskRunners->get(TaskType::Networking)
|
| + // instead.
|
| m_mainFrame->frame()->document()->postTask(location, std::move(task));
|
| }
|
|
|
| @@ -436,6 +440,12 @@ void WebEmbeddedWorkerImpl::startWorkerThread()
|
|
|
| m_mainScriptLoader.clear();
|
|
|
| + // We have a dummy document here for loading but it doesn't really represent
|
| + // the document/frame of associated document(s) for this worker. Here we
|
| + // populate the task runners with null document not to confuse the frame
|
| + // scheduler (which will end up using the thread's default task runner).
|
| + m_mainThreadTaskRunners = new ParentFrameTaskRunners(nullptr);
|
| +
|
| m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *document, *m_workerContextClient);
|
| m_loaderProxy = WorkerLoaderProxy::create(this);
|
| m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalScopeProxy);
|
|
|