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 WebCore { |
34 | class CertificateInfo; |
35 | class FloatRect; |
36 | } |
37 | |
38 | namespace Messages { |
39 | namespace RemoteWebInspectorProxy { |
40 | |
41 | static inline IPC::StringReference messageReceiverName() |
42 | { |
43 | return IPC::StringReference("RemoteWebInspectorProxy" ); |
44 | } |
45 | |
46 | class FrontendDidClose { |
47 | public: |
48 | typedef std::tuple<> Arguments; |
49 | |
50 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
51 | static IPC::StringReference name() { return IPC::StringReference("FrontendDidClose" ); } |
52 | static const bool isSync = false; |
53 | |
54 | const Arguments& arguments() const |
55 | { |
56 | return m_arguments; |
57 | } |
58 | |
59 | private: |
60 | Arguments m_arguments; |
61 | }; |
62 | |
63 | class Reopen { |
64 | public: |
65 | typedef std::tuple<> Arguments; |
66 | |
67 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
68 | static IPC::StringReference name() { return IPC::StringReference("Reopen" ); } |
69 | static const bool isSync = false; |
70 | |
71 | const Arguments& arguments() const |
72 | { |
73 | return m_arguments; |
74 | } |
75 | |
76 | private: |
77 | Arguments m_arguments; |
78 | }; |
79 | |
80 | class BringToFront { |
81 | public: |
82 | typedef std::tuple<> Arguments; |
83 | |
84 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
85 | static IPC::StringReference name() { return IPC::StringReference("BringToFront" ); } |
86 | static const bool isSync = false; |
87 | |
88 | const Arguments& arguments() const |
89 | { |
90 | return m_arguments; |
91 | } |
92 | |
93 | private: |
94 | Arguments m_arguments; |
95 | }; |
96 | |
97 | class Save { |
98 | public: |
99 | typedef std::tuple<const String&, const String&, bool, bool> Arguments; |
100 | |
101 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
102 | static IPC::StringReference name() { return IPC::StringReference("Save" ); } |
103 | static const bool isSync = false; |
104 | |
105 | Save(const String& filename, const String& content, bool base64Encoded, bool forceSaveAs) |
106 | : m_arguments(filename, content, base64Encoded, forceSaveAs) |
107 | { |
108 | } |
109 | |
110 | const Arguments& arguments() const |
111 | { |
112 | return m_arguments; |
113 | } |
114 | |
115 | private: |
116 | Arguments m_arguments; |
117 | }; |
118 | |
119 | class Append { |
120 | public: |
121 | typedef std::tuple<const String&, const String&> Arguments; |
122 | |
123 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
124 | static IPC::StringReference name() { return IPC::StringReference("Append" ); } |
125 | static const bool isSync = false; |
126 | |
127 | Append(const String& filename, const String& content) |
128 | : m_arguments(filename, content) |
129 | { |
130 | } |
131 | |
132 | const Arguments& arguments() const |
133 | { |
134 | return m_arguments; |
135 | } |
136 | |
137 | private: |
138 | Arguments m_arguments; |
139 | }; |
140 | |
141 | class SetSheetRect { |
142 | public: |
143 | typedef std::tuple<const WebCore::FloatRect&> Arguments; |
144 | |
145 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
146 | static IPC::StringReference name() { return IPC::StringReference("SetSheetRect" ); } |
147 | static const bool isSync = false; |
148 | |
149 | explicit SetSheetRect(const WebCore::FloatRect& rect) |
150 | : m_arguments(rect) |
151 | { |
152 | } |
153 | |
154 | const Arguments& arguments() const |
155 | { |
156 | return m_arguments; |
157 | } |
158 | |
159 | private: |
160 | Arguments m_arguments; |
161 | }; |
162 | |
163 | class StartWindowDrag { |
164 | public: |
165 | typedef std::tuple<> Arguments; |
166 | |
167 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
168 | static IPC::StringReference name() { return IPC::StringReference("StartWindowDrag" ); } |
169 | static const bool isSync = false; |
170 | |
171 | const Arguments& arguments() const |
172 | { |
173 | return m_arguments; |
174 | } |
175 | |
176 | private: |
177 | Arguments m_arguments; |
178 | }; |
179 | |
180 | class OpenInNewTab { |
181 | public: |
182 | typedef std::tuple<const String&> Arguments; |
183 | |
184 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
185 | static IPC::StringReference name() { return IPC::StringReference("OpenInNewTab" ); } |
186 | static const bool isSync = false; |
187 | |
188 | explicit OpenInNewTab(const String& url) |
189 | : m_arguments(url) |
190 | { |
191 | } |
192 | |
193 | const Arguments& arguments() const |
194 | { |
195 | return m_arguments; |
196 | } |
197 | |
198 | private: |
199 | Arguments m_arguments; |
200 | }; |
201 | |
202 | class ShowCertificate { |
203 | public: |
204 | typedef std::tuple<const WebCore::CertificateInfo&> Arguments; |
205 | |
206 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
207 | static IPC::StringReference name() { return IPC::StringReference("ShowCertificate" ); } |
208 | static const bool isSync = false; |
209 | |
210 | explicit ShowCertificate(const WebCore::CertificateInfo& certificateInfo) |
211 | : m_arguments(certificateInfo) |
212 | { |
213 | } |
214 | |
215 | const Arguments& arguments() const |
216 | { |
217 | return m_arguments; |
218 | } |
219 | |
220 | private: |
221 | Arguments m_arguments; |
222 | }; |
223 | |
224 | class SendMessageToBackend { |
225 | public: |
226 | typedef std::tuple<const String&> Arguments; |
227 | |
228 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
229 | static IPC::StringReference name() { return IPC::StringReference("SendMessageToBackend" ); } |
230 | static const bool isSync = false; |
231 | |
232 | explicit SendMessageToBackend(const String& message) |
233 | : m_arguments(message) |
234 | { |
235 | } |
236 | |
237 | const Arguments& arguments() const |
238 | { |
239 | return m_arguments; |
240 | } |
241 | |
242 | private: |
243 | Arguments m_arguments; |
244 | }; |
245 | |
246 | } // namespace RemoteWebInspectorProxy |
247 | } // namespace Messages |
248 | |