Chromium Code Reviews| Index: third_party/WebKit/Source/core/workers/WorkerLoaderProxy.cpp |
| diff --git a/third_party/WebKit/Source/core/workers/WorkerLoaderProxy.cpp b/third_party/WebKit/Source/core/workers/WorkerLoaderProxy.cpp |
| index dd8655f571c7bfb72956c3472964114519b8b6ad..8a705a837d15e3aad317bff592a9c06323f5f729 100644 |
| --- a/third_party/WebKit/Source/core/workers/WorkerLoaderProxy.cpp |
| +++ b/third_party/WebKit/Source/core/workers/WorkerLoaderProxy.cpp |
| @@ -4,7 +4,7 @@ |
| #include "core/workers/WorkerLoaderProxy.h" |
| -#include "core/dom/ExecutionContextTask.h" |
| +#include "core/dom/ExecutionContext.h" |
| namespace blink { |
| @@ -26,7 +26,7 @@ void WorkerLoaderProxy::detachProvider( |
| void WorkerLoaderProxy::postTaskToLoader( |
| const WebTraceLocation& location, |
| - std::unique_ptr<ExecutionContextTask> task) { |
| + std::unique_ptr<WTF::CrossThreadClosure> task) { |
| MutexLocker locker(m_lock); |
| DCHECK(!isMainThread()); |
| if (!m_loaderProxyProvider) |
| @@ -44,4 +44,12 @@ void WorkerLoaderProxy::postTaskToWorkerGlobalScope( |
| m_loaderProxyProvider->postTaskToWorkerGlobalScope(location, std::move(task)); |
| } |
| +ExecutionContext* WorkerLoaderProxy::getLoaderExecutionContext() { |
| + MutexLocker locker(m_lock); |
|
haraken
2017/02/23 09:11:54
Would you help me understand why we need this lock
kinuko
2017/02/23 09:25:18
This was to protect m_loaderProxyProvider access.
|
| + if (!m_loaderProxyProvider) |
| + return nullptr; |
| + DCHECK(m_loaderProxyProvider->getLoaderExecutionContext()->isContextThread()); |
| + return m_loaderProxyProvider->getLoaderExecutionContext(); |
| +} |
| + |
| } // namespace blink |