| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 properties |= static_cast<uint32_t>(compositorMutablePropertyForName(att
ribute)); | 103 properties |= static_cast<uint32_t>(compositorMutablePropertyForName(att
ribute)); |
| 104 } | 104 } |
| 105 return properties; | 105 return properties; |
| 106 } | 106 } |
| 107 | 107 |
| 108 #if ENABLE(ASSERT) | 108 #if ENABLE(ASSERT) |
| 109 static bool sanityCheckMutableProperties(uint32_t properties) | 109 static bool sanityCheckMutableProperties(uint32_t properties) |
| 110 { | 110 { |
| 111 // Ensures that we only have bits set for valid mutable properties. | 111 // Ensures that we only have bits set for valid mutable properties. |
| 112 uint32_t sanityCheckProperties = properties; | 112 uint32_t sanityCheckProperties = properties; |
| 113 for (unsigned i = 0; i < arraysize(allowedProperties); ++i) { | 113 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(allowedProperties); ++i) { |
| 114 sanityCheckProperties &= ~static_cast<uint32_t>(allowedProperties[i].pro
perty); | 114 sanityCheckProperties &= ~static_cast<uint32_t>(allowedProperties[i].pro
perty); |
| 115 } | 115 } |
| 116 return !sanityCheckProperties; | 116 return !sanityCheckProperties; |
| 117 } | 117 } |
| 118 #endif | 118 #endif |
| 119 | 119 |
| 120 CompositorProxy* CompositorProxy::create(ExecutionContext* context, Element* ele
ment, const Vector<String>& attributeArray, ExceptionState& exceptionState) | 120 CompositorProxy* CompositorProxy::create(ExecutionContext* context, Element* ele
ment, const Vector<String>& attributeArray, ExceptionState& exceptionState) |
| 121 { | 121 { |
| 122 if (!context->isDocument()) { | 122 if (!context->isDocument()) { |
| 123 exceptionState.throwTypeError(ExceptionMessages::failedToConstruct("Comp
ositorProxy", "Can only be created from the main context.")); | 123 exceptionState.throwTypeError(ExceptionMessages::failedToConstruct("Comp
ositorProxy", "Can only be created from the main context.")); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 void CompositorProxy::disconnect() | 252 void CompositorProxy::disconnect() |
| 253 { | 253 { |
| 254 m_connected = false; | 254 m_connected = false; |
| 255 if (isMainThread()) | 255 if (isMainThread()) |
| 256 decrementCompositorProxiedPropertiesForElement(m_elementId, m_compositor
MutableProperties); | 256 decrementCompositorProxiedPropertiesForElement(m_elementId, m_compositor
MutableProperties); |
| 257 else | 257 else |
| 258 Platform::current()->mainThread()->taskRunner()->postTask(BLINK_FROM_HER
E, threadSafeBind(&decrementCompositorProxiedPropertiesForElement, m_elementId,
m_compositorMutableProperties)); | 258 Platform::current()->mainThread()->taskRunner()->postTask(BLINK_FROM_HER
E, threadSafeBind(&decrementCompositorProxiedPropertiesForElement, m_elementId,
m_compositorMutableProperties)); |
| 259 } | 259 } |
| 260 | 260 |
| 261 } // namespace blink | 261 } // namespace blink |
| OLD | NEW |