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
33namespace IPC {
34class Attachment;
35}
36
37namespace Messages {
38namespace WebInspector {
39
40static inline IPC::StringReference messageReceiverName()
41{
42 return IPC::StringReference("WebInspector");
43}
44
45class Show {
46public:
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
58private:
59 Arguments m_arguments;
60};
61
62class Close {
63public:
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
75private:
76 Arguments m_arguments;
77};
78
79class SetAttached {
80public:
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
97private:
98 Arguments m_arguments;
99};
100
101class ShowConsole {
102public:
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
114private:
115 Arguments m_arguments;
116};
117
118class ShowResources {
119public:
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
131private:
132 Arguments m_arguments;
133};
134
135class ShowTimelines {
136public:
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
148private:
149 Arguments m_arguments;
150};
151
152class ShowMainResourceForFrame {
153public:
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
170private:
171 Arguments m_arguments;
172};
173
174class OpenInNewTab {
175public:
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
192private:
193 Arguments m_arguments;
194};
195
196class StartPageProfiling {
197public:
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
209private:
210 Arguments m_arguments;
211};
212
213class StopPageProfiling {
214public:
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
226private:
227 Arguments m_arguments;
228};
229
230class StartElementSelection {
231public:
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
243private:
244 Arguments m_arguments;
245};
246
247class StopElementSelection {
248public:
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
260private:
261 Arguments m_arguments;
262};
263
264class SetFrontendConnection {
265public:
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
282private:
283 Arguments m_arguments;
284};
285
286} // namespace WebInspector
287} // namespace Messages
288