| 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 e8ebbf64e98c0bba264578cddefc87697f5e48ec..675987f1d2b7a3936f5425d44c9c528429feba2e 100644
|
| --- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
|
| @@ -30,15 +30,16 @@
|
|
|
| #include "web/WebEmbeddedWorkerImpl.h"
|
|
|
| +#include <memory>
|
| #include "bindings/core/v8/SourceLocation.h"
|
| #include "core/dom/Document.h"
|
| #include "core/dom/ExecutionContextTask.h"
|
| #include "core/dom/SecurityContext.h"
|
| +#include "core/dom/TaskRunnerHelper.h"
|
| #include "core/frame/csp/ContentSecurityPolicy.h"
|
| #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"
|
| @@ -73,7 +74,6 @@
|
| #include "web/WorkerContentSettingsClient.h"
|
| #include "wtf/Functional.h"
|
| #include "wtf/PtrUtil.h"
|
| -#include <memory>
|
|
|
| namespace blink {
|
|
|
| @@ -263,7 +263,7 @@ void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message) {
|
| void WebEmbeddedWorkerImpl::postTaskToLoader(
|
| const WebTraceLocation& location,
|
| std::unique_ptr<WTF::CrossThreadClosure> task) {
|
| - m_mainThreadTaskRunners->get(TaskType::Networking)
|
| + FrameTaskRunnerHelper::get(TaskType::Networking, m_workerThread.get())
|
| ->postTask(BLINK_FROM_HERE, std::move(task));
|
| }
|
|
|
| @@ -464,18 +464,17 @@ 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 = ParentFrameTaskRunners::create(nullptr);
|
| -
|
| m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(
|
| *this, *document, *m_workerContextClient);
|
| m_loaderProxy = WorkerLoaderProxy::create(this);
|
| m_workerThread =
|
| ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalScopeProxy);
|
| - m_workerThread->start(std::move(startupData), m_mainThreadTaskRunners.get());
|
| + // 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_workerThread->start(std::move(startupData),
|
| + FrameTaskRunnersHolder::create(nullptr));
|
| m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
|
| scriptURL);
|
| }
|
|
|