| 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 #ifndef CompositorProxy_h | 5 #ifndef CompositorProxy_h |
| 6 #define CompositorProxy_h | 6 #define CompositorProxy_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
| 10 #include "core/dom/CompositorProxyClient.h" | 10 #include "core/dom/CompositorProxyClient.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 : public GarbageCollectedFinalized<CompositorProxy>, | 24 : public GarbageCollectedFinalized<CompositorProxy>, |
| 25 public ScriptWrappable { | 25 public ScriptWrappable { |
| 26 DEFINE_WRAPPERTYPEINFO(); | 26 DEFINE_WRAPPERTYPEINFO(); |
| 27 | 27 |
| 28 public: | 28 public: |
| 29 static CompositorProxy* create(ExecutionContext*, | 29 static CompositorProxy* create(ExecutionContext*, |
| 30 Element*, | 30 Element*, |
| 31 const Vector<String>& attributeArray, | 31 const Vector<String>& attributeArray, |
| 32 ExceptionState&); | 32 ExceptionState&); |
| 33 static CompositorProxy* create(ExecutionContext*, | 33 static CompositorProxy* create(ExecutionContext*, |
| 34 uint64_t element, | 34 uint64_t elementId, |
| 35 uint64_t scrollingNodeId, |
| 35 uint32_t compositorMutableProperties); | 36 uint32_t compositorMutableProperties); |
| 36 virtual ~CompositorProxy(); | 37 virtual ~CompositorProxy(); |
| 37 | 38 |
| 38 DEFINE_INLINE_TRACE() {} | 39 DEFINE_INLINE_TRACE() {} |
| 39 | 40 |
| 40 uint64_t elementId() const { return m_elementId; } | 41 uint64_t elementId() const { return m_elementId; } |
| 42 uint64_t scrollingNodeId() const { return m_scrollingNodeId; } |
| 41 uint32_t compositorMutableProperties() const { | 43 uint32_t compositorMutableProperties() const { |
| 42 return m_compositorMutableProperties; | 44 return m_compositorMutableProperties; |
| 43 } | 45 } |
| 44 bool supports(const String& attribute) const; | 46 bool supports(const String& attribute) const; |
| 45 | 47 |
| 46 bool initialized() const { return m_connected && m_state.get(); } | 48 bool initialized() const { return m_connected && m_state.get(); } |
| 47 bool connected() const { return m_connected; } | 49 bool connected() const { return m_connected; } |
| 48 void disconnect(); | 50 void disconnect(); |
| 49 | 51 |
| 50 double opacity(ExceptionState&) const; | 52 double opacity(ExceptionState&) const; |
| 51 double scrollLeft(ExceptionState&) const; | 53 double scrollLeft(ExceptionState&) const; |
| 52 double scrollTop(ExceptionState&) const; | 54 double scrollTop(ExceptionState&) const; |
| 53 DOMMatrix* transform(ExceptionState&) const; | 55 DOMMatrix* transform(ExceptionState&) const; |
| 54 | 56 |
| 55 void setOpacity(double, ExceptionState&); | 57 void setOpacity(double, ExceptionState&); |
| 56 void setScrollLeft(double, ExceptionState&); | 58 void setScrollLeft(double, ExceptionState&); |
| 57 void setScrollTop(double, ExceptionState&); | 59 void setScrollTop(double, ExceptionState&); |
| 58 void setTransform(DOMMatrix*, ExceptionState&); | 60 void setTransform(DOMMatrix*, ExceptionState&); |
| 59 | 61 |
| 60 void takeCompositorMutableState(std::unique_ptr<CompositorMutableState>); | 62 void takeCompositorMutableState(std::unique_ptr<CompositorMutableState>); |
| 61 | 63 |
| 62 protected: | 64 protected: |
| 63 CompositorProxy(uint64_t elementId, uint32_t compositorMutableProperties); | 65 CompositorProxy(uint64_t elementId, |
| 64 CompositorProxy(Element&, const Vector<String>& attributeArray); | 66 uint64_t scrollingNodeId, |
| 67 uint32_t compositorMutableProperties); |
| 68 CompositorProxy(Element&, |
| 69 Node& scrollingNode, |
| 70 const Vector<String>& attributeArray); |
| 65 CompositorProxy(uint64_t element, | 71 CompositorProxy(uint64_t element, |
| 72 uint64_t scrollingNodeId, |
| 66 uint32_t compositorMutableProperties, | 73 uint32_t compositorMutableProperties, |
| 67 CompositorProxyClient*); | 74 CompositorProxyClient*); |
| 68 | 75 |
| 69 private: | 76 private: |
| 70 bool raiseExceptionIfNotMutable(uint32_t compositorMutableProperty, | 77 bool raiseExceptionIfNotMutable(uint32_t compositorMutableProperty, |
| 71 ExceptionState&) const; | 78 ExceptionState&) const; |
| 72 void disconnectInternal(); | 79 void disconnectInternal(); |
| 73 | 80 |
| 74 const uint64_t m_elementId = 0; | 81 const uint64_t m_elementId = 0; |
| 82 const uint64_t m_scrollingNodeId = 0; |
| 75 const uint32_t m_compositorMutableProperties = 0; | 83 const uint32_t m_compositorMutableProperties = 0; |
| 76 | 84 |
| 77 bool m_connected = true; | 85 bool m_connected = true; |
| 78 CrossThreadPersistent<CompositorProxyClient> m_client; | 86 CrossThreadPersistent<CompositorProxyClient> m_client; |
| 79 std::unique_ptr<CompositorMutableState> m_state; | 87 std::unique_ptr<CompositorMutableState> m_state; |
| 80 }; | 88 }; |
| 81 | 89 |
| 82 } // namespace blink | 90 } // namespace blink |
| 83 | 91 |
| 84 #endif // CompositorProxy_h | 92 #endif // CompositorProxy_h |
| OLD | NEW |