Chromium Code Reviews| Index: third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp |
| diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp |
| index 759dc94ea109cd46890cd166db5adcf9f6d8a739..e3f0c269a6f15d5e177dc798addd01a6db8324b4 100644 |
| --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp |
| +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp |
| @@ -5,11 +5,14 @@ |
| #include "modules/compositorworker/CompositorWorker.h" |
| #include "bindings/core/v8/ExceptionState.h" |
| +#include "core/dom/CompositorProxyClient.h" |
| #include "core/dom/Document.h" |
| #include "core/dom/ExceptionCode.h" |
| +#include "core/page/ChromeClient.h" |
| #include "core/workers/WorkerClients.h" |
| #include "modules/EventTargetModules.h" |
| #include "modules/compositorworker/CompositorWorkerMessagingProxy.h" |
| +#include "modules/compositorworker/CompositorWorkerThread.h" |
| namespace blink { |
| @@ -20,6 +23,9 @@ inline CompositorWorker::CompositorWorker(ExecutionContext* context) |
| CompositorWorker* CompositorWorker::create(ExecutionContext* context, const String& url, ExceptionState& exceptionState) |
| { |
| + // Ensure the compositor worker backing thread is ready. |
| + CompositorWorkerThread::ensureSharedBackingThread(); |
| + |
| ASSERT(isMainThread()); |
| Document* document = toDocument(context); |
| if (!document->page()) { |
| @@ -42,10 +48,13 @@ const AtomicString& CompositorWorker::interfaceName() const |
| return EventTargetNames::CompositorWorker; |
| } |
| -WorkerGlobalScopeProxy* CompositorWorker::createWorkerGlobalScopeProxy(ExecutionContext* worker) |
| +WorkerGlobalScopeProxy* CompositorWorker::createWorkerGlobalScopeProxy(ExecutionContext* context) |
| { |
| - ASSERT(getExecutionContext()->isDocument()); |
| - return new CompositorWorkerMessagingProxy(this); |
| + ASSERT(context->isDocument()); |
|
jbroman
2016/04/29 19:42:22
The assertion here is redundant, since toDocument
flackr
2016/05/03 22:24:54
Heh, I like the pun. Thanks, removed.
|
| + Document* document = toDocument(context); |
| + WorkerClients* workerClients = WorkerClients::create(); |
| + provideCompositorProxyClientTo(workerClients, document->frame()->chromeClient().createCompositorProxyClient(document->frame())); |
| + return new CompositorWorkerMessagingProxy(this, workerClients); |
| } |
| } // namespace blink |