| Index: third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
|
| index 81889b65e6f854afee264c30e92bd688c6a6de61..7b30482312d7567e4c27a78104c8d8bcbbd3babb 100644
|
| --- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
|
| @@ -39,6 +39,7 @@
|
| #include "core/loader/FrameLoadRequest.h"
|
| #include "core/loader/FrameLoader.h"
|
| #include "core/page/Page.h"
|
| +#include "core/workers/ParentFrameTaskRunners.h"
|
| #include "core/workers/SharedWorkerGlobalScope.h"
|
| #include "core/workers/SharedWorkerThread.h"
|
| #include "core/workers/WorkerClients.h"
|
| @@ -271,6 +272,9 @@ void WebSharedWorkerImpl::workerThreadTerminatedOnMainThread()
|
|
|
| void WebSharedWorkerImpl::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));
|
| }
|
|
|
| @@ -351,6 +355,13 @@ void WebSharedWorkerImpl::onScriptLoaderFinished()
|
| m_mainScriptLoader->responseAddressSpace(),
|
| m_mainScriptLoader->originTrialTokens(),
|
| std::move(workerSettings));
|
| +
|
| + // 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_loaderProxy = WorkerLoaderProxy::create(this);
|
| m_workerThread = SharedWorkerThread::create(m_name, m_loaderProxy, *this);
|
| InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScriptLoader->identifier(), m_mainScriptLoader->script());
|
|
|