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" |
11 #include "core/dom/Element.h" | 11 #include "core/dom/Element.h" |
12 #include "core/geometry/DOMMatrix.h" | 12 #include "core/geometry/DOMMatrix.h" |
13 #include "platform/graphics/CompositorMutableState.h" | 13 #include "platform/graphics/CompositorMutableState.h" |
14 #include "platform/heap/Handle.h" | 14 #include "platform/heap/Handle.h" |
15 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
19 class DOMMatrix; | 19 class DOMMatrix; |
20 class ExceptionState; | 20 class ExceptionState; |
21 class ExecutionContext; | 21 class ExecutionContext; |
22 | 22 |
| 23 // Owned by the main thread or control thread. |
23 class CORE_EXPORT CompositorProxy final | 24 class CORE_EXPORT CompositorProxy final |
24 : public GarbageCollectedFinalized<CompositorProxy>, | 25 : public GarbageCollectedFinalized<CompositorProxy>, |
25 public ScriptWrappable { | 26 public ScriptWrappable { |
26 DEFINE_WRAPPERTYPEINFO(); | 27 DEFINE_WRAPPERTYPEINFO(); |
27 | 28 |
28 public: | 29 public: |
29 static CompositorProxy* create(ExecutionContext*, | 30 static CompositorProxy* create(ExecutionContext*, |
30 Element*, | 31 Element*, |
31 const Vector<String>& attributeArray, | 32 const Vector<String>& attributeArray, |
32 ExceptionState&); | 33 ExceptionState&); |
33 static CompositorProxy* create(ExecutionContext*, | 34 static CompositorProxy* create(ExecutionContext*, |
34 uint64_t element, | 35 uint64_t element, |
35 uint32_t compositorMutableProperties); | 36 uint32_t compositorMutableProperties); |
36 virtual ~CompositorProxy(); | 37 virtual ~CompositorProxy(); |
37 | 38 |
38 DEFINE_INLINE_TRACE() {} | 39 DECLARE_TRACE(); |
39 | 40 |
40 uint64_t elementId() const { return m_elementId; } | 41 uint64_t elementId() const { return m_elementId; } |
41 uint32_t compositorMutableProperties() const { | 42 uint32_t compositorMutableProperties() const { |
42 return m_compositorMutableProperties; | 43 return m_compositorMutableProperties; |
43 } | 44 } |
44 bool supports(const String& attribute) const; | 45 bool supports(const String& attribute) const; |
45 | 46 |
46 bool initialized() const { return m_connected && m_state.get(); } | 47 bool initialized() const { return m_connected && m_state.get(); } |
47 bool connected() const { return m_connected; } | 48 bool connected() const { return m_connected; } |
48 void disconnect(); | 49 void disconnect(); |
(...skipping 19 matching lines...) Expand all Loading... |
68 | 69 |
69 private: | 70 private: |
70 bool raiseExceptionIfNotMutable(uint32_t compositorMutableProperty, | 71 bool raiseExceptionIfNotMutable(uint32_t compositorMutableProperty, |
71 ExceptionState&) const; | 72 ExceptionState&) const; |
72 void disconnectInternal(); | 73 void disconnectInternal(); |
73 | 74 |
74 const uint64_t m_elementId = 0; | 75 const uint64_t m_elementId = 0; |
75 const uint32_t m_compositorMutableProperties = 0; | 76 const uint32_t m_compositorMutableProperties = 0; |
76 | 77 |
77 bool m_connected = true; | 78 bool m_connected = true; |
78 CrossThreadPersistent<CompositorProxyClient> m_client; | 79 Member<CompositorProxyClient> m_client; |
79 std::unique_ptr<CompositorMutableState> m_state; | 80 std::unique_ptr<CompositorMutableState> m_state; |
80 }; | 81 }; |
81 | 82 |
82 } // namespace blink | 83 } // namespace blink |
83 | 84 |
84 #endif // CompositorProxy_h | 85 #endif // CompositorProxy_h |
OLD | NEW |