| 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 | |
| 34 | namespace Messages { |
| 35 | namespace WebInspectorUI { |
| 36 | |
| 37 | static inline IPC::StringReference messageReceiverName() |
| 38 | { |
| 39 | return IPC::StringReference("WebInspectorUI" ); |
| 40 | } |
| 41 | |
| 42 | class EstablishConnection { |
| 43 | public: |
| 44 | typedef std::tuple<uint64_t, bool, const unsigned&> Arguments; |
| 45 | |
| 46 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 47 | static IPC::StringReference name() { return IPC::StringReference("EstablishConnection" ); } |
| 48 | static const bool isSync = false; |
| 49 | |
| 50 | EstablishConnection(uint64_t inspectedPageIdentifier, bool underTest, const unsigned& inspectionLevel) |
| 51 | : m_arguments(inspectedPageIdentifier, underTest, inspectionLevel) |
| 52 | { |
| 53 | } |
| 54 | |
| 55 | const Arguments& arguments() const |
| 56 | { |
| 57 | return m_arguments; |
| 58 | } |
| 59 | |
| 60 | private: |
| 61 | Arguments m_arguments; |
| 62 | }; |
| 63 | |
| 64 | class UpdateConnection { |
| 65 | public: |
| 66 | typedef std::tuple<> Arguments; |
| 67 | |
| 68 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 69 | static IPC::StringReference name() { return IPC::StringReference("UpdateConnection" ); } |
| 70 | static const bool isSync = false; |
| 71 | |
| 72 | const Arguments& arguments() const |
| 73 | { |
| 74 | return m_arguments; |
| 75 | } |
| 76 | |
| 77 | private: |
| 78 | Arguments m_arguments; |
| 79 | }; |
| 80 | |
| 81 | class AttachedBottom { |
| 82 | public: |
| 83 | typedef std::tuple<> Arguments; |
| 84 | |
| 85 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 86 | static IPC::StringReference name() { return IPC::StringReference("AttachedBottom" ); } |
| 87 | static const bool isSync = false; |
| 88 | |
| 89 | const Arguments& arguments() const |
| 90 | { |
| 91 | return m_arguments; |
| 92 | } |
| 93 | |
| 94 | private: |
| 95 | Arguments m_arguments; |
| 96 | }; |
| 97 | |
| 98 | class AttachedRight { |
| 99 | public: |
| 100 | typedef std::tuple<> Arguments; |
| 101 | |
| 102 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 103 | static IPC::StringReference name() { return IPC::StringReference("AttachedRight" ); } |
| 104 | static const bool isSync = false; |
| 105 | |
| 106 | const Arguments& arguments() const |
| 107 | { |
| 108 | return m_arguments; |
| 109 | } |
| 110 | |
| 111 | private: |
| 112 | Arguments m_arguments; |
| 113 | }; |
| 114 | |
| 115 | class AttachedLeft { |
| 116 | public: |
| 117 | typedef std::tuple<> Arguments; |
| 118 | |
| 119 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 120 | static IPC::StringReference name() { return IPC::StringReference("AttachedLeft" ); } |
| 121 | static const bool isSync = false; |
| 122 | |
| 123 | const Arguments& arguments() const |
| 124 | { |
| 125 | return m_arguments; |
| 126 | } |
| 127 | |
| 128 | private: |
| 129 | Arguments m_arguments; |
| 130 | }; |
| 131 | |
| 132 | class Detached { |
| 133 | public: |
| 134 | typedef std::tuple<> Arguments; |
| 135 | |
| 136 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 137 | static IPC::StringReference name() { return IPC::StringReference("Detached" ); } |
| 138 | static const bool isSync = false; |
| 139 | |
| 140 | const Arguments& arguments() const |
| 141 | { |
| 142 | return m_arguments; |
| 143 | } |
| 144 | |
| 145 | private: |
| 146 | Arguments m_arguments; |
| 147 | }; |
| 148 | |
| 149 | class SetDockingUnavailable { |
| 150 | public: |
| 151 | typedef std::tuple<bool> Arguments; |
| 152 | |
| 153 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 154 | static IPC::StringReference name() { return IPC::StringReference("SetDockingUnavailable" ); } |
| 155 | static const bool isSync = false; |
| 156 | |
| 157 | explicit SetDockingUnavailable(bool unavailable) |
| 158 | : m_arguments(unavailable) |
| 159 | { |
| 160 | } |
| 161 | |
| 162 | const Arguments& arguments() const |
| 163 | { |
| 164 | return m_arguments; |
| 165 | } |
| 166 | |
| 167 | private: |
| 168 | Arguments m_arguments; |
| 169 | }; |
| 170 | |
| 171 | class SetIsVisible { |
| 172 | public: |
| 173 | typedef std::tuple<bool> Arguments; |
| 174 | |
| 175 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 176 | static IPC::StringReference name() { return IPC::StringReference("SetIsVisible" ); } |
| 177 | static const bool isSync = false; |
| 178 | |
| 179 | explicit SetIsVisible(bool visible) |
| 180 | : m_arguments(visible) |
| 181 | { |
| 182 | } |
| 183 | |
| 184 | const Arguments& arguments() const |
| 185 | { |
| 186 | return m_arguments; |
| 187 | } |
| 188 | |
| 189 | private: |
| 190 | Arguments m_arguments; |
| 191 | }; |
| 192 | |
| 193 | class ShowConsole { |
| 194 | public: |
| 195 | typedef std::tuple<> Arguments; |
| 196 | |
| 197 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 198 | static IPC::StringReference name() { return IPC::StringReference("ShowConsole" ); } |
| 199 | static const bool isSync = false; |
| 200 | |
| 201 | const Arguments& arguments() const |
| 202 | { |
| 203 | return m_arguments; |
| 204 | } |
| 205 | |
| 206 | private: |
| 207 | Arguments m_arguments; |
| 208 | }; |
| 209 | |
| 210 | class ShowResources { |
| 211 | public: |
| 212 | typedef std::tuple<> Arguments; |
| 213 | |
| 214 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 215 | static IPC::StringReference name() { return IPC::StringReference("ShowResources" ); } |
| 216 | static const bool isSync = false; |
| 217 | |
| 218 | const Arguments& arguments() const |
| 219 | { |
| 220 | return m_arguments; |
| 221 | } |
| 222 | |
| 223 | private: |
| 224 | Arguments m_arguments; |
| 225 | }; |
| 226 | |
| 227 | class ShowTimelines { |
| 228 | public: |
| 229 | typedef std::tuple<> Arguments; |
| 230 | |
| 231 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 232 | static IPC::StringReference name() { return IPC::StringReference("ShowTimelines" ); } |
| 233 | static const bool isSync = false; |
| 234 | |
| 235 | const Arguments& arguments() const |
| 236 | { |
| 237 | return m_arguments; |
| 238 | } |
| 239 | |
| 240 | private: |
| 241 | Arguments m_arguments; |
| 242 | }; |
| 243 | |
| 244 | class ShowMainResourceForFrame { |
| 245 | public: |
| 246 | typedef std::tuple<const String&> Arguments; |
| 247 | |
| 248 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 249 | static IPC::StringReference name() { return IPC::StringReference("ShowMainResourceForFrame" ); } |
| 250 | static const bool isSync = false; |
| 251 | |
| 252 | explicit ShowMainResourceForFrame(const String& frameIdentifier) |
| 253 | : m_arguments(frameIdentifier) |
| 254 | { |
| 255 | } |
| 256 | |
| 257 | const Arguments& arguments() const |
| 258 | { |
| 259 | return m_arguments; |
| 260 | } |
| 261 | |
| 262 | private: |
| 263 | Arguments m_arguments; |
| 264 | }; |
| 265 | |
| 266 | class StartPageProfiling { |
| 267 | public: |
| 268 | typedef std::tuple<> Arguments; |
| 269 | |
| 270 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 271 | static IPC::StringReference name() { return IPC::StringReference("StartPageProfiling" ); } |
| 272 | static const bool isSync = false; |
| 273 | |
| 274 | const Arguments& arguments() const |
| 275 | { |
| 276 | return m_arguments; |
| 277 | } |
| 278 | |
| 279 | private: |
| 280 | Arguments m_arguments; |
| 281 | }; |
| 282 | |
| 283 | class StopPageProfiling { |
| 284 | public: |
| 285 | typedef std::tuple<> Arguments; |
| 286 | |
| 287 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 288 | static IPC::StringReference name() { return IPC::StringReference("StopPageProfiling" ); } |
| 289 | static const bool isSync = false; |
| 290 | |
| 291 | const Arguments& arguments() const |
| 292 | { |
| 293 | return m_arguments; |
| 294 | } |
| 295 | |
| 296 | private: |
| 297 | Arguments m_arguments; |
| 298 | }; |
| 299 | |
| 300 | class StartElementSelection { |
| 301 | public: |
| 302 | typedef std::tuple<> Arguments; |
| 303 | |
| 304 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 305 | static IPC::StringReference name() { return IPC::StringReference("StartElementSelection" ); } |
| 306 | static const bool isSync = false; |
| 307 | |
| 308 | const Arguments& arguments() const |
| 309 | { |
| 310 | return m_arguments; |
| 311 | } |
| 312 | |
| 313 | private: |
| 314 | Arguments m_arguments; |
| 315 | }; |
| 316 | |
| 317 | class StopElementSelection { |
| 318 | public: |
| 319 | typedef std::tuple<> Arguments; |
| 320 | |
| 321 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 322 | static IPC::StringReference name() { return IPC::StringReference("StopElementSelection" ); } |
| 323 | static const bool isSync = false; |
| 324 | |
| 325 | const Arguments& arguments() const |
| 326 | { |
| 327 | return m_arguments; |
| 328 | } |
| 329 | |
| 330 | private: |
| 331 | Arguments m_arguments; |
| 332 | }; |
| 333 | |
| 334 | class DidSave { |
| 335 | public: |
| 336 | typedef std::tuple<const String&> Arguments; |
| 337 | |
| 338 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 339 | static IPC::StringReference name() { return IPC::StringReference("DidSave" ); } |
| 340 | static const bool isSync = false; |
| 341 | |
| 342 | explicit DidSave(const String& url) |
| 343 | : m_arguments(url) |
| 344 | { |
| 345 | } |
| 346 | |
| 347 | const Arguments& arguments() const |
| 348 | { |
| 349 | return m_arguments; |
| 350 | } |
| 351 | |
| 352 | private: |
| 353 | Arguments m_arguments; |
| 354 | }; |
| 355 | |
| 356 | class DidAppend { |
| 357 | public: |
| 358 | typedef std::tuple<const String&> Arguments; |
| 359 | |
| 360 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 361 | static IPC::StringReference name() { return IPC::StringReference("DidAppend" ); } |
| 362 | static const bool isSync = false; |
| 363 | |
| 364 | explicit DidAppend(const String& url) |
| 365 | : m_arguments(url) |
| 366 | { |
| 367 | } |
| 368 | |
| 369 | const Arguments& arguments() const |
| 370 | { |
| 371 | return m_arguments; |
| 372 | } |
| 373 | |
| 374 | private: |
| 375 | Arguments m_arguments; |
| 376 | }; |
| 377 | |
| 378 | class SendMessageToFrontend { |
| 379 | public: |
| 380 | typedef std::tuple<const String&> Arguments; |
| 381 | |
| 382 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
| 383 | static IPC::StringReference name() { return IPC::StringReference("SendMessageToFrontend" ); } |
| 384 | static const bool isSync = false; |
| 385 | |
| 386 | explicit SendMessageToFrontend(const String& message) |
| 387 | : m_arguments(message) |
| 388 | { |
| 389 | } |
| 390 | |
| 391 | const Arguments& arguments() const |
| 392 | { |
| 393 | return m_arguments; |
| 394 | } |
| 395 | |
| 396 | private: |
| 397 | Arguments m_arguments; |
| 398 | }; |
| 399 | |
| 400 | } // namespace WebInspectorUI |
| 401 | } // namespace Messages |
| 402 | |