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 "SandboxExtension.h"
30#include <WebCore/BlobPart.h>
31#include <WebCore/Cookie.h>
32#include <WebCore/NetworkLoadInformation.h>
33#include <WebCore/ProcessIdentifier.h>
34#include <WebCore/ResourceLoadStatistics.h>
35#include <WebCore/ServiceWorkerTypes.h>
36#include <wtf/Forward.h>
37#include <wtf/Optional.h>
38#include <wtf/ThreadSafeRefCounted.h>
39#include <wtf/Vector.h>
40#include <wtf/text/WTFString.h>
41
42namespace PAL {
43class SessionID;
44}
45
46namespace WebCore {
47class ResourceResponse;
48enum class StorageAccessWasGranted : bool;
49class NetworkLoadMetrics;
50struct SameSiteInfo;
51enum class StorageAccessPromptWasShown : bool;
52enum class IncludeSecureCookies : bool;
53class RegistrableDomain;
54class ResourceRequest;
55class ResourceError;
56}
57
58namespace WebKit {
59class NetworkResourceLoadParameters;
60class DownloadID;
61}
62
63namespace Messages {
64namespace NetworkConnectionToWebProcess {
65
66static inline IPC::StringReference messageReceiverName()
67{
68 return IPC::StringReference("NetworkConnectionToWebProcess");
69}
70
71class ScheduleResourceLoad {
72public:
73 typedef std::tuple<const WebKit::NetworkResourceLoadParameters&> Arguments;
74
75 static IPC::StringReference receiverName() { return messageReceiverName(); }
76 static IPC::StringReference name() { return IPC::StringReference("ScheduleResourceLoad"); }
77 static const bool isSync = false;
78
79 explicit ScheduleResourceLoad(const WebKit::NetworkResourceLoadParameters& resourceLoadParameters)
80 : m_arguments(resourceLoadParameters)
81 {
82 }
83
84 const Arguments& arguments() const
85 {
86 return m_arguments;
87 }
88
89private:
90 Arguments m_arguments;
91};
92
93class PerformSynchronousLoad {
94public:
95 typedef std::tuple<const WebKit::NetworkResourceLoadParameters&> Arguments;
96
97 static IPC::StringReference receiverName() { return messageReceiverName(); }
98 static IPC::StringReference name() { return IPC::StringReference("PerformSynchronousLoad"); }
99 static const bool isSync = true;
100
101 using DelayedReply = CompletionHandler<void(const WebCore::ResourceError& error, const WebCore::ResourceResponse& response, const Vector<char>& data)>;
102 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const WebCore::ResourceError& error, const WebCore::ResourceResponse& response, const Vector<char>& data);
103 using Reply = std::tuple<WebCore::ResourceError&, WebCore::ResourceResponse&, Vector<char>&>;
104 using ReplyArguments = std::tuple<WebCore::ResourceError, WebCore::ResourceResponse, Vector<char>>;
105 explicit PerformSynchronousLoad(const WebKit::NetworkResourceLoadParameters& resourceLoadParameters)
106 : m_arguments(resourceLoadParameters)
107 {
108 }
109
110 const Arguments& arguments() const
111 {
112 return m_arguments;
113 }
114
115private:
116 Arguments m_arguments;
117};
118
119class LoadPing {
120public:
121 typedef std::tuple<const WebKit::NetworkResourceLoadParameters&> Arguments;
122
123 static IPC::StringReference receiverName() { return messageReceiverName(); }
124 static IPC::StringReference name() { return IPC::StringReference("LoadPing"); }
125 static const bool isSync = false;
126
127 explicit LoadPing(const WebKit::NetworkResourceLoadParameters& resourceLoadParameters)
128 : m_arguments(resourceLoadParameters)
129 {
130 }
131
132 const Arguments& arguments() const
133 {
134 return m_arguments;
135 }
136
137private:
138 Arguments m_arguments;
139};
140
141class RemoveLoadIdentifier {
142public:
143 typedef std::tuple<uint64_t> Arguments;
144
145 static IPC::StringReference receiverName() { return messageReceiverName(); }
146 static IPC::StringReference name() { return IPC::StringReference("RemoveLoadIdentifier"); }
147 static const bool isSync = false;
148
149 explicit RemoveLoadIdentifier(uint64_t resourceLoadIdentifier)
150 : m_arguments(resourceLoadIdentifier)
151 {
152 }
153
154 const Arguments& arguments() const
155 {
156 return m_arguments;
157 }
158
159private:
160 Arguments m_arguments;
161};
162
163class PageLoadCompleted {
164public:
165 typedef std::tuple<uint64_t> Arguments;
166
167 static IPC::StringReference receiverName() { return messageReceiverName(); }
168 static IPC::StringReference name() { return IPC::StringReference("PageLoadCompleted"); }
169 static const bool isSync = false;
170
171 explicit PageLoadCompleted(uint64_t webPageID)
172 : m_arguments(webPageID)
173 {
174 }
175
176 const Arguments& arguments() const
177 {
178 return m_arguments;
179 }
180
181private:
182 Arguments m_arguments;
183};
184
185class PrefetchDNS {
186public:
187 typedef std::tuple<const String&> Arguments;
188
189 static IPC::StringReference receiverName() { return messageReceiverName(); }
190 static IPC::StringReference name() { return IPC::StringReference("PrefetchDNS"); }
191 static const bool isSync = false;
192
193 explicit PrefetchDNS(const String& hostname)
194 : m_arguments(hostname)
195 {
196 }
197
198 const Arguments& arguments() const
199 {
200 return m_arguments;
201 }
202
203private:
204 Arguments m_arguments;
205};
206
207class PreconnectTo {
208public:
209 typedef std::tuple<uint64_t, const WebKit::NetworkResourceLoadParameters&> Arguments;
210
211 static IPC::StringReference receiverName() { return messageReceiverName(); }
212 static IPC::StringReference name() { return IPC::StringReference("PreconnectTo"); }
213 static const bool isSync = false;
214
215 PreconnectTo(uint64_t preconnectionIdentifier, const WebKit::NetworkResourceLoadParameters& loadParameters)
216 : m_arguments(preconnectionIdentifier, loadParameters)
217 {
218 }
219
220 const Arguments& arguments() const
221 {
222 return m_arguments;
223 }
224
225private:
226 Arguments m_arguments;
227};
228
229class StartDownload {
230public:
231 typedef std::tuple<const PAL::SessionID&, const WebKit::DownloadID&, const WebCore::ResourceRequest&, const String&> Arguments;
232
233 static IPC::StringReference receiverName() { return messageReceiverName(); }
234 static IPC::StringReference name() { return IPC::StringReference("StartDownload"); }
235 static const bool isSync = false;
236
237 StartDownload(const PAL::SessionID& sessionID, const WebKit::DownloadID& downloadID, const WebCore::ResourceRequest& request, const String& suggestedName)
238 : m_arguments(sessionID, downloadID, request, suggestedName)
239 {
240 }
241
242 const Arguments& arguments() const
243 {
244 return m_arguments;
245 }
246
247private:
248 Arguments m_arguments;
249};
250
251class ConvertMainResourceLoadToDownload {
252public:
253 typedef std::tuple<const PAL::SessionID&, uint64_t, const WebKit::DownloadID&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&> Arguments;
254
255 static IPC::StringReference receiverName() { return messageReceiverName(); }
256 static IPC::StringReference name() { return IPC::StringReference("ConvertMainResourceLoadToDownload"); }
257 static const bool isSync = false;
258
259 ConvertMainResourceLoadToDownload(const PAL::SessionID& sessionID, uint64_t mainResourceLoadIdentifier, const WebKit::DownloadID& downloadID, const WebCore::ResourceRequest& request, const WebCore::ResourceResponse& response)
260 : m_arguments(sessionID, mainResourceLoadIdentifier, downloadID, request, response)
261 {
262 }
263
264 const Arguments& arguments() const
265 {
266 return m_arguments;
267 }
268
269private:
270 Arguments m_arguments;
271};
272
273class CookiesForDOM {
274public:
275 typedef std::tuple<const PAL::SessionID&, const URL&, const WebCore::SameSiteInfo&, const URL&, const Optional<uint64_t>&, const Optional<uint64_t>&, WebCore::IncludeSecureCookies> Arguments;
276
277 static IPC::StringReference receiverName() { return messageReceiverName(); }
278 static IPC::StringReference name() { return IPC::StringReference("CookiesForDOM"); }
279 static const bool isSync = true;
280
281 using DelayedReply = CompletionHandler<void(const String& cookieString, bool didAccessSecureCookies)>;
282 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const String& cookieString, bool didAccessSecureCookies);
283 using Reply = std::tuple<String&, bool&>;
284 using ReplyArguments = std::tuple<String, bool>;
285 CookiesForDOM(const PAL::SessionID& sessionID, const URL& firstParty, const WebCore::SameSiteInfo& sameSiteInfo, const URL& url, const Optional<uint64_t>& frameID, const Optional<uint64_t>& pageID, WebCore::IncludeSecureCookies includeSecureCookies)
286 : m_arguments(sessionID, firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies)
287 {
288 }
289
290 const Arguments& arguments() const
291 {
292 return m_arguments;
293 }
294
295private:
296 Arguments m_arguments;
297};
298
299class SetCookiesFromDOM {
300public:
301 typedef std::tuple<const PAL::SessionID&, const URL&, const WebCore::SameSiteInfo&, const URL&, const Optional<uint64_t>&, const Optional<uint64_t>&, const String&> Arguments;
302
303 static IPC::StringReference receiverName() { return messageReceiverName(); }
304 static IPC::StringReference name() { return IPC::StringReference("SetCookiesFromDOM"); }
305 static const bool isSync = false;
306
307 SetCookiesFromDOM(const PAL::SessionID& sessionID, const URL& firstParty, const WebCore::SameSiteInfo& sameSiteInfo, const URL& url, const Optional<uint64_t>& frameID, const Optional<uint64_t>& pageID, const String& cookieString)
308 : m_arguments(sessionID, firstParty, sameSiteInfo, url, frameID, pageID, cookieString)
309 {
310 }
311
312 const Arguments& arguments() const
313 {
314 return m_arguments;
315 }
316
317private:
318 Arguments m_arguments;
319};
320
321class CookiesEnabled {
322public:
323 typedef std::tuple<const PAL::SessionID&> Arguments;
324
325 static IPC::StringReference receiverName() { return messageReceiverName(); }
326 static IPC::StringReference name() { return IPC::StringReference("CookiesEnabled"); }
327 static const bool isSync = true;
328
329 using DelayedReply = CompletionHandler<void(bool enabled)>;
330 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, bool enabled);
331 using Reply = std::tuple<bool&>;
332 using ReplyArguments = std::tuple<bool>;
333 explicit CookiesEnabled(const PAL::SessionID& sessionID)
334 : m_arguments(sessionID)
335 {
336 }
337
338 const Arguments& arguments() const
339 {
340 return m_arguments;
341 }
342
343private:
344 Arguments m_arguments;
345};
346
347class CookieRequestHeaderFieldValue {
348public:
349 typedef std::tuple<const PAL::SessionID&, const URL&, const WebCore::SameSiteInfo&, const URL&, const Optional<uint64_t>&, const Optional<uint64_t>&, WebCore::IncludeSecureCookies> Arguments;
350
351 static IPC::StringReference receiverName() { return messageReceiverName(); }
352 static IPC::StringReference name() { return IPC::StringReference("CookieRequestHeaderFieldValue"); }
353 static const bool isSync = true;
354
355 using DelayedReply = CompletionHandler<void(const String& cookieString, bool didAccessSecureCookies)>;
356 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const String& cookieString, bool didAccessSecureCookies);
357 using Reply = std::tuple<String&, bool&>;
358 using ReplyArguments = std::tuple<String, bool>;
359 CookieRequestHeaderFieldValue(const PAL::SessionID& sessionID, const URL& firstParty, const WebCore::SameSiteInfo& sameSiteInfo, const URL& url, const Optional<uint64_t>& frameID, const Optional<uint64_t>& pageID, WebCore::IncludeSecureCookies includeSecureCookies)
360 : m_arguments(sessionID, firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies)
361 {
362 }
363
364 const Arguments& arguments() const
365 {
366 return m_arguments;
367 }
368
369private:
370 Arguments m_arguments;
371};
372
373class GetRawCookies {
374public:
375 typedef std::tuple<const PAL::SessionID&, const URL&, const WebCore::SameSiteInfo&, const URL&, const Optional<uint64_t>&, const Optional<uint64_t>&> Arguments;
376
377 static IPC::StringReference receiverName() { return messageReceiverName(); }
378 static IPC::StringReference name() { return IPC::StringReference("GetRawCookies"); }
379 static const bool isSync = true;
380
381 using DelayedReply = CompletionHandler<void(const Vector<WebCore::Cookie>& cookies)>;
382 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const Vector<WebCore::Cookie>& cookies);
383 using Reply = std::tuple<Vector<WebCore::Cookie>&>;
384 using ReplyArguments = std::tuple<Vector<WebCore::Cookie>>;
385 GetRawCookies(const PAL::SessionID& sessionID, const URL& firstParty, const WebCore::SameSiteInfo& sameSiteInfo, const URL& url, const Optional<uint64_t>& frameID, const Optional<uint64_t>& pageID)
386 : m_arguments(sessionID, firstParty, sameSiteInfo, url, frameID, pageID)
387 {
388 }
389
390 const Arguments& arguments() const
391 {
392 return m_arguments;
393 }
394
395private:
396 Arguments m_arguments;
397};
398
399class DeleteCookie {
400public:
401 typedef std::tuple<const PAL::SessionID&, const URL&, const String&> Arguments;
402
403 static IPC::StringReference receiverName() { return messageReceiverName(); }
404 static IPC::StringReference name() { return IPC::StringReference("DeleteCookie"); }
405 static const bool isSync = false;
406
407 DeleteCookie(const PAL::SessionID& sessionID, const URL& url, const String& cookieName)
408 : m_arguments(sessionID, url, cookieName)
409 {
410 }
411
412 const Arguments& arguments() const
413 {
414 return m_arguments;
415 }
416
417private:
418 Arguments m_arguments;
419};
420
421class RegisterFileBlobURL {
422public:
423 typedef std::tuple<const URL&, const String&, const WebKit::SandboxExtension::Handle&, const String&> Arguments;
424
425 static IPC::StringReference receiverName() { return messageReceiverName(); }
426 static IPC::StringReference name() { return IPC::StringReference("RegisterFileBlobURL"); }
427 static const bool isSync = false;
428
429 RegisterFileBlobURL(const URL& url, const String& path, const WebKit::SandboxExtension::Handle& extensionHandle, const String& contentType)
430 : m_arguments(url, path, extensionHandle, contentType)
431 {
432 }
433
434 const Arguments& arguments() const
435 {
436 return m_arguments;
437 }
438
439private:
440 Arguments m_arguments;
441};
442
443class RegisterBlobURL {
444public:
445 typedef std::tuple<const URL&, const Vector<WebCore::BlobPart>&, const String&> Arguments;
446
447 static IPC::StringReference receiverName() { return messageReceiverName(); }
448 static IPC::StringReference name() { return IPC::StringReference("RegisterBlobURL"); }
449 static const bool isSync = false;
450
451 RegisterBlobURL(const URL& url, const Vector<WebCore::BlobPart>& blobParts, const String& contentType)
452 : m_arguments(url, blobParts, contentType)
453 {
454 }
455
456 const Arguments& arguments() const
457 {
458 return m_arguments;
459 }
460
461private:
462 Arguments m_arguments;
463};
464
465class RegisterBlobURLFromURL {
466public:
467 typedef std::tuple<const URL&, const URL&, bool> Arguments;
468
469 static IPC::StringReference receiverName() { return messageReceiverName(); }
470 static IPC::StringReference name() { return IPC::StringReference("RegisterBlobURLFromURL"); }
471 static const bool isSync = false;
472
473 RegisterBlobURLFromURL(const URL& url, const URL& srcURL, bool shouldBypassConnectionCheck)
474 : m_arguments(url, srcURL, shouldBypassConnectionCheck)
475 {
476 }
477
478 const Arguments& arguments() const
479 {
480 return m_arguments;
481 }
482
483private:
484 Arguments m_arguments;
485};
486
487class RegisterBlobURLOptionallyFileBacked {
488public:
489 typedef std::tuple<const URL&, const URL&, const String&, const String&> Arguments;
490
491 static IPC::StringReference receiverName() { return messageReceiverName(); }
492 static IPC::StringReference name() { return IPC::StringReference("RegisterBlobURLOptionallyFileBacked"); }
493 static const bool isSync = false;
494
495 RegisterBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, const String& fileBackedPath, const String& contentType)
496 : m_arguments(url, srcURL, fileBackedPath, contentType)
497 {
498 }
499
500 const Arguments& arguments() const
501 {
502 return m_arguments;
503 }
504
505private:
506 Arguments m_arguments;
507};
508
509class RegisterBlobURLForSlice {
510public:
511 typedef std::tuple<const URL&, const URL&, int64_t, int64_t> Arguments;
512
513 static IPC::StringReference receiverName() { return messageReceiverName(); }
514 static IPC::StringReference name() { return IPC::StringReference("RegisterBlobURLForSlice"); }
515 static const bool isSync = false;
516
517 RegisterBlobURLForSlice(const URL& url, const URL& srcURL, int64_t start, int64_t end)
518 : m_arguments(url, srcURL, start, end)
519 {
520 }
521
522 const Arguments& arguments() const
523 {
524 return m_arguments;
525 }
526
527private:
528 Arguments m_arguments;
529};
530
531class UnregisterBlobURL {
532public:
533 typedef std::tuple<const URL&> Arguments;
534
535 static IPC::StringReference receiverName() { return messageReceiverName(); }
536 static IPC::StringReference name() { return IPC::StringReference("UnregisterBlobURL"); }
537 static const bool isSync = false;
538
539 explicit UnregisterBlobURL(const URL& url)
540 : m_arguments(url)
541 {
542 }
543
544 const Arguments& arguments() const
545 {
546 return m_arguments;
547 }
548
549private:
550 Arguments m_arguments;
551};
552
553class BlobSize {
554public:
555 typedef std::tuple<const URL&> Arguments;
556
557 static IPC::StringReference receiverName() { return messageReceiverName(); }
558 static IPC::StringReference name() { return IPC::StringReference("BlobSize"); }
559 static const bool isSync = true;
560
561 using DelayedReply = CompletionHandler<void(uint64_t resultSize)>;
562 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t resultSize);
563 using Reply = std::tuple<uint64_t&>;
564 using ReplyArguments = std::tuple<uint64_t>;
565 explicit BlobSize(const URL& url)
566 : m_arguments(url)
567 {
568 }
569
570 const Arguments& arguments() const
571 {
572 return m_arguments;
573 }
574
575private:
576 Arguments m_arguments;
577};
578
579class WriteBlobsToTemporaryFiles {
580public:
581 typedef std::tuple<const Vector<String>&> Arguments;
582
583 static IPC::StringReference receiverName() { return messageReceiverName(); }
584 static IPC::StringReference name() { return IPC::StringReference("WriteBlobsToTemporaryFiles"); }
585 static const bool isSync = false;
586
587 static void callReply(IPC::Decoder&, CompletionHandler<void(Vector<String>&&)>&&);
588 static void cancelReply(CompletionHandler<void(Vector<String>&&)>&&);
589 static IPC::StringReference asyncMessageReplyName() { return { "WriteBlobsToTemporaryFilesReply" }; }
590 using AsyncReply = CompletionHandler<void(const Vector<String>& fileNames)>;
591 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const Vector<String>& fileNames);
592 using Reply = std::tuple<Vector<String>&>;
593 using ReplyArguments = std::tuple<Vector<String>>;
594 explicit WriteBlobsToTemporaryFiles(const Vector<String>& blobURLs)
595 : m_arguments(blobURLs)
596 {
597 }
598
599 const Arguments& arguments() const
600 {
601 return m_arguments;
602 }
603
604private:
605 Arguments m_arguments;
606};
607
608class SetCaptureExtraNetworkLoadMetricsEnabled {
609public:
610 typedef std::tuple<bool> Arguments;
611
612 static IPC::StringReference receiverName() { return messageReceiverName(); }
613 static IPC::StringReference name() { return IPC::StringReference("SetCaptureExtraNetworkLoadMetricsEnabled"); }
614 static const bool isSync = false;
615
616 explicit SetCaptureExtraNetworkLoadMetricsEnabled(bool enabled)
617 : m_arguments(enabled)
618 {
619 }
620
621 const Arguments& arguments() const
622 {
623 return m_arguments;
624 }
625
626private:
627 Arguments m_arguments;
628};
629
630class CreateSocketStream {
631public:
632 typedef std::tuple<const URL&, const PAL::SessionID&, const String&, uint64_t> Arguments;
633
634 static IPC::StringReference receiverName() { return messageReceiverName(); }
635 static IPC::StringReference name() { return IPC::StringReference("CreateSocketStream"); }
636 static const bool isSync = false;
637
638 CreateSocketStream(const URL& url, const PAL::SessionID& sessionID, const String& cachePartition, uint64_t identifier)
639 : m_arguments(url, sessionID, cachePartition, identifier)
640 {
641 }
642
643 const Arguments& arguments() const
644 {
645 return m_arguments;
646 }
647
648private:
649 Arguments m_arguments;
650};
651
652class EnsureLegacyPrivateBrowsingSession {
653public:
654 typedef std::tuple<> Arguments;
655
656 static IPC::StringReference receiverName() { return messageReceiverName(); }
657 static IPC::StringReference name() { return IPC::StringReference("EnsureLegacyPrivateBrowsingSession"); }
658 static const bool isSync = false;
659
660 const Arguments& arguments() const
661 {
662 return m_arguments;
663 }
664
665private:
666 Arguments m_arguments;
667};
668
669#if ENABLE(RESOURCE_LOAD_STATISTICS)
670class RemoveStorageAccessForFrame {
671public:
672 typedef std::tuple<const PAL::SessionID&, uint64_t, uint64_t> Arguments;
673
674 static IPC::StringReference receiverName() { return messageReceiverName(); }
675 static IPC::StringReference name() { return IPC::StringReference("RemoveStorageAccessForFrame"); }
676 static const bool isSync = false;
677
678 RemoveStorageAccessForFrame(const PAL::SessionID& sessionID, uint64_t frameID, uint64_t pageID)
679 : m_arguments(sessionID, frameID, pageID)
680 {
681 }
682
683 const Arguments& arguments() const
684 {
685 return m_arguments;
686 }
687
688private:
689 Arguments m_arguments;
690};
691#endif
692
693#if ENABLE(RESOURCE_LOAD_STATISTICS)
694class ClearPageSpecificDataForResourceLoadStatistics {
695public:
696 typedef std::tuple<const PAL::SessionID&, uint64_t> Arguments;
697
698 static IPC::StringReference receiverName() { return messageReceiverName(); }
699 static IPC::StringReference name() { return IPC::StringReference("ClearPageSpecificDataForResourceLoadStatistics"); }
700 static const bool isSync = false;
701
702 ClearPageSpecificDataForResourceLoadStatistics(const PAL::SessionID& sessionID, uint64_t pageID)
703 : m_arguments(sessionID, pageID)
704 {
705 }
706
707 const Arguments& arguments() const
708 {
709 return m_arguments;
710 }
711
712private:
713 Arguments m_arguments;
714};
715#endif
716
717#if ENABLE(RESOURCE_LOAD_STATISTICS)
718class LogUserInteraction {
719public:
720 typedef std::tuple<const PAL::SessionID&, const WebCore::RegistrableDomain&> Arguments;
721
722 static IPC::StringReference receiverName() { return messageReceiverName(); }
723 static IPC::StringReference name() { return IPC::StringReference("LogUserInteraction"); }
724 static const bool isSync = false;
725
726 LogUserInteraction(const PAL::SessionID& sessionID, const WebCore::RegistrableDomain& domain)
727 : m_arguments(sessionID, domain)
728 {
729 }
730
731 const Arguments& arguments() const
732 {
733 return m_arguments;
734 }
735
736private:
737 Arguments m_arguments;
738};
739#endif
740
741#if ENABLE(RESOURCE_LOAD_STATISTICS)
742class LogWebSocketLoading {
743public:
744 typedef std::tuple<const PAL::SessionID&, const WebCore::RegistrableDomain&, const WebCore::RegistrableDomain&, const WallTime&> Arguments;
745
746 static IPC::StringReference receiverName() { return messageReceiverName(); }
747 static IPC::StringReference name() { return IPC::StringReference("LogWebSocketLoading"); }
748 static const bool isSync = false;
749
750 LogWebSocketLoading(const PAL::SessionID& sessionID, const WebCore::RegistrableDomain& targetDomain, const WebCore::RegistrableDomain& topFrameDomain, const WallTime& lastSeen)
751 : m_arguments(sessionID, targetDomain, topFrameDomain, lastSeen)
752 {
753 }
754
755 const Arguments& arguments() const
756 {
757 return m_arguments;
758 }
759
760private:
761 Arguments m_arguments;
762};
763#endif
764
765#if ENABLE(RESOURCE_LOAD_STATISTICS)
766class LogSubresourceLoading {
767public:
768 typedef std::tuple<const PAL::SessionID&, const WebCore::RegistrableDomain&, const WebCore::RegistrableDomain&, const WallTime&> Arguments;
769
770 static IPC::StringReference receiverName() { return messageReceiverName(); }
771 static IPC::StringReference name() { return IPC::StringReference("LogSubresourceLoading"); }
772 static const bool isSync = false;
773
774 LogSubresourceLoading(const PAL::SessionID& sessionID, const WebCore::RegistrableDomain& targetDomain, const WebCore::RegistrableDomain& topFrameDomain, const WallTime& lastSeen)
775 : m_arguments(sessionID, targetDomain, topFrameDomain, lastSeen)
776 {
777 }
778
779 const Arguments& arguments() const
780 {
781 return m_arguments;
782 }
783
784private:
785 Arguments m_arguments;
786};
787#endif
788
789#if ENABLE(RESOURCE_LOAD_STATISTICS)
790class LogSubresourceRedirect {
791public:
792 typedef std::tuple<const PAL::SessionID&, const WebCore::RegistrableDomain&, const WebCore::RegistrableDomain&> Arguments;
793
794 static IPC::StringReference receiverName() { return messageReceiverName(); }
795 static IPC::StringReference name() { return IPC::StringReference("LogSubresourceRedirect"); }
796 static const bool isSync = false;
797
798 LogSubresourceRedirect(const PAL::SessionID& sessionID, const WebCore::RegistrableDomain& sourceDomain, const WebCore::RegistrableDomain& targetDomain)
799 : m_arguments(sessionID, sourceDomain, targetDomain)
800 {
801 }
802
803 const Arguments& arguments() const
804 {
805 return m_arguments;
806 }
807
808private:
809 Arguments m_arguments;
810};
811#endif
812
813#if ENABLE(RESOURCE_LOAD_STATISTICS)
814class ResourceLoadStatisticsUpdated {
815public:
816 typedef std::tuple<const Vector<WebCore::ResourceLoadStatistics>&> Arguments;
817
818 static IPC::StringReference receiverName() { return messageReceiverName(); }
819 static IPC::StringReference name() { return IPC::StringReference("ResourceLoadStatisticsUpdated"); }
820 static const bool isSync = false;
821
822 explicit ResourceLoadStatisticsUpdated(const Vector<WebCore::ResourceLoadStatistics>& statistics)
823 : m_arguments(statistics)
824 {
825 }
826
827 const Arguments& arguments() const
828 {
829 return m_arguments;
830 }
831
832private:
833 Arguments m_arguments;
834};
835#endif
836
837#if ENABLE(RESOURCE_LOAD_STATISTICS)
838class HasStorageAccess {
839public:
840 typedef std::tuple<const PAL::SessionID&, const WebCore::RegistrableDomain&, const WebCore::RegistrableDomain&, uint64_t, uint64_t> Arguments;
841
842 static IPC::StringReference receiverName() { return messageReceiverName(); }
843 static IPC::StringReference name() { return IPC::StringReference("HasStorageAccess"); }
844 static const bool isSync = false;
845
846 static void callReply(IPC::Decoder&, CompletionHandler<void(bool&&)>&&);
847 static void cancelReply(CompletionHandler<void(bool&&)>&&);
848 static IPC::StringReference asyncMessageReplyName() { return { "HasStorageAccessReply" }; }
849 using AsyncReply = CompletionHandler<void(bool hasStorageAccess)>;
850 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, bool hasStorageAccess);
851 using Reply = std::tuple<bool&>;
852 using ReplyArguments = std::tuple<bool>;
853 HasStorageAccess(const PAL::SessionID& sessionID, const WebCore::RegistrableDomain& subFrameDomain, const WebCore::RegistrableDomain& topFrameDomain, uint64_t frameID, uint64_t pageID)
854 : m_arguments(sessionID, subFrameDomain, topFrameDomain, frameID, pageID)
855 {
856 }
857
858 const Arguments& arguments() const
859 {
860 return m_arguments;
861 }
862
863private:
864 Arguments m_arguments;
865};
866#endif
867
868#if ENABLE(RESOURCE_LOAD_STATISTICS)
869class RequestStorageAccess {
870public:
871 typedef std::tuple<const PAL::SessionID&, const WebCore::RegistrableDomain&, const WebCore::RegistrableDomain&, uint64_t, uint64_t> Arguments;
872
873 static IPC::StringReference receiverName() { return messageReceiverName(); }
874 static IPC::StringReference name() { return IPC::StringReference("RequestStorageAccess"); }
875 static const bool isSync = false;
876
877 static void callReply(IPC::Decoder&, CompletionHandler<void(WebCore::StorageAccessWasGranted&&, WebCore::StorageAccessPromptWasShown&&)>&&);
878 static void cancelReply(CompletionHandler<void(WebCore::StorageAccessWasGranted&&, WebCore::StorageAccessPromptWasShown&&)>&&);
879 static IPC::StringReference asyncMessageReplyName() { return { "RequestStorageAccessReply" }; }
880 using AsyncReply = CompletionHandler<void(WebCore::StorageAccessWasGranted wasGranted, WebCore::StorageAccessPromptWasShown promptWasShown)>;
881 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, WebCore::StorageAccessWasGranted wasGranted, WebCore::StorageAccessPromptWasShown promptWasShown);
882 using Reply = std::tuple<WebCore::StorageAccessWasGranted&, WebCore::StorageAccessPromptWasShown&>;
883 using ReplyArguments = std::tuple<WebCore::StorageAccessWasGranted, WebCore::StorageAccessPromptWasShown>;
884 RequestStorageAccess(const PAL::SessionID& sessionID, const WebCore::RegistrableDomain& subFrameDomain, const WebCore::RegistrableDomain& topFrameDomain, uint64_t frameID, uint64_t pageID)
885 : m_arguments(sessionID, subFrameDomain, topFrameDomain, frameID, pageID)
886 {
887 }
888
889 const Arguments& arguments() const
890 {
891 return m_arguments;
892 }
893
894private:
895 Arguments m_arguments;
896};
897#endif
898
899#if ENABLE(RESOURCE_LOAD_STATISTICS)
900class RequestStorageAccessUnderOpener {
901public:
902 typedef std::tuple<const PAL::SessionID&, const WebCore::RegistrableDomain&, uint64_t, const WebCore::RegistrableDomain&> Arguments;
903
904 static IPC::StringReference receiverName() { return messageReceiverName(); }
905 static IPC::StringReference name() { return IPC::StringReference("RequestStorageAccessUnderOpener"); }
906 static const bool isSync = false;
907
908 RequestStorageAccessUnderOpener(const PAL::SessionID& sessionID, const WebCore::RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, const WebCore::RegistrableDomain& openerDomain)
909 : m_arguments(sessionID, domainInNeedOfStorageAccess, openerPageID, openerDomain)
910 {
911 }
912
913 const Arguments& arguments() const
914 {
915 return m_arguments;
916 }
917
918private:
919 Arguments m_arguments;
920};
921#endif
922
923class AddOriginAccessWhitelistEntry {
924public:
925 typedef std::tuple<const String&, const String&, const String&, bool> Arguments;
926
927 static IPC::StringReference receiverName() { return messageReceiverName(); }
928 static IPC::StringReference name() { return IPC::StringReference("AddOriginAccessWhitelistEntry"); }
929 static const bool isSync = false;
930
931 AddOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains)
932 : m_arguments(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains)
933 {
934 }
935
936 const Arguments& arguments() const
937 {
938 return m_arguments;
939 }
940
941private:
942 Arguments m_arguments;
943};
944
945class RemoveOriginAccessWhitelistEntry {
946public:
947 typedef std::tuple<const String&, const String&, const String&, bool> Arguments;
948
949 static IPC::StringReference receiverName() { return messageReceiverName(); }
950 static IPC::StringReference name() { return IPC::StringReference("RemoveOriginAccessWhitelistEntry"); }
951 static const bool isSync = false;
952
953 RemoveOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains)
954 : m_arguments(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains)
955 {
956 }
957
958 const Arguments& arguments() const
959 {
960 return m_arguments;
961 }
962
963private:
964 Arguments m_arguments;
965};
966
967class ResetOriginAccessWhitelists {
968public:
969 typedef std::tuple<> Arguments;
970
971 static IPC::StringReference receiverName() { return messageReceiverName(); }
972 static IPC::StringReference name() { return IPC::StringReference("ResetOriginAccessWhitelists"); }
973 static const bool isSync = false;
974
975 const Arguments& arguments() const
976 {
977 return m_arguments;
978 }
979
980private:
981 Arguments m_arguments;
982};
983
984class GetNetworkLoadInformationRequest {
985public:
986 typedef std::tuple<uint64_t> Arguments;
987
988 static IPC::StringReference receiverName() { return messageReceiverName(); }
989 static IPC::StringReference name() { return IPC::StringReference("GetNetworkLoadInformationRequest"); }
990 static const bool isSync = true;
991
992 using DelayedReply = CompletionHandler<void(const WebCore::ResourceRequest& request)>;
993 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const WebCore::ResourceRequest& request);
994 using Reply = std::tuple<WebCore::ResourceRequest&>;
995 using ReplyArguments = std::tuple<WebCore::ResourceRequest>;
996 explicit GetNetworkLoadInformationRequest(uint64_t resourceLoadIdentifier)
997 : m_arguments(resourceLoadIdentifier)
998 {
999 }
1000
1001 const Arguments& arguments() const
1002 {
1003 return m_arguments;
1004 }
1005
1006private:
1007 Arguments m_arguments;
1008};
1009
1010class GetNetworkLoadInformationResponse {
1011public:
1012 typedef std::tuple<uint64_t> Arguments;
1013
1014 static IPC::StringReference receiverName() { return messageReceiverName(); }
1015 static IPC::StringReference name() { return IPC::StringReference("GetNetworkLoadInformationResponse"); }
1016 static const bool isSync = true;
1017
1018 using DelayedReply = CompletionHandler<void(const WebCore::ResourceResponse& response)>;
1019 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const WebCore::ResourceResponse& response);
1020 using Reply = std::tuple<WebCore::ResourceResponse&>;
1021 using ReplyArguments = std::tuple<WebCore::ResourceResponse>;
1022 explicit GetNetworkLoadInformationResponse(uint64_t resourceLoadIdentifier)
1023 : m_arguments(resourceLoadIdentifier)
1024 {
1025 }
1026
1027 const Arguments& arguments() const
1028 {
1029 return m_arguments;
1030 }
1031
1032private:
1033 Arguments m_arguments;
1034};
1035
1036class GetNetworkLoadIntermediateInformation {
1037public:
1038 typedef std::tuple<uint64_t> Arguments;
1039
1040 static IPC::StringReference receiverName() { return messageReceiverName(); }
1041 static IPC::StringReference name() { return IPC::StringReference("GetNetworkLoadIntermediateInformation"); }
1042 static const bool isSync = true;
1043
1044 using DelayedReply = CompletionHandler<void(const Vector<WebCore::NetworkTransactionInformation>& transactions)>;
1045 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const Vector<WebCore::NetworkTransactionInformation>& transactions);
1046 using Reply = std::tuple<Vector<WebCore::NetworkTransactionInformation>&>;
1047 using ReplyArguments = std::tuple<Vector<WebCore::NetworkTransactionInformation>>;
1048 explicit GetNetworkLoadIntermediateInformation(uint64_t resourceLoadIdentifier)
1049 : m_arguments(resourceLoadIdentifier)
1050 {
1051 }
1052
1053 const Arguments& arguments() const
1054 {
1055 return m_arguments;
1056 }
1057
1058private:
1059 Arguments m_arguments;
1060};
1061
1062class TakeNetworkLoadInformationMetrics {
1063public:
1064 typedef std::tuple<uint64_t> Arguments;
1065
1066 static IPC::StringReference receiverName() { return messageReceiverName(); }
1067 static IPC::StringReference name() { return IPC::StringReference("TakeNetworkLoadInformationMetrics"); }
1068 static const bool isSync = true;
1069
1070 using DelayedReply = CompletionHandler<void(const WebCore::NetworkLoadMetrics& networkMetrics)>;
1071 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const WebCore::NetworkLoadMetrics& networkMetrics);
1072 using Reply = std::tuple<WebCore::NetworkLoadMetrics&>;
1073 using ReplyArguments = std::tuple<WebCore::NetworkLoadMetrics>;
1074 explicit TakeNetworkLoadInformationMetrics(uint64_t resourceLoadIdentifier)
1075 : m_arguments(resourceLoadIdentifier)
1076 {
1077 }
1078
1079 const Arguments& arguments() const
1080 {
1081 return m_arguments;
1082 }
1083
1084private:
1085 Arguments m_arguments;
1086};
1087
1088#if ENABLE(INDEXED_DATABASE)
1089class EstablishIDBConnectionToServer {
1090public:
1091 typedef std::tuple<const PAL::SessionID&> Arguments;
1092
1093 static IPC::StringReference receiverName() { return messageReceiverName(); }
1094 static IPC::StringReference name() { return IPC::StringReference("EstablishIDBConnectionToServer"); }
1095 static const bool isSync = true;
1096
1097 using DelayedReply = CompletionHandler<void(uint64_t serverConnectionIdentifier)>;
1098 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t serverConnectionIdentifier);
1099 using Reply = std::tuple<uint64_t&>;
1100 using ReplyArguments = std::tuple<uint64_t>;
1101 explicit EstablishIDBConnectionToServer(const PAL::SessionID& sessionID)
1102 : m_arguments(sessionID)
1103 {
1104 }
1105
1106 const Arguments& arguments() const
1107 {
1108 return m_arguments;
1109 }
1110
1111private:
1112 Arguments m_arguments;
1113};
1114#endif
1115
1116#if ENABLE(SERVICE_WORKER)
1117class EstablishSWServerConnection {
1118public:
1119 typedef std::tuple<const PAL::SessionID&> Arguments;
1120
1121 static IPC::StringReference receiverName() { return messageReceiverName(); }
1122 static IPC::StringReference name() { return IPC::StringReference("EstablishSWServerConnection"); }
1123 static const bool isSync = true;
1124
1125 using DelayedReply = CompletionHandler<void(const WebCore::SWServerConnectionIdentifier& serverConnectionIdentifier)>;
1126 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const WebCore::SWServerConnectionIdentifier& serverConnectionIdentifier);
1127 using Reply = std::tuple<WebCore::SWServerConnectionIdentifier&>;
1128 using ReplyArguments = std::tuple<WebCore::SWServerConnectionIdentifier>;
1129 explicit EstablishSWServerConnection(const PAL::SessionID& sessionID)
1130 : m_arguments(sessionID)
1131 {
1132 }
1133
1134 const Arguments& arguments() const
1135 {
1136 return m_arguments;
1137 }
1138
1139private:
1140 Arguments m_arguments;
1141};
1142#endif
1143
1144class SetWebProcessIdentifier {
1145public:
1146 typedef std::tuple<const WebCore::ProcessIdentifier&> Arguments;
1147
1148 static IPC::StringReference receiverName() { return messageReceiverName(); }
1149 static IPC::StringReference name() { return IPC::StringReference("SetWebProcessIdentifier"); }
1150 static const bool isSync = false;
1151
1152 explicit SetWebProcessIdentifier(const WebCore::ProcessIdentifier& processIdentifier)
1153 : m_arguments(processIdentifier)
1154 {
1155 }
1156
1157 const Arguments& arguments() const
1158 {
1159 return m_arguments;
1160 }
1161
1162private:
1163 Arguments m_arguments;
1164};
1165
1166} // namespace NetworkConnectionToWebProcess
1167} // namespace Messages
1168