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