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 WebCore { |
38 | class CertificateInfo; |
39 | class FloatRect; |
40 | } |
41 | |
42 | namespace Messages { |
43 | namespace WebInspectorProxy { |
44 | |
45 | static inline IPC::StringReference messageReceiverName() |
46 | { |
47 | return IPC::StringReference("WebInspectorProxy" ); |
48 | } |
49 | |
50 | class OpenLocalInspectorFrontend { |
51 | public: |
52 | typedef std::tuple<bool, bool> Arguments; |
53 | |
54 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
55 | static IPC::StringReference name() { return IPC::StringReference("OpenLocalInspectorFrontend" ); } |
56 | static const bool isSync = false; |
57 | |
58 | OpenLocalInspectorFrontend(bool canAttach, bool underTest) |
59 | : m_arguments(canAttach, underTest) |
60 | { |
61 | } |
62 | |
63 | const Arguments& arguments() const |
64 | { |
65 | return m_arguments; |
66 | } |
67 | |
68 | private: |
69 | Arguments m_arguments; |
70 | }; |
71 | |
72 | class SetFrontendConnection { |
73 | public: |
74 | typedef std::tuple<const IPC::Attachment&> Arguments; |
75 | |
76 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
77 | static IPC::StringReference name() { return IPC::StringReference("SetFrontendConnection" ); } |
78 | static const bool isSync = false; |
79 | |
80 | explicit SetFrontendConnection(const IPC::Attachment& connectionIdentifier) |
81 | : m_arguments(connectionIdentifier) |
82 | { |
83 | } |
84 | |
85 | const Arguments& arguments() const |
86 | { |
87 | return m_arguments; |
88 | } |
89 | |
90 | private: |
91 | Arguments m_arguments; |
92 | }; |
93 | |
94 | class SendMessageToBackend { |
95 | public: |
96 | typedef std::tuple<const String&> Arguments; |
97 | |
98 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
99 | static IPC::StringReference name() { return IPC::StringReference("SendMessageToBackend" ); } |
100 | static const bool isSync = false; |
101 | |
102 | explicit SendMessageToBackend(const String& message) |
103 | : m_arguments(message) |
104 | { |
105 | } |
106 | |
107 | const Arguments& arguments() const |
108 | { |
109 | return m_arguments; |
110 | } |
111 | |
112 | private: |
113 | Arguments m_arguments; |
114 | }; |
115 | |
116 | class FrontendLoaded { |
117 | public: |
118 | typedef std::tuple<> Arguments; |
119 | |
120 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
121 | static IPC::StringReference name() { return IPC::StringReference("FrontendLoaded" ); } |
122 | static const bool isSync = false; |
123 | |
124 | const Arguments& arguments() const |
125 | { |
126 | return m_arguments; |
127 | } |
128 | |
129 | private: |
130 | Arguments m_arguments; |
131 | }; |
132 | |
133 | class DidClose { |
134 | public: |
135 | typedef std::tuple<> Arguments; |
136 | |
137 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
138 | static IPC::StringReference name() { return IPC::StringReference("DidClose" ); } |
139 | static const bool isSync = false; |
140 | |
141 | const Arguments& arguments() const |
142 | { |
143 | return m_arguments; |
144 | } |
145 | |
146 | private: |
147 | Arguments m_arguments; |
148 | }; |
149 | |
150 | class BringToFront { |
151 | public: |
152 | typedef std::tuple<> Arguments; |
153 | |
154 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
155 | static IPC::StringReference name() { return IPC::StringReference("BringToFront" ); } |
156 | static const bool isSync = false; |
157 | |
158 | const Arguments& arguments() const |
159 | { |
160 | return m_arguments; |
161 | } |
162 | |
163 | private: |
164 | Arguments m_arguments; |
165 | }; |
166 | |
167 | class Reopen { |
168 | public: |
169 | typedef std::tuple<> Arguments; |
170 | |
171 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
172 | static IPC::StringReference name() { return IPC::StringReference("Reopen" ); } |
173 | static const bool isSync = false; |
174 | |
175 | const Arguments& arguments() const |
176 | { |
177 | return m_arguments; |
178 | } |
179 | |
180 | private: |
181 | Arguments m_arguments; |
182 | }; |
183 | |
184 | class InspectedURLChanged { |
185 | public: |
186 | typedef std::tuple<const String&> Arguments; |
187 | |
188 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
189 | static IPC::StringReference name() { return IPC::StringReference("InspectedURLChanged" ); } |
190 | static const bool isSync = false; |
191 | |
192 | explicit InspectedURLChanged(const String& urlString) |
193 | : m_arguments(urlString) |
194 | { |
195 | } |
196 | |
197 | const Arguments& arguments() const |
198 | { |
199 | return m_arguments; |
200 | } |
201 | |
202 | private: |
203 | Arguments m_arguments; |
204 | }; |
205 | |
206 | class ShowCertificate { |
207 | public: |
208 | typedef std::tuple<const WebCore::CertificateInfo&> Arguments; |
209 | |
210 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
211 | static IPC::StringReference name() { return IPC::StringReference("ShowCertificate" ); } |
212 | static const bool isSync = false; |
213 | |
214 | explicit ShowCertificate(const WebCore::CertificateInfo& certificateInfo) |
215 | : m_arguments(certificateInfo) |
216 | { |
217 | } |
218 | |
219 | const Arguments& arguments() const |
220 | { |
221 | return m_arguments; |
222 | } |
223 | |
224 | private: |
225 | Arguments m_arguments; |
226 | }; |
227 | |
228 | class ElementSelectionChanged { |
229 | public: |
230 | typedef std::tuple<bool> Arguments; |
231 | |
232 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
233 | static IPC::StringReference name() { return IPC::StringReference("ElementSelectionChanged" ); } |
234 | static const bool isSync = false; |
235 | |
236 | explicit ElementSelectionChanged(bool active) |
237 | : m_arguments(active) |
238 | { |
239 | } |
240 | |
241 | const Arguments& arguments() const |
242 | { |
243 | return m_arguments; |
244 | } |
245 | |
246 | private: |
247 | Arguments m_arguments; |
248 | }; |
249 | |
250 | class Save { |
251 | public: |
252 | typedef std::tuple<const String&, const String&, bool, bool> Arguments; |
253 | |
254 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
255 | static IPC::StringReference name() { return IPC::StringReference("Save" ); } |
256 | static const bool isSync = false; |
257 | |
258 | Save(const String& filename, const String& content, bool base64Encoded, bool forceSaveAs) |
259 | : m_arguments(filename, content, base64Encoded, forceSaveAs) |
260 | { |
261 | } |
262 | |
263 | const Arguments& arguments() const |
264 | { |
265 | return m_arguments; |
266 | } |
267 | |
268 | private: |
269 | Arguments m_arguments; |
270 | }; |
271 | |
272 | class Append { |
273 | public: |
274 | typedef std::tuple<const String&, const String&> Arguments; |
275 | |
276 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
277 | static IPC::StringReference name() { return IPC::StringReference("Append" ); } |
278 | static const bool isSync = false; |
279 | |
280 | Append(const String& filename, const String& content) |
281 | : m_arguments(filename, content) |
282 | { |
283 | } |
284 | |
285 | const Arguments& arguments() const |
286 | { |
287 | return m_arguments; |
288 | } |
289 | |
290 | private: |
291 | Arguments m_arguments; |
292 | }; |
293 | |
294 | class AttachBottom { |
295 | public: |
296 | typedef std::tuple<> Arguments; |
297 | |
298 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
299 | static IPC::StringReference name() { return IPC::StringReference("AttachBottom" ); } |
300 | static const bool isSync = false; |
301 | |
302 | const Arguments& arguments() const |
303 | { |
304 | return m_arguments; |
305 | } |
306 | |
307 | private: |
308 | Arguments m_arguments; |
309 | }; |
310 | |
311 | class AttachRight { |
312 | public: |
313 | typedef std::tuple<> Arguments; |
314 | |
315 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
316 | static IPC::StringReference name() { return IPC::StringReference("AttachRight" ); } |
317 | static const bool isSync = false; |
318 | |
319 | const Arguments& arguments() const |
320 | { |
321 | return m_arguments; |
322 | } |
323 | |
324 | private: |
325 | Arguments m_arguments; |
326 | }; |
327 | |
328 | class AttachLeft { |
329 | public: |
330 | typedef std::tuple<> Arguments; |
331 | |
332 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
333 | static IPC::StringReference name() { return IPC::StringReference("AttachLeft" ); } |
334 | static const bool isSync = false; |
335 | |
336 | const Arguments& arguments() const |
337 | { |
338 | return m_arguments; |
339 | } |
340 | |
341 | private: |
342 | Arguments m_arguments; |
343 | }; |
344 | |
345 | class Detach { |
346 | public: |
347 | typedef std::tuple<> Arguments; |
348 | |
349 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
350 | static IPC::StringReference name() { return IPC::StringReference("Detach" ); } |
351 | static const bool isSync = false; |
352 | |
353 | const Arguments& arguments() const |
354 | { |
355 | return m_arguments; |
356 | } |
357 | |
358 | private: |
359 | Arguments m_arguments; |
360 | }; |
361 | |
362 | class AttachAvailabilityChanged { |
363 | public: |
364 | typedef std::tuple<bool> Arguments; |
365 | |
366 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
367 | static IPC::StringReference name() { return IPC::StringReference("AttachAvailabilityChanged" ); } |
368 | static const bool isSync = false; |
369 | |
370 | explicit AttachAvailabilityChanged(bool available) |
371 | : m_arguments(available) |
372 | { |
373 | } |
374 | |
375 | const Arguments& arguments() const |
376 | { |
377 | return m_arguments; |
378 | } |
379 | |
380 | private: |
381 | Arguments m_arguments; |
382 | }; |
383 | |
384 | class SetAttachedWindowHeight { |
385 | public: |
386 | typedef std::tuple<const unsigned&> Arguments; |
387 | |
388 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
389 | static IPC::StringReference name() { return IPC::StringReference("SetAttachedWindowHeight" ); } |
390 | static const bool isSync = false; |
391 | |
392 | explicit SetAttachedWindowHeight(const unsigned& height) |
393 | : m_arguments(height) |
394 | { |
395 | } |
396 | |
397 | const Arguments& arguments() const |
398 | { |
399 | return m_arguments; |
400 | } |
401 | |
402 | private: |
403 | Arguments m_arguments; |
404 | }; |
405 | |
406 | class SetAttachedWindowWidth { |
407 | public: |
408 | typedef std::tuple<const unsigned&> Arguments; |
409 | |
410 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
411 | static IPC::StringReference name() { return IPC::StringReference("SetAttachedWindowWidth" ); } |
412 | static const bool isSync = false; |
413 | |
414 | explicit SetAttachedWindowWidth(const unsigned& width) |
415 | : m_arguments(width) |
416 | { |
417 | } |
418 | |
419 | const Arguments& arguments() const |
420 | { |
421 | return m_arguments; |
422 | } |
423 | |
424 | private: |
425 | Arguments m_arguments; |
426 | }; |
427 | |
428 | class SetSheetRect { |
429 | public: |
430 | typedef std::tuple<const WebCore::FloatRect&> Arguments; |
431 | |
432 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
433 | static IPC::StringReference name() { return IPC::StringReference("SetSheetRect" ); } |
434 | static const bool isSync = false; |
435 | |
436 | explicit SetSheetRect(const WebCore::FloatRect& rect) |
437 | : m_arguments(rect) |
438 | { |
439 | } |
440 | |
441 | const Arguments& arguments() const |
442 | { |
443 | return m_arguments; |
444 | } |
445 | |
446 | private: |
447 | Arguments m_arguments; |
448 | }; |
449 | |
450 | class StartWindowDrag { |
451 | public: |
452 | typedef std::tuple<> Arguments; |
453 | |
454 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
455 | static IPC::StringReference name() { return IPC::StringReference("StartWindowDrag" ); } |
456 | static const bool isSync = false; |
457 | |
458 | const Arguments& arguments() const |
459 | { |
460 | return m_arguments; |
461 | } |
462 | |
463 | private: |
464 | Arguments m_arguments; |
465 | }; |
466 | |
467 | } // namespace WebInspectorProxy |
468 | } // namespace Messages |
469 | |