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