Add support for the frames() timing function
[WebKit-https.git] / Source / WebKit / Shared / WebCoreArgumentCoders.h
1 /*
2  * Copyright (C) 2010-2017 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''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #pragma once
27
28 #include "ArgumentCoders.h"
29 #include <WebCore/AutoplayEvent.h>
30 #include <WebCore/CacheStorageConnection.h>
31 #include <WebCore/ColorSpace.h>
32 #include <WebCore/DiagnosticLoggingClient.h>
33 #include <WebCore/FrameLoaderTypes.h>
34 #include <WebCore/IndexedDB.h>
35 #include <WebCore/MediaSelectionOption.h>
36 #include <WebCore/NetworkLoadMetrics.h>
37 #include <WebCore/NotificationDirection.h>
38 #include <WebCore/PaymentHeaders.h>
39 #include <WebCore/RealtimeMediaSource.h>
40 #include <WebCore/ScrollSnapOffsetsInfo.h>
41 #include <WebCore/ServiceWorkerTypes.h>
42 #include <WebCore/StoredCredentialsPolicy.h>
43 #include <WebCore/WorkerType.h>
44
45 namespace WTF {
46 class MonotonicTime;
47 class Seconds;
48 }
49
50 namespace WebCore {
51 class AffineTransform;
52 class AuthenticationChallenge;
53 class BlobPart;
54 class CertificateInfo;
55 class Color;
56 class Credential;
57 class CubicBezierTimingFunction;
58 class Cursor;
59 class DatabaseDetails;
60 class DragData;
61 class FilterOperation;
62 class FilterOperations;
63 class FloatPoint;
64 class FloatPoint3D;
65 class FloatRect;
66 class FloatRoundedRect;
67 class FloatSize;
68 class FixedPositionViewportConstraints;
69 class HTTPHeaderMap;
70 class IntPoint;
71 class IntRect;
72 class IntSize;
73 class KeyframeValueList;
74 class LayoutSize;
75 class LayoutPoint;
76 class LinearTimingFunction;
77 class Notification;
78 class Path;
79 class ProtectionSpace;
80 class Region;
81 class ResourceError;
82 class ResourceRequest;
83 class ResourceResponse;
84 class SpringTimingFunction;
85 class StepsTimingFunction;
86 class FramesTimingFunction;
87 class StickyPositionViewportConstraints;
88 class TextCheckingRequestData;
89 class TransformationMatrix;
90 class UserStyleSheet;
91 class URL;
92
93 struct AttachmentInfo;
94 struct CacheQueryOptions;
95 struct CompositionUnderline;
96 struct DictationAlternative;
97 struct DictionaryPopupInfo;
98 struct EventTrackingRegions;
99 struct ExceptionDetails;
100 struct FileChooserSettings;
101 struct Length;
102 struct GrammarDetail;
103 struct MimeClassInfo;
104 struct PasteboardImage;
105 struct PasteboardCustomData;
106 struct PasteboardURL;
107 struct PluginInfo;
108 struct PromisedBlobInfo;
109 struct RecentSearch;
110 struct ResourceLoadStatistics;
111 struct ScrollableAreaParameters;
112 struct TextCheckingResult;
113 struct TextIndicatorData;
114 struct ViewportAttributes;
115 struct WindowFeatures;
116     
117 template <typename> class RectEdges;
118 using FloatBoxExtent = RectEdges<float>;
119
120 #if PLATFORM(COCOA)
121 class MachSendRight;
122 struct KeypressCommand;
123 #endif
124
125 #if PLATFORM(IOS)
126 class FloatQuad;
127 class SelectionRect;
128 struct Highlight;
129 struct PasteboardImage;
130 struct PasteboardWebContent;
131 struct ViewportArguments;
132 #endif
133
134 #if USE(SOUP)
135 struct SoupNetworkProxySettings;
136 #endif
137
138 #if PLATFORM(WPE)
139 struct PasteboardWebContent;
140 #endif
141
142 #if ENABLE(CONTENT_FILTERING)
143 class ContentFilterUnblockHandler;
144 #endif
145
146 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
147 class MediaPlaybackTargetContext;
148 #endif
149
150 #if ENABLE(MEDIA_SESSION)
151 class MediaSessionMetadata;
152 #endif
153
154 #if ENABLE(MEDIA_STREAM)
155 struct MediaConstraints;
156 #endif
157
158 #if ENABLE(INDEXED_DATABASE)
159 using IDBKeyPath = Variant<String, Vector<String>>;
160 #endif
161 }
162
163 namespace IPC {
164
165 template<> struct ArgumentCoder<WTF::MonotonicTime> {
166     static void encode(Encoder&, const WTF::MonotonicTime&);
167     static bool decode(Decoder&, WTF::MonotonicTime&);
168 };
169
170 template<> struct ArgumentCoder<WTF::Seconds> {
171     static void encode(Encoder&, const WTF::Seconds&);
172     static bool decode(Decoder&, WTF::Seconds&);
173 };
174
175 template<> struct ArgumentCoder<WebCore::AffineTransform> {
176     static void encode(Encoder&, const WebCore::AffineTransform&);
177     static bool decode(Decoder&, WebCore::AffineTransform&);
178 };
179
180 template<> struct ArgumentCoder<WebCore::CacheQueryOptions> {
181     static void encode(Encoder&, const WebCore::CacheQueryOptions&);
182     static bool decode(Decoder&, WebCore::CacheQueryOptions&);
183 };
184
185 template<> struct ArgumentCoder<WebCore::DOMCacheEngine::CacheInfo> {
186     static void encode(Encoder&, const WebCore::DOMCacheEngine::CacheInfo&);
187     static std::optional<WebCore::DOMCacheEngine::CacheInfo> decode(Decoder&);
188 };
189
190 template<> struct ArgumentCoder<WebCore::DOMCacheEngine::Record> {
191     static void encode(Encoder&, const WebCore::DOMCacheEngine::Record&);
192     static std::optional<WebCore::DOMCacheEngine::Record> decode(Decoder&);
193 };
194
195 template<> struct ArgumentCoder<WebCore::EventTrackingRegions> {
196     static void encode(Encoder&, const WebCore::EventTrackingRegions&);
197     static bool decode(Decoder&, WebCore::EventTrackingRegions&);
198 };
199
200 template<> struct ArgumentCoder<WebCore::TransformationMatrix> {
201     static void encode(Encoder&, const WebCore::TransformationMatrix&);
202     static bool decode(Decoder&, WebCore::TransformationMatrix&);
203 };
204
205 template<> struct ArgumentCoder<WebCore::LinearTimingFunction> {
206     static void encode(Encoder&, const WebCore::LinearTimingFunction&);
207     static bool decode(Decoder&, WebCore::LinearTimingFunction&);
208 };
209
210 template<> struct ArgumentCoder<WebCore::CubicBezierTimingFunction> {
211     static void encode(Encoder&, const WebCore::CubicBezierTimingFunction&);
212     static bool decode(Decoder&, WebCore::CubicBezierTimingFunction&);
213 };
214
215 template<> struct ArgumentCoder<WebCore::StepsTimingFunction> {
216     static void encode(Encoder&, const WebCore::StepsTimingFunction&);
217     static bool decode(Decoder&, WebCore::StepsTimingFunction&);
218 };
219
220 template<> struct ArgumentCoder<WebCore::FramesTimingFunction> {
221     static void encode(Encoder&, const WebCore::FramesTimingFunction&);
222     static bool decode(Decoder&, WebCore::FramesTimingFunction&);
223 };
224
225 template<> struct ArgumentCoder<WebCore::SpringTimingFunction> {
226     static void encode(Encoder&, const WebCore::SpringTimingFunction&);
227     static bool decode(Decoder&, WebCore::SpringTimingFunction&);
228 };
229
230 template<> struct ArgumentCoder<WebCore::CertificateInfo> {
231     static void encode(Encoder&, const WebCore::CertificateInfo&);
232     static bool decode(Decoder&, WebCore::CertificateInfo&);
233 };
234
235 template<> struct ArgumentCoder<WebCore::FloatPoint> {
236     static void encode(Encoder&, const WebCore::FloatPoint&);
237     static bool decode(Decoder&, WebCore::FloatPoint&);
238     static std::optional<WebCore::FloatPoint> decode(Decoder&);
239 };
240
241 template<> struct ArgumentCoder<WebCore::FloatPoint3D> {
242     static void encode(Encoder&, const WebCore::FloatPoint3D&);
243     static bool decode(Decoder&, WebCore::FloatPoint3D&);
244 };
245
246 template<> struct ArgumentCoder<WebCore::FloatRect> {
247     static void encode(Encoder&, const WebCore::FloatRect&);
248     static bool decode(Decoder&, WebCore::FloatRect&);
249     static std::optional<WebCore::FloatRect> decode(Decoder&);
250 };
251     
252 template<> struct ArgumentCoder<WebCore::FloatBoxExtent> {
253     static void encode(Encoder&, const WebCore::FloatBoxExtent&);
254     static bool decode(Decoder&, WebCore::FloatBoxExtent&);
255 };
256
257 template<> struct ArgumentCoder<WebCore::FloatSize> {
258     static void encode(Encoder&, const WebCore::FloatSize&);
259     static bool decode(Decoder&, WebCore::FloatSize&);
260 };
261
262 template<> struct ArgumentCoder<WebCore::FloatRoundedRect> {
263     static void encode(Encoder&, const WebCore::FloatRoundedRect&);
264     static bool decode(Decoder&, WebCore::FloatRoundedRect&);
265 };
266
267 #if PLATFORM(IOS)
268 template<> struct ArgumentCoder<WebCore::FloatQuad> {
269     static void encode(Encoder&, const WebCore::FloatQuad&);
270     static std::optional<WebCore::FloatQuad> decode(Decoder&);
271 };
272
273 template<> struct ArgumentCoder<WebCore::ViewportArguments> {
274     static void encode(Encoder&, const WebCore::ViewportArguments&);
275     static bool decode(Decoder&, WebCore::ViewportArguments&);
276 };
277 #endif // PLATFORM(IOS)
278
279 template<> struct ArgumentCoder<WebCore::IntPoint> {
280     static void encode(Encoder&, const WebCore::IntPoint&);
281     static bool decode(Decoder&, WebCore::IntPoint&);
282     static std::optional<WebCore::IntPoint> decode(Decoder&);
283 };
284
285 template<> struct ArgumentCoder<WebCore::IntRect> {
286     static void encode(Encoder&, const WebCore::IntRect&);
287     static bool decode(Decoder&, WebCore::IntRect&);
288     static std::optional<WebCore::IntRect> decode(Decoder&);
289 };
290
291 template<> struct ArgumentCoder<WebCore::IntSize> {
292     static void encode(Encoder&, const WebCore::IntSize&);
293     static bool decode(Decoder&, WebCore::IntSize&);
294     static std::optional<WebCore::IntSize> decode(Decoder&);
295 };
296
297 template<> struct ArgumentCoder<WebCore::LayoutSize> {
298     static void encode(Encoder&, const WebCore::LayoutSize&);
299     static bool decode(Decoder&, WebCore::LayoutSize&);
300 };
301
302 template<> struct ArgumentCoder<WebCore::LayoutPoint> {
303     static void encode(Encoder&, const WebCore::LayoutPoint&);
304     static bool decode(Decoder&, WebCore::LayoutPoint&);
305 };
306
307 template<> struct ArgumentCoder<WebCore::Path> {
308     static void encode(Encoder&, const WebCore::Path&);
309     static bool decode(Decoder&, WebCore::Path&);
310 };
311
312 template<> struct ArgumentCoder<WebCore::Region> {
313     static void encode(Encoder&, const WebCore::Region&);
314     static bool decode(Decoder&, WebCore::Region&);
315 };
316
317 template<> struct ArgumentCoder<WebCore::Length> {
318     static void encode(Encoder&, const WebCore::Length&);
319     static bool decode(Decoder&, WebCore::Length&);
320 };
321
322 template<> struct ArgumentCoder<WebCore::ViewportAttributes> {
323     static void encode(Encoder&, const WebCore::ViewportAttributes&);
324     static bool decode(Decoder&, WebCore::ViewportAttributes&);
325 };
326
327 template<> struct ArgumentCoder<WebCore::MimeClassInfo> {
328     static void encode(Encoder&, const WebCore::MimeClassInfo&);
329     static std::optional<WebCore::MimeClassInfo> decode(Decoder&);
330 };
331
332 template<> struct ArgumentCoder<WebCore::PluginInfo> {
333     static void encode(Encoder&, const WebCore::PluginInfo&);
334     static std::optional<WebCore::PluginInfo> decode(Decoder&);
335 };
336
337 template<> struct ArgumentCoder<WebCore::AuthenticationChallenge> {
338     static void encode(Encoder&, const WebCore::AuthenticationChallenge&);
339     static bool decode(Decoder&, WebCore::AuthenticationChallenge&);
340 };
341
342 template<> struct ArgumentCoder<WebCore::ProtectionSpace> {
343     static void encode(Encoder&, const WebCore::ProtectionSpace&);
344     static bool decode(Decoder&, WebCore::ProtectionSpace&);
345     static void encodePlatformData(Encoder&, const WebCore::ProtectionSpace&);
346     static bool decodePlatformData(Decoder&, WebCore::ProtectionSpace&);
347 };
348
349 template<> struct ArgumentCoder<WebCore::Credential> {
350     static void encode(Encoder&, const WebCore::Credential&);
351     static bool decode(Decoder&, WebCore::Credential&);
352     static void encodePlatformData(Encoder&, const WebCore::Credential&);
353     static bool decodePlatformData(Decoder&, WebCore::Credential&);
354 };
355
356 template<> struct ArgumentCoder<WebCore::Cursor> {
357     static void encode(Encoder&, const WebCore::Cursor&);
358     static bool decode(Decoder&, WebCore::Cursor&);
359 };
360
361 template<> struct ArgumentCoder<WebCore::ResourceRequest> {
362     static void encode(Encoder&, const WebCore::ResourceRequest&);
363     static bool decode(Decoder&, WebCore::ResourceRequest&);
364     static void encodePlatformData(Encoder&, const WebCore::ResourceRequest&);
365     static bool decodePlatformData(Decoder&, WebCore::ResourceRequest&);
366 };
367
368 template<> struct ArgumentCoder<WebCore::ResourceError> {
369     static void encode(Encoder&, const WebCore::ResourceError&);
370     static bool decode(Decoder&, WebCore::ResourceError&);
371     static void encodePlatformData(Encoder&, const WebCore::ResourceError&);
372     static bool decodePlatformData(Decoder&, WebCore::ResourceError&);
373 };
374
375 template<> struct ArgumentCoder<WebCore::WindowFeatures> {
376     static void encode(Encoder&, const WebCore::WindowFeatures&);
377     static bool decode(Decoder&, WebCore::WindowFeatures&);
378 };
379
380 template<> struct ArgumentCoder<WebCore::Color> {
381     static void encode(Encoder&, const WebCore::Color&);
382     static bool decode(Decoder&, WebCore::Color&);
383 };
384
385 #if ENABLE(DRAG_SUPPORT)
386 template<> struct ArgumentCoder<WebCore::DragData> {
387     static void encode(Encoder&, const WebCore::DragData&);
388     static bool decode(Decoder&, WebCore::DragData&);
389 };
390 #endif
391
392 #if PLATFORM(COCOA)
393 template<> struct ArgumentCoder<WebCore::MachSendRight> {
394     static void encode(Encoder&, const WebCore::MachSendRight&);
395     static void encode(Encoder&, WebCore::MachSendRight&&);
396     static bool decode(Decoder&, WebCore::MachSendRight&);
397 };
398
399 template<> struct ArgumentCoder<WebCore::KeypressCommand> {
400     static void encode(Encoder&, const WebCore::KeypressCommand&);
401     static std::optional<WebCore::KeypressCommand> decode(Decoder&);
402 };
403 #endif
404
405 #if PLATFORM(IOS)
406 template<> struct ArgumentCoder<WebCore::SelectionRect> {
407     static void encode(Encoder&, const WebCore::SelectionRect&);
408     static std::optional<WebCore::SelectionRect> decode(Decoder&);
409 };
410
411 template<> struct ArgumentCoder<WebCore::Highlight> {
412     static void encode(Encoder&, const WebCore::Highlight&);
413     static bool decode(Decoder&, WebCore::Highlight&);
414 };
415
416 template<> struct ArgumentCoder<WebCore::PasteboardWebContent> {
417     static void encode(Encoder&, const WebCore::PasteboardWebContent&);
418     static bool decode(Decoder&, WebCore::PasteboardWebContent&);
419 };
420
421 template<> struct ArgumentCoder<WebCore::PasteboardURL> {
422     static void encode(Encoder&, const WebCore::PasteboardURL&);
423     static bool decode(Decoder&, WebCore::PasteboardURL&);
424 };
425
426 template<> struct ArgumentCoder<WebCore::PasteboardImage> {
427     static void encode(Encoder&, const WebCore::PasteboardImage&);
428     static bool decode(Decoder&, WebCore::PasteboardImage&);
429 };
430 #endif
431
432 template<> struct ArgumentCoder<WebCore::PasteboardCustomData> {
433     static void encode(Encoder&, const WebCore::PasteboardCustomData&);
434     static bool decode(Decoder&, WebCore::PasteboardCustomData&);
435 };
436
437 #if USE(SOUP)
438 template<> struct ArgumentCoder<WebCore::SoupNetworkProxySettings> {
439     static void encode(Encoder&, const WebCore::SoupNetworkProxySettings&);
440     static bool decode(Decoder&, WebCore::SoupNetworkProxySettings&);
441 };
442 #endif
443
444 #if PLATFORM(WPE)
445 template<> struct ArgumentCoder<WebCore::PasteboardWebContent> {
446     static void encode(Encoder&, const WebCore::PasteboardWebContent&);
447     static bool decode(Decoder&, WebCore::PasteboardWebContent&);
448 };
449 #endif
450
451 template<> struct ArgumentCoder<WebCore::CompositionUnderline> {
452     static void encode(Encoder&, const WebCore::CompositionUnderline&);
453     static std::optional<WebCore::CompositionUnderline> decode(Decoder&);
454 };
455
456 template<> struct ArgumentCoder<WebCore::DatabaseDetails> {
457     static void encode(Encoder&, const WebCore::DatabaseDetails&);
458     static bool decode(Decoder&, WebCore::DatabaseDetails&);
459 };
460
461 template<> struct ArgumentCoder<WebCore::DictationAlternative> {
462     static void encode(Encoder&, const WebCore::DictationAlternative&);
463     static std::optional<WebCore::DictationAlternative> decode(Decoder&);
464 };
465
466 template<> struct ArgumentCoder<WebCore::FileChooserSettings> {
467     static void encode(Encoder&, const WebCore::FileChooserSettings&);
468     static bool decode(Decoder&, WebCore::FileChooserSettings&);
469 };
470
471 template<> struct ArgumentCoder<WebCore::GrammarDetail> {
472     static void encode(Encoder&, const WebCore::GrammarDetail&);
473     static std::optional<WebCore::GrammarDetail> decode(Decoder&);
474 };
475
476 template<> struct ArgumentCoder<WebCore::TextCheckingRequestData> {
477     static void encode(Encoder&, const WebCore::TextCheckingRequestData&);
478     static bool decode(Decoder&, WebCore::TextCheckingRequestData&);
479 };
480
481 template<> struct ArgumentCoder<WebCore::TextCheckingResult> {
482     static void encode(Encoder&, const WebCore::TextCheckingResult&);
483     static std::optional<WebCore::TextCheckingResult> decode(Decoder&);
484 };
485
486 template<> struct ArgumentCoder<WebCore::UserStyleSheet> {
487     static void encode(Encoder&, const WebCore::UserStyleSheet&);
488     static bool decode(Decoder&, WebCore::UserStyleSheet&);
489 };
490
491 template<> struct ArgumentCoder<WebCore::ScrollableAreaParameters> {
492     static void encode(Encoder&, const WebCore::ScrollableAreaParameters&);
493     static bool decode(Decoder&, WebCore::ScrollableAreaParameters&);
494 };
495
496 template<> struct ArgumentCoder<WebCore::FixedPositionViewportConstraints> {
497     static void encode(Encoder&, const WebCore::FixedPositionViewportConstraints&);
498     static bool decode(Decoder&, WebCore::FixedPositionViewportConstraints&);
499 };
500
501 template<> struct ArgumentCoder<WebCore::StickyPositionViewportConstraints> {
502     static void encode(Encoder&, const WebCore::StickyPositionViewportConstraints&);
503     static bool decode(Decoder&, WebCore::StickyPositionViewportConstraints&);
504 };
505
506 #if !USE(COORDINATED_GRAPHICS)
507 template<> struct ArgumentCoder<WebCore::FilterOperations> {
508     static void encode(Encoder&, const WebCore::FilterOperations&);
509     static bool decode(Decoder&, WebCore::FilterOperations&);
510 };
511     
512 template<> struct ArgumentCoder<WebCore::FilterOperation> {
513     static void encode(Encoder&, const WebCore::FilterOperation&);
514 };
515 bool decodeFilterOperation(Decoder&, RefPtr<WebCore::FilterOperation>&);
516 #endif
517
518 template<> struct ArgumentCoder<WebCore::BlobPart> {
519     static void encode(Encoder&, const WebCore::BlobPart&);
520     static std::optional<WebCore::BlobPart> decode(Decoder&);
521 };
522
523 #if ENABLE(CONTENT_FILTERING)
524 template<> struct ArgumentCoder<WebCore::ContentFilterUnblockHandler> {
525     static void encode(Encoder&, const WebCore::ContentFilterUnblockHandler&);
526     static bool decode(Decoder&, WebCore::ContentFilterUnblockHandler&);
527 };
528 #endif
529
530 #if ENABLE(MEDIA_SESSION)
531 template<> struct ArgumentCoder<WebCore::MediaSessionMetadata> {
532     static void encode(Encoder&, const WebCore::MediaSessionMetadata&);
533     static bool decode(Decoder&, WebCore::MediaSessionMetadata&);
534 };
535 #endif
536
537 template<> struct ArgumentCoder<WebCore::TextIndicatorData> {
538     static void encode(Encoder&, const WebCore::TextIndicatorData&);
539     static std::optional<WebCore::TextIndicatorData> decode(Decoder&);
540 };
541
542 template<> struct ArgumentCoder<WebCore::DictionaryPopupInfo> {
543     static void encode(Encoder&, const WebCore::DictionaryPopupInfo&);
544     static bool decode(Decoder&, WebCore::DictionaryPopupInfo&);
545 };
546
547 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
548 template<> struct ArgumentCoder<WebCore::MediaPlaybackTargetContext> {
549     static void encode(Encoder&, const WebCore::MediaPlaybackTargetContext&);
550     static bool decode(Decoder&, WebCore::MediaPlaybackTargetContext&);
551     static void encodePlatformData(Encoder&, const WebCore::MediaPlaybackTargetContext&);
552     static bool decodePlatformData(Decoder&, WebCore::MediaPlaybackTargetContext&);
553 };
554 #endif
555
556 template<> struct ArgumentCoder<WebCore::RecentSearch> {
557     static void encode(Encoder&, const WebCore::RecentSearch&);
558     static std::optional<WebCore::RecentSearch> decode(Decoder&);
559 };
560
561 template<> struct ArgumentCoder<WebCore::ExceptionDetails> {
562     static void encode(Encoder&, const WebCore::ExceptionDetails&);
563     static bool decode(Decoder&, WebCore::ExceptionDetails&);
564 };
565
566 template<> struct ArgumentCoder<WebCore::ResourceLoadStatistics> {
567     static void encode(Encoder&, const WebCore::ResourceLoadStatistics&);
568     static std::optional<WebCore::ResourceLoadStatistics> decode(Decoder&);
569 };
570
571 #if ENABLE(APPLE_PAY)
572
573 template<> struct ArgumentCoder<WebCore::Payment> {
574     static void encode(Encoder&, const WebCore::Payment&);
575     static bool decode(Decoder&, WebCore::Payment&);
576 };
577
578 template<> struct ArgumentCoder<WebCore::PaymentAuthorizationResult> {
579     static void encode(Encoder&, const WebCore::PaymentAuthorizationResult&);
580     static std::optional<WebCore::PaymentAuthorizationResult> decode(Decoder&);
581 };
582
583 template<> struct ArgumentCoder<WebCore::PaymentContact> {
584     static void encode(Encoder&, const WebCore::PaymentContact&);
585     static bool decode(Decoder&, WebCore::PaymentContact&);
586 };
587
588 template<> struct ArgumentCoder<WebCore::PaymentError> {
589     static void encode(Encoder&, const WebCore::PaymentError&);
590     static std::optional<WebCore::PaymentError> decode(Decoder&);
591 };
592
593 template<> struct ArgumentCoder<WebCore::PaymentMerchantSession> {
594     static void encode(Encoder&, const WebCore::PaymentMerchantSession&);
595     static bool decode(Decoder&, WebCore::PaymentMerchantSession&);
596 };
597
598 template<> struct ArgumentCoder<WebCore::PaymentMethod> {
599     static void encode(Encoder&, const WebCore::PaymentMethod&);
600     static bool decode(Decoder&, WebCore::PaymentMethod&);
601 };
602
603 template<> struct ArgumentCoder<WebCore::PaymentMethodUpdate> {
604     static void encode(Encoder&, const WebCore::PaymentMethodUpdate&);
605     static std::optional<WebCore::PaymentMethodUpdate> decode(Decoder&);
606 };
607
608 template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest> {
609     static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest&);
610     static bool decode(Decoder&, WebCore::ApplePaySessionPaymentRequest&);
611 };
612
613 template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::ContactFields> {
614     static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::ContactFields&);
615     static bool decode(Decoder&, WebCore::ApplePaySessionPaymentRequest::ContactFields&);
616 };
617
618 template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::LineItem> {
619     static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::LineItem&);
620     static std::optional<WebCore::ApplePaySessionPaymentRequest::LineItem> decode(Decoder&);
621 };
622
623 template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::MerchantCapabilities> {
624     static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::MerchantCapabilities&);
625     static bool decode(Decoder&, WebCore::ApplePaySessionPaymentRequest::MerchantCapabilities&);
626 };
627
628 template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::ShippingMethod> {
629     static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::ShippingMethod&);
630     static std::optional<WebCore::ApplePaySessionPaymentRequest::ShippingMethod> decode(Decoder&);
631 };
632
633 template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems> {
634     static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems&);
635     static std::optional<WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems> decode(Decoder&);
636 };
637
638 template<> struct ArgumentCoder<WebCore::ShippingContactUpdate> {
639     static void encode(Encoder&, const WebCore::ShippingContactUpdate&);
640     static std::optional<WebCore::ShippingContactUpdate> decode(Decoder&);
641 };
642
643 template<> struct ArgumentCoder<WebCore::ShippingMethodUpdate> {
644     static void encode(Encoder&, const WebCore::ShippingMethodUpdate&);
645     static std::optional<WebCore::ShippingMethodUpdate> decode(Decoder&);
646 };
647
648 #endif
649
650 #if ENABLE(MEDIA_STREAM)
651 template<> struct ArgumentCoder<WebCore::MediaConstraints> {
652     static void encode(Encoder&, const WebCore::MediaConstraints&);
653     static bool decode(Decoder&, WebCore::MediaConstraints&);
654 };
655 #endif
656
657 #if ENABLE(INDEXED_DATABASE)
658
659 template<> struct ArgumentCoder<WebCore::IDBKeyPath> {
660     static void encode(Encoder&, const WebCore::IDBKeyPath&);
661     static bool decode(Decoder&, WebCore::IDBKeyPath&);
662 };
663
664 #endif
665
666 #if ENABLE(SERVICE_WORKER)
667
668 template<> struct ArgumentCoder<WebCore::ServiceWorkerOrClientData> {
669     static void encode(Encoder&, const WebCore::ServiceWorkerOrClientData&);
670     static bool decode(Decoder&, WebCore::ServiceWorkerOrClientData&);
671 };
672
673 template<> struct ArgumentCoder<WebCore::ServiceWorkerOrClientIdentifier> {
674     static void encode(Encoder&, const WebCore::ServiceWorkerOrClientIdentifier&);
675     static bool decode(Decoder&, WebCore::ServiceWorkerOrClientIdentifier&);
676 };
677
678 #endif
679
680 #if ENABLE(CSS_SCROLL_SNAP)
681
682 template<> struct ArgumentCoder<WebCore::ScrollOffsetRange<float>> {
683     static void encode(Encoder&, const WebCore::ScrollOffsetRange<float>&);
684     static std::optional<WebCore::ScrollOffsetRange<float>> decode(Decoder&);
685 };
686
687 #endif
688
689 template<> struct ArgumentCoder<WebCore::MediaSelectionOption> {
690     static void encode(Encoder&, const WebCore::MediaSelectionOption&);
691     static std::optional<WebCore::MediaSelectionOption> decode(Decoder&);
692 };
693
694 template<> struct ArgumentCoder<WebCore::PromisedBlobInfo> {
695     static void encode(Encoder&, const WebCore::PromisedBlobInfo&);
696     static bool decode(Decoder&, WebCore::PromisedBlobInfo&);
697 };
698
699 #if ENABLE(ATTACHMENT_ELEMENT)
700
701 template<> struct ArgumentCoder<WebCore::AttachmentInfo> {
702     static void encode(Encoder&, const WebCore::AttachmentInfo&);
703     static bool decode(Decoder&, WebCore::AttachmentInfo&);
704 };
705
706 #endif
707
708 } // namespace IPC
709
710 namespace WTF {
711
712 template<> struct EnumTraits<WebCore::ColorSpace> {
713     using values = EnumValues<
714     WebCore::ColorSpace,
715     WebCore::ColorSpace::ColorSpaceSRGB,
716     WebCore::ColorSpace::ColorSpaceLinearRGB,
717     WebCore::ColorSpace::ColorSpaceDisplayP3
718     >;
719 };
720
721 template<> struct EnumTraits<WebCore::HasInsecureContent> {
722     using values = EnumValues<
723         WebCore::HasInsecureContent,
724         WebCore::HasInsecureContent::No,
725         WebCore::HasInsecureContent::Yes
726     >;
727 };
728
729 template<> struct EnumTraits<WebCore::AutoplayEvent> {
730     using values = EnumValues<
731         WebCore::AutoplayEvent,
732         WebCore::AutoplayEvent::DidPreventMediaFromPlaying,
733         WebCore::AutoplayEvent::DidPlayMediaPreventedFromPlaying,
734         WebCore::AutoplayEvent::DidAutoplayMediaPastThresholdWithoutUserInterference,
735         WebCore::AutoplayEvent::UserDidInterfereWithPlayback
736     >;
737 };
738
739 template<> struct EnumTraits<WebCore::ShouldSample> {
740     using values = EnumValues<
741         WebCore::ShouldSample,
742         WebCore::ShouldSample::No,
743         WebCore::ShouldSample::Yes
744     >;
745 };
746
747 template<> struct EnumTraits<WebCore::NetworkLoadPriority> {
748     using values = EnumValues<
749         WebCore::NetworkLoadPriority,
750         WebCore::NetworkLoadPriority::Low,
751         WebCore::NetworkLoadPriority::Medium,
752         WebCore::NetworkLoadPriority::High
753     >;
754 };
755
756 template<> struct EnumTraits<WebCore::NotificationDirection> {
757     using values = EnumValues<
758         WebCore::NotificationDirection,
759         WebCore::NotificationDirection::Auto,
760         WebCore::NotificationDirection::Ltr,
761         WebCore::NotificationDirection::Rtl
762     >;
763 };
764
765 #if ENABLE(INDEXED_DATABASE)
766 template<> struct EnumTraits<WebCore::IndexedDB::GetAllType> {
767     using values = EnumValues<
768         WebCore::IndexedDB::GetAllType,
769         WebCore::IndexedDB::GetAllType::Keys,
770         WebCore::IndexedDB::GetAllType::Values
771     >;
772 };
773 #endif
774
775 #if ENABLE(MEDIA_STREAM)
776 template<> struct EnumTraits<WebCore::RealtimeMediaSource::Type> {
777     using values = EnumValues<
778         WebCore::RealtimeMediaSource::Type,
779         WebCore::RealtimeMediaSource::Type::None,
780         WebCore::RealtimeMediaSource::Type::Audio,
781         WebCore::RealtimeMediaSource::Type::Video
782     >;
783 };
784 #endif
785
786 template<> struct EnumTraits<WebCore::MediaSelectionOption::Type> {
787     using values = EnumValues<
788         WebCore::MediaSelectionOption::Type,
789         WebCore::MediaSelectionOption::Type::Regular,
790         WebCore::MediaSelectionOption::Type::LegibleOff,
791         WebCore::MediaSelectionOption::Type::LegibleAuto
792     >;
793 };
794
795 template <> struct EnumTraits<WebCore::StoredCredentialsPolicy> {
796     using values = EnumValues<
797         WebCore::StoredCredentialsPolicy,
798         WebCore::StoredCredentialsPolicy::DoNotUse,
799         WebCore::StoredCredentialsPolicy::Use
800     >;
801 };
802
803 template <> struct EnumTraits<WebCore::WorkerType> {
804     using values = EnumValues<
805         WebCore::WorkerType,
806         WebCore::WorkerType::Classic,
807         WebCore::WorkerType::Module
808     >;
809 };
810
811 } // namespace WTF