OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "modules/compositorworker/CompositorWorkerMessagingProxy.h" | 6 #include "modules/compositorworker/CompositorWorkerMessagingProxy.h" |
7 | 7 |
8 #include "core/workers/WorkerThreadStartupData.h" | 8 #include "bindings/core/v8/SerializedScriptValue.h" |
| 9 #include "core/dom/Document.h" |
| 10 #include "core/page/ChromeClient.h" |
9 #include "modules/compositorworker/CompositorWorkerThread.h" | 11 #include "modules/compositorworker/CompositorWorkerThread.h" |
10 | 12 |
| 13 #include "platform/TraceEvent.h" |
| 14 |
11 namespace blink { | 15 namespace blink { |
12 | 16 |
13 CompositorWorkerMessagingProxy::CompositorWorkerMessagingProxy(InProcessWorkerBa
se* worker) | 17 CompositorWorkerMessagingProxy::CompositorWorkerMessagingProxy(InProcessWorkerBa
se* worker, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients) |
14 : WorkerMessagingProxy(worker, nullptr) | 18 : WorkerMessagingProxy(worker, workerClients) |
15 { | 19 { |
| 20 TRACE_EVENT0("compositor-worker", "CompositorWorkerMessagingProxy::Composito
rWorkerMessagingProxy"); |
16 } | 21 } |
17 | 22 |
18 CompositorWorkerMessagingProxy::~CompositorWorkerMessagingProxy() | 23 CompositorWorkerMessagingProxy::~CompositorWorkerMessagingProxy() |
19 { | 24 { |
| 25 TRACE_EVENT0("compositor-worker", "CompositorWorkerMessagingProxy::~Composit
orWorkerMessagingProxy"); |
20 } | 26 } |
21 | 27 |
22 PassRefPtr<WorkerThread> CompositorWorkerMessagingProxy::createWorkerThread(doub
le originTime) | 28 PassRefPtr<WorkerThread> CompositorWorkerMessagingProxy::createWorkerThread(doub
le originTime) |
23 { | 29 { |
| 30 TRACE_EVENT0("compositor-worker", "CompositorWorkerMessagingProxy::createWor
kerThread"); |
24 return CompositorWorkerThread::create(loaderProxy(), workerObjectProxy(), or
iginTime); | 31 return CompositorWorkerThread::create(loaderProxy(), workerObjectProxy(), or
iginTime); |
25 } | 32 } |
26 | 33 |
| 34 void CompositorWorkerMessagingProxy::postMessageToWorkerGlobalScope(PassRefPtr<S
erializedScriptValue> value, PassOwnPtr<MessagePortChannelArray> messagePort) |
| 35 { |
| 36 toDocument(executionContext()).frame()->chromeClient().schedulePostCommitTas
k( |
| 37 WTF::bind(&CompositorWorkerMessagingProxy::postMessageToWorkerGlobalScop
eInternal, this, value, messagePort)); |
| 38 } |
| 39 |
| 40 void CompositorWorkerMessagingProxy::postMessageToWorkerGlobalScopeInternal(Pass
RefPtr<SerializedScriptValue> value, PassOwnPtr<MessagePortChannelArray> message
Port) |
| 41 { |
| 42 WorkerMessagingProxy::postMessageToWorkerGlobalScope(value, messagePort); |
| 43 } |
| 44 |
27 } // namespace blink | 45 } // namespace blink |
OLD | NEW |