| 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 "core/dom/CompositorProxy.h" | 5 #include "core/dom/CompositorProxy.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionMessages.h" | 7 #include "bindings/core/v8/ExceptionMessages.h" |
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "core/dom/CompositorWorkerProxyClient.h" |
| 9 #include "core/dom/DOMNodeIds.h" | 10 #include "core/dom/DOMNodeIds.h" |
| 10 #include "core/dom/ExceptionCode.h" | 11 #include "core/dom/ExceptionCode.h" |
| 11 #include "core/dom/ExecutionContext.h" | 12 #include "core/dom/ExecutionContext.h" |
| 12 #include "core/workers/WorkerClients.h" | 13 #include "core/workers/WorkerClients.h" |
| 13 #include "core/workers/WorkerGlobalScope.h" | 14 #include "core/workers/WorkerGlobalScope.h" |
| 14 #include "platform/CrossThreadFunctional.h" | 15 #include "platform/CrossThreadFunctional.h" |
| 15 #include "platform/graphics/CompositorMutableProperties.h" | 16 #include "platform/graphics/CompositorMutableProperties.h" |
| 16 #include "public/platform/Platform.h" | 17 #include "public/platform/Platform.h" |
| 17 #include "public/platform/WebTraceLocation.h" | 18 #include "public/platform/WebTraceLocation.h" |
| 18 #include <algorithm> | 19 #include <algorithm> |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 117 |
| 117 return new CompositorProxy(*element, attributeArray); | 118 return new CompositorProxy(*element, attributeArray); |
| 118 } | 119 } |
| 119 | 120 |
| 120 CompositorProxy* CompositorProxy::create(ExecutionContext* context, | 121 CompositorProxy* CompositorProxy::create(ExecutionContext* context, |
| 121 uint64_t elementId, | 122 uint64_t elementId, |
| 122 uint32_t compositorMutableProperties) { | 123 uint32_t compositorMutableProperties) { |
| 123 if (context->isCompositorWorkerGlobalScope()) { | 124 if (context->isCompositorWorkerGlobalScope()) { |
| 124 WorkerClients* clients = toWorkerGlobalScope(context)->clients(); | 125 WorkerClients* clients = toWorkerGlobalScope(context)->clients(); |
| 125 DCHECK(clients); | 126 DCHECK(clients); |
| 126 CompositorProxyClient* client = CompositorProxyClient::from(clients); | 127 CompositorWorkerProxyClient* client = |
| 128 CompositorWorkerProxyClient::from(clients); |
| 127 return new CompositorProxy(elementId, compositorMutableProperties, client); | 129 return new CompositorProxy(elementId, compositorMutableProperties, client); |
| 128 } | 130 } |
| 129 | 131 |
| 130 return new CompositorProxy(elementId, compositorMutableProperties); | 132 return new CompositorProxy(elementId, compositorMutableProperties); |
| 131 } | 133 } |
| 132 | 134 |
| 133 CompositorProxy::CompositorProxy(uint64_t elementId, | 135 CompositorProxy::CompositorProxy(uint64_t elementId, |
| 134 uint32_t compositorMutableProperties) | 136 uint32_t compositorMutableProperties) |
| 135 : m_elementId(elementId), | 137 : m_elementId(elementId), |
| 136 m_compositorMutableProperties(compositorMutableProperties), | 138 m_compositorMutableProperties(compositorMutableProperties), |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 m_elementId, m_compositorMutableProperties); | 299 m_elementId, m_compositorMutableProperties); |
| 298 } else { | 300 } else { |
| 299 Platform::current()->mainThread()->getWebTaskRunner()->postTask( | 301 Platform::current()->mainThread()->getWebTaskRunner()->postTask( |
| 300 BLINK_FROM_HERE, | 302 BLINK_FROM_HERE, |
| 301 crossThreadBind(&decrementCompositorProxiedPropertiesForElement, | 303 crossThreadBind(&decrementCompositorProxiedPropertiesForElement, |
| 302 m_elementId, m_compositorMutableProperties)); | 304 m_elementId, m_compositorMutableProperties)); |
| 303 } | 305 } |
| 304 } | 306 } |
| 305 | 307 |
| 306 } // namespace blink | 308 } // namespace blink |
| OLD | NEW |