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 "Connection.h" |
29 | #include <wtf/Forward.h> |
30 | #include <wtf/ThreadSafeRefCounted.h> |
31 | #include <wtf/text/WTFString.h> |
32 | |
33 | namespace IPC { |
34 | class Attachment; |
35 | } |
36 | |
37 | namespace Messages { |
38 | namespace WebInspector { |
39 | |
40 | static inline IPC::StringReference messageReceiverName() |
41 | { |
42 | return IPC::StringReference("WebInspector" ); |
43 | } |
44 | |
45 | class Show { |
46 | public: |
47 | typedef std::tuple<> Arguments; |
48 | |
49 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
50 | static IPC::StringReference name() { return IPC::StringReference("Show" ); } |
51 | static const bool isSync = false; |
52 | |
53 | const Arguments& arguments() const |
54 | { |
55 | return m_arguments; |
56 | } |
57 | |
58 | private: |
59 | Arguments m_arguments; |
60 | }; |
61 | |
62 | class Close { |
63 | public: |
64 | typedef std::tuple<> Arguments; |
65 | |
66 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
67 | static IPC::StringReference name() { return IPC::StringReference("Close" ); } |
68 | static const bool isSync = false; |
69 | |
70 | const Arguments& arguments() const |
71 | { |
72 | return m_arguments; |
73 | } |
74 | |
75 | private: |
76 | Arguments m_arguments; |
77 | }; |
78 | |
79 | class SetAttached { |
80 | public: |
81 | typedef std::tuple<bool> Arguments; |
82 | |
83 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
84 | static IPC::StringReference name() { return IPC::StringReference("SetAttached" ); } |
85 | static const bool isSync = false; |
86 | |
87 | explicit SetAttached(bool attached) |
88 | : m_arguments(attached) |
89 | { |
90 | } |
91 | |
92 | const Arguments& arguments() const |
93 | { |
94 | return m_arguments; |
95 | } |
96 | |
97 | private: |
98 | Arguments m_arguments; |
99 | }; |
100 | |
101 | class ShowConsole { |
102 | public: |
103 | typedef std::tuple<> Arguments; |
104 | |
105 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
106 | static IPC::StringReference name() { return IPC::StringReference("ShowConsole" ); } |
107 | static const bool isSync = false; |
108 | |
109 | const Arguments& arguments() const |
110 | { |
111 | return m_arguments; |
112 | } |
113 | |
114 | private: |
115 | Arguments m_arguments; |
116 | }; |
117 | |
118 | class ShowResources { |
119 | public: |
120 | typedef std::tuple<> Arguments; |
121 | |
122 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
123 | static IPC::StringReference name() { return IPC::StringReference("ShowResources" ); } |
124 | static const bool isSync = false; |
125 | |
126 | const Arguments& arguments() const |
127 | { |
128 | return m_arguments; |
129 | } |
130 | |
131 | private: |
132 | Arguments m_arguments; |
133 | }; |
134 | |
135 | class ShowTimelines { |
136 | public: |
137 | typedef std::tuple<> Arguments; |
138 | |
139 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
140 | static IPC::StringReference name() { return IPC::StringReference("ShowTimelines" ); } |
141 | static const bool isSync = false; |
142 | |
143 | const Arguments& arguments() const |
144 | { |
145 | return m_arguments; |
146 | } |
147 | |
148 | private: |
149 | Arguments m_arguments; |
150 | }; |
151 | |
152 | class ShowMainResourceForFrame { |
153 | public: |
154 | typedef std::tuple<uint64_t> Arguments; |
155 | |
156 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
157 | static IPC::StringReference name() { return IPC::StringReference("ShowMainResourceForFrame" ); } |
158 | static const bool isSync = false; |
159 | |
160 | explicit ShowMainResourceForFrame(uint64_t frameIdentifier) |
161 | : m_arguments(frameIdentifier) |
162 | { |
163 | } |
164 | |
165 | const Arguments& arguments() const |
166 | { |
167 | return m_arguments; |
168 | } |
169 | |
170 | private: |
171 | Arguments m_arguments; |
172 | }; |
173 | |
174 | class OpenInNewTab { |
175 | public: |
176 | typedef std::tuple<const String&> Arguments; |
177 | |
178 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
179 | static IPC::StringReference name() { return IPC::StringReference("OpenInNewTab" ); } |
180 | static const bool isSync = false; |
181 | |
182 | explicit OpenInNewTab(const String& url) |
183 | : m_arguments(url) |
184 | { |
185 | } |
186 | |
187 | const Arguments& arguments() const |
188 | { |
189 | return m_arguments; |
190 | } |
191 | |
192 | private: |
193 | Arguments m_arguments; |
194 | }; |
195 | |
196 | class StartPageProfiling { |
197 | public: |
198 | typedef std::tuple<> Arguments; |
199 | |
200 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
201 | static IPC::StringReference name() { return IPC::StringReference("StartPageProfiling" ); } |
202 | static const bool isSync = false; |
203 | |
204 | const Arguments& arguments() const |
205 | { |
206 | return m_arguments; |
207 | } |
208 | |
209 | private: |
210 | Arguments m_arguments; |
211 | }; |
212 | |
213 | class StopPageProfiling { |
214 | public: |
215 | typedef std::tuple<> Arguments; |
216 | |
217 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
218 | static IPC::StringReference name() { return IPC::StringReference("StopPageProfiling" ); } |
219 | static const bool isSync = false; |
220 | |
221 | const Arguments& arguments() const |
222 | { |
223 | return m_arguments; |
224 | } |
225 | |
226 | private: |
227 | Arguments m_arguments; |
228 | }; |
229 | |
230 | class StartElementSelection { |
231 | public: |
232 | typedef std::tuple<> Arguments; |
233 | |
234 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
235 | static IPC::StringReference name() { return IPC::StringReference("StartElementSelection" ); } |
236 | static const bool isSync = false; |
237 | |
238 | const Arguments& arguments() const |
239 | { |
240 | return m_arguments; |
241 | } |
242 | |
243 | private: |
244 | Arguments m_arguments; |
245 | }; |
246 | |
247 | class StopElementSelection { |
248 | public: |
249 | typedef std::tuple<> Arguments; |
250 | |
251 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
252 | static IPC::StringReference name() { return IPC::StringReference("StopElementSelection" ); } |
253 | static const bool isSync = false; |
254 | |
255 | const Arguments& arguments() const |
256 | { |
257 | return m_arguments; |
258 | } |
259 | |
260 | private: |
261 | Arguments m_arguments; |
262 | }; |
263 | |
264 | class SetFrontendConnection { |
265 | public: |
266 | typedef std::tuple<const IPC::Attachment&> Arguments; |
267 | |
268 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
269 | static IPC::StringReference name() { return IPC::StringReference("SetFrontendConnection" ); } |
270 | static const bool isSync = false; |
271 | |
272 | explicit SetFrontendConnection(const IPC::Attachment& connectionIdentifier) |
273 | : m_arguments(connectionIdentifier) |
274 | { |
275 | } |
276 | |
277 | const Arguments& arguments() const |
278 | { |
279 | return m_arguments; |
280 | } |
281 | |
282 | private: |
283 | Arguments m_arguments; |
284 | }; |
285 | |
286 | } // namespace WebInspector |
287 | } // namespace Messages |
288 | |