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