1 | /* |
2 | * Copyright (C) 2010-2018 Apple Inc. All rights reserved. |
3 | * |
4 | * Redistribution and use in source and binary forms, with or without |
5 | * modification, are permitted provided that the following conditions |
6 | * are met: |
7 | * 1. Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. |
9 | * 2. Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. |
12 | * |
13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND |
14 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
15 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
16 | * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR |
17 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
18 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
19 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
20 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
21 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
22 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 | */ |
24 | |
25 | #pragma once |
26 | |
27 | #include "ArgumentCoders.h" |
28 | #include "CallbackID.h" |
29 | #include "Connection.h" |
30 | #include <wtf/Forward.h> |
31 | #include <wtf/ThreadSafeRefCounted.h> |
32 | #include <wtf/Vector.h> |
33 | |
34 | namespace WebKit { |
35 | class UpdateInfo; |
36 | class LayerTreeContext; |
37 | } |
38 | |
39 | namespace Messages { |
40 | namespace DrawingAreaProxy { |
41 | |
42 | static inline IPC::StringReference messageReceiverName() |
43 | { |
44 | return IPC::StringReference("DrawingAreaProxy" ); |
45 | } |
46 | |
47 | class Update { |
48 | public: |
49 | typedef std::tuple<uint64_t, const WebKit::UpdateInfo&> Arguments; |
50 | |
51 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
52 | static IPC::StringReference name() { return IPC::StringReference("Update" ); } |
53 | static const bool isSync = false; |
54 | |
55 | Update(uint64_t stateID, const WebKit::UpdateInfo& updateInfo) |
56 | : m_arguments(stateID, updateInfo) |
57 | { |
58 | } |
59 | |
60 | const Arguments& arguments() const |
61 | { |
62 | return m_arguments; |
63 | } |
64 | |
65 | private: |
66 | Arguments m_arguments; |
67 | }; |
68 | |
69 | class DidUpdateBackingStoreState { |
70 | public: |
71 | typedef std::tuple<uint64_t, const WebKit::UpdateInfo&, const WebKit::LayerTreeContext&> Arguments; |
72 | |
73 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
74 | static IPC::StringReference name() { return IPC::StringReference("DidUpdateBackingStoreState" ); } |
75 | static const bool isSync = false; |
76 | |
77 | DidUpdateBackingStoreState(uint64_t backingStoreStateID, const WebKit::UpdateInfo& updateInfo, const WebKit::LayerTreeContext& context) |
78 | : m_arguments(backingStoreStateID, updateInfo, context) |
79 | { |
80 | } |
81 | |
82 | const Arguments& arguments() const |
83 | { |
84 | return m_arguments; |
85 | } |
86 | |
87 | private: |
88 | Arguments m_arguments; |
89 | }; |
90 | |
91 | class EnterAcceleratedCompositingMode { |
92 | public: |
93 | typedef std::tuple<uint64_t, const WebKit::LayerTreeContext&> Arguments; |
94 | |
95 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
96 | static IPC::StringReference name() { return IPC::StringReference("EnterAcceleratedCompositingMode" ); } |
97 | static const bool isSync = false; |
98 | |
99 | EnterAcceleratedCompositingMode(uint64_t backingStoreStateID, const WebKit::LayerTreeContext& context) |
100 | : m_arguments(backingStoreStateID, context) |
101 | { |
102 | } |
103 | |
104 | const Arguments& arguments() const |
105 | { |
106 | return m_arguments; |
107 | } |
108 | |
109 | private: |
110 | Arguments m_arguments; |
111 | }; |
112 | |
113 | class ExitAcceleratedCompositingMode { |
114 | public: |
115 | typedef std::tuple<uint64_t, const WebKit::UpdateInfo&> Arguments; |
116 | |
117 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
118 | static IPC::StringReference name() { return IPC::StringReference("ExitAcceleratedCompositingMode" ); } |
119 | static const bool isSync = false; |
120 | |
121 | ExitAcceleratedCompositingMode(uint64_t backingStoreStateID, const WebKit::UpdateInfo& updateInfo) |
122 | : m_arguments(backingStoreStateID, updateInfo) |
123 | { |
124 | } |
125 | |
126 | const Arguments& arguments() const |
127 | { |
128 | return m_arguments; |
129 | } |
130 | |
131 | private: |
132 | Arguments m_arguments; |
133 | }; |
134 | |
135 | class UpdateAcceleratedCompositingMode { |
136 | public: |
137 | typedef std::tuple<uint64_t, const WebKit::LayerTreeContext&> Arguments; |
138 | |
139 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
140 | static IPC::StringReference name() { return IPC::StringReference("UpdateAcceleratedCompositingMode" ); } |
141 | static const bool isSync = false; |
142 | |
143 | UpdateAcceleratedCompositingMode(uint64_t backingStoreStateID, const WebKit::LayerTreeContext& context) |
144 | : m_arguments(backingStoreStateID, context) |
145 | { |
146 | } |
147 | |
148 | const Arguments& arguments() const |
149 | { |
150 | return m_arguments; |
151 | } |
152 | |
153 | private: |
154 | Arguments m_arguments; |
155 | }; |
156 | |
157 | class DispatchPresentationCallbacksAfterFlushingLayers { |
158 | public: |
159 | typedef std::tuple<const Vector<WebKit::CallbackID>&> Arguments; |
160 | |
161 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
162 | static IPC::StringReference name() { return IPC::StringReference("DispatchPresentationCallbacksAfterFlushingLayers" ); } |
163 | static const bool isSync = false; |
164 | |
165 | explicit DispatchPresentationCallbacksAfterFlushingLayers(const Vector<WebKit::CallbackID>& callbackIDs) |
166 | : m_arguments(callbackIDs) |
167 | { |
168 | } |
169 | |
170 | const Arguments& arguments() const |
171 | { |
172 | return m_arguments; |
173 | } |
174 | |
175 | private: |
176 | Arguments m_arguments; |
177 | }; |
178 | |
179 | #if PLATFORM(COCOA) |
180 | class DidUpdateGeometry { |
181 | public: |
182 | typedef std::tuple<> Arguments; |
183 | |
184 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
185 | static IPC::StringReference name() { return IPC::StringReference("DidUpdateGeometry" ); } |
186 | static const bool isSync = false; |
187 | |
188 | const Arguments& arguments() const |
189 | { |
190 | return m_arguments; |
191 | } |
192 | |
193 | private: |
194 | Arguments m_arguments; |
195 | }; |
196 | #endif |
197 | |
198 | } // namespace DrawingAreaProxy |
199 | } // namespace Messages |
200 | |