| 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/DOMNodeIds.h" | 9 #include "core/dom/DOMNodeIds.h" |
| 10 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 sanityCheckProperties &= ~static_cast<uint32_t>(allowedProperties[i].pro
perty); | 98 sanityCheckProperties &= ~static_cast<uint32_t>(allowedProperties[i].pro
perty); |
| 99 } | 99 } |
| 100 return !sanityCheckProperties; | 100 return !sanityCheckProperties; |
| 101 } | 101 } |
| 102 #endif | 102 #endif |
| 103 | 103 |
| 104 CompositorProxy* CompositorProxy::create(ExecutionContext* context, Element* ele
ment, const Vector<String>& attributeArray, ExceptionState& exceptionState) | 104 CompositorProxy* CompositorProxy::create(ExecutionContext* context, Element* ele
ment, const Vector<String>& attributeArray, ExceptionState& exceptionState) |
| 105 { | 105 { |
| 106 if (!context->isDocument()) { | 106 if (!context->isDocument()) { |
| 107 exceptionState.throwTypeError(ExceptionMessages::failedToConstruct("Comp
ositorProxy", "Can only be created from the main context.")); | 107 exceptionState.throwTypeError(ExceptionMessages::failedToConstruct("Comp
ositorProxy", "Can only be created from the main context.")); |
| 108 exceptionState.throwIfNeeded(); | |
| 109 return nullptr; | 108 return nullptr; |
| 110 } | 109 } |
| 111 | 110 |
| 112 return new CompositorProxy(*element, attributeArray); | 111 return new CompositorProxy(*element, attributeArray); |
| 113 } | 112 } |
| 114 | 113 |
| 115 CompositorProxy* CompositorProxy::create(uint64_t elementId, uint32_t compositor
MutableProperties) | 114 CompositorProxy* CompositorProxy::create(uint64_t elementId, uint32_t compositor
MutableProperties) |
| 116 { | 115 { |
| 117 return new CompositorProxy(elementId, compositorMutableProperties); | 116 return new CompositorProxy(elementId, compositorMutableProperties); |
| 118 } | 117 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 void CompositorProxy::disconnect() | 239 void CompositorProxy::disconnect() |
| 241 { | 240 { |
| 242 m_connected = false; | 241 m_connected = false; |
| 243 if (isMainThread()) | 242 if (isMainThread()) |
| 244 decrementCompositorProxiedPropertiesForElement(m_elementId, m_compositor
MutableProperties); | 243 decrementCompositorProxiedPropertiesForElement(m_elementId, m_compositor
MutableProperties); |
| 245 else | 244 else |
| 246 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR
OM_HERE, threadSafeBind(&decrementCompositorProxiedPropertiesForElement, m_eleme
ntId, m_compositorMutableProperties)); | 245 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR
OM_HERE, threadSafeBind(&decrementCompositorProxiedPropertiesForElement, m_eleme
ntId, m_compositorMutableProperties)); |
| 247 } | 246 } |
| 248 | 247 |
| 249 } // namespace blink | 248 } // namespace blink |
| OLD | NEW |