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 ; |
79 | class IntPoint; |
80 | class IntRect; |
81 | class IntSize; |
82 | class KeyframeValueList; |
83 | class LayoutSize; |
84 | class LayoutPoint; |
85 | class LayoutConstraints; |
86 | class LinearTimingFunction; |
87 | class Notification; |
88 | class Path; |
89 | class ProtectionSpace; |
90 | class Region; |
91 | class ResourceError; |
92 | class ResourceRequest; |
93 | class ResourceResponse; |
94 | class SecurityOrigin; |
95 | class SpringTimingFunction; |
96 | class StepsTimingFunction; |
97 | class StickyPositionViewportConstraints; |
98 | class TextCheckingRequestData; |
99 | class TransformationMatrix; |
100 | class UserStyleSheet; |
101 | |
102 | struct CacheQueryOptions; |
103 | struct CompositionUnderline; |
104 | struct DictationAlternative; |
105 | struct ; |
106 | struct EventTrackingRegions; |
107 | struct ExceptionDetails; |
108 | struct FontAttributes; |
109 | struct FileChooserSettings; |
110 | struct ShareData; |
111 | struct ShareDataWithParsedURL; |
112 | struct Length; |
113 | struct GrammarDetail; |
114 | struct MimeClassInfo; |
115 | struct PasteboardImage; |
116 | struct PasteboardCustomData; |
117 | struct PasteboardURL; |
118 | struct PluginInfo; |
119 | struct PromisedAttachmentInfo; |
120 | struct RecentSearch; |
121 | struct ResourceLoadStatistics; |
122 | struct ScrollableAreaParameters; |
123 | struct TextCheckingResult; |
124 | struct TextIndicatorData; |
125 | #if ENABLE(POINTER_EVENTS) |
126 | struct TouchActionData; |
127 | #endif |
128 | struct ViewportAttributes; |
129 | struct WindowFeatures; |
130 | |
131 | template <typename> class RectEdges; |
132 | using FloatBoxExtent = RectEdges<float>; |
133 | |
134 | #if PLATFORM(COCOA) |
135 | struct KeypressCommand; |
136 | #endif |
137 | |
138 | #if PLATFORM(IOS_FAMILY) |
139 | class FloatQuad; |
140 | class SelectionRect; |
141 | struct Highlight; |
142 | struct PasteboardImage; |
143 | struct PasteboardWebContent; |
144 | struct ViewportArguments; |
145 | #endif |
146 | |
147 | #if ENABLE(DATALIST_ELEMENT) |
148 | struct DataListSuggestionInformation; |
149 | #endif |
150 | |
151 | #if USE(SOUP) |
152 | struct SoupNetworkProxySettings; |
153 | #endif |
154 | |
155 | #if USE(LIBWPE) |
156 | struct PasteboardWebContent; |
157 | #endif |
158 | |
159 | #if ENABLE(CONTENT_FILTERING) |
160 | class ContentFilterUnblockHandler; |
161 | #endif |
162 | |
163 | #if ENABLE(WIRELESS_PLAYBACK_TARGET) |
164 | class MediaPlaybackTargetContext; |
165 | #endif |
166 | |
167 | #if ENABLE(MEDIA_SESSION) |
168 | class MediaSessionMetadata; |
169 | #endif |
170 | |
171 | #if ENABLE(MEDIA_STREAM) |
172 | struct MediaConstraints; |
173 | #endif |
174 | |
175 | #if ENABLE(ATTACHMENT_ELEMENT) |
176 | struct SerializedAttachmentData; |
177 | #endif |
178 | |
179 | #if ENABLE(INDEXED_DATABASE) |
180 | using IDBKeyPath = Variant<String, Vector<String>>; |
181 | #endif |
182 | } |
183 | |
184 | namespace IPC { |
185 | |
186 | template<> struct ArgumentCoder<WebCore::AffineTransform> { |
187 | static void encode(Encoder&, const WebCore::AffineTransform&); |
188 | static bool decode(Decoder&, WebCore::AffineTransform&); |
189 | }; |
190 | |
191 | template<> struct ArgumentCoder<WebCore::CacheQueryOptions> { |
192 | static void encode(Encoder&, const WebCore::CacheQueryOptions&); |
193 | static bool decode(Decoder&, WebCore::CacheQueryOptions&); |
194 | }; |
195 | |
196 | template<> struct ArgumentCoder<WebCore::DOMCacheEngine::CacheInfo> { |
197 | static void encode(Encoder&, const WebCore::DOMCacheEngine::CacheInfo&); |
198 | static Optional<WebCore::DOMCacheEngine::CacheInfo> decode(Decoder&); |
199 | }; |
200 | |
201 | template<> 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) |
207 | template<> struct ArgumentCoder<WebCore::TouchActionData> { |
208 | static void encode(Encoder&, const WebCore::TouchActionData&); |
209 | static Optional<WebCore::TouchActionData> decode(Decoder&); |
210 | }; |
211 | #endif |
212 | |
213 | template<> struct ArgumentCoder<WebCore::EventTrackingRegions> { |
214 | static void encode(Encoder&, const WebCore::EventTrackingRegions&); |
215 | static bool decode(Decoder&, WebCore::EventTrackingRegions&); |
216 | }; |
217 | |
218 | template<> struct ArgumentCoder<WebCore::TransformationMatrix> { |
219 | static void encode(Encoder&, const WebCore::TransformationMatrix&); |
220 | static bool decode(Decoder&, WebCore::TransformationMatrix&); |
221 | }; |
222 | |
223 | template<> struct ArgumentCoder<WebCore::LinearTimingFunction> { |
224 | static void encode(Encoder&, const WebCore::LinearTimingFunction&); |
225 | static bool decode(Decoder&, WebCore::LinearTimingFunction&); |
226 | }; |
227 | |
228 | template<> struct ArgumentCoder<WebCore::CubicBezierTimingFunction> { |
229 | static void encode(Encoder&, const WebCore::CubicBezierTimingFunction&); |
230 | static bool decode(Decoder&, WebCore::CubicBezierTimingFunction&); |
231 | }; |
232 | |
233 | template<> struct ArgumentCoder<WebCore::StepsTimingFunction> { |
234 | static void encode(Encoder&, const WebCore::StepsTimingFunction&); |
235 | static bool decode(Decoder&, WebCore::StepsTimingFunction&); |
236 | }; |
237 | |
238 | template<> struct ArgumentCoder<WebCore::SpringTimingFunction> { |
239 | static void encode(Encoder&, const WebCore::SpringTimingFunction&); |
240 | static bool decode(Decoder&, WebCore::SpringTimingFunction&); |
241 | }; |
242 | |
243 | template<> struct ArgumentCoder<WebCore::CertificateInfo> { |
244 | static void encode(Encoder&, const WebCore::CertificateInfo&); |
245 | static bool decode(Decoder&, WebCore::CertificateInfo&); |
246 | }; |
247 | |
248 | template<> 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 | |
254 | template<> struct ArgumentCoder<WebCore::FloatPoint3D> { |
255 | static void encode(Encoder&, const WebCore::FloatPoint3D&); |
256 | static bool decode(Decoder&, WebCore::FloatPoint3D&); |
257 | }; |
258 | |
259 | template<> 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 | |
265 | template<> struct ArgumentCoder<WebCore::FloatBoxExtent> { |
266 | static void encode(Encoder&, const WebCore::FloatBoxExtent&); |
267 | static bool decode(Decoder&, WebCore::FloatBoxExtent&); |
268 | }; |
269 | |
270 | template<> struct ArgumentCoder<WebCore::FloatSize> { |
271 | static void encode(Encoder&, const WebCore::FloatSize&); |
272 | static bool decode(Decoder&, WebCore::FloatSize&); |
273 | }; |
274 | |
275 | template<> 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) |
281 | template<> struct ArgumentCoder<WebCore::FloatQuad> { |
282 | static void encode(Encoder&, const WebCore::FloatQuad&); |
283 | static Optional<WebCore::FloatQuad> decode(Decoder&); |
284 | }; |
285 | |
286 | template<> 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 | |
293 | template<> 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 | |
299 | template<> 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 | |
305 | template<> 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 | |
311 | template<> struct ArgumentCoder<WebCore::LayoutSize> { |
312 | static void encode(Encoder&, const WebCore::LayoutSize&); |
313 | static bool decode(Decoder&, WebCore::LayoutSize&); |
314 | }; |
315 | |
316 | template<> struct ArgumentCoder<WebCore::LayoutPoint> { |
317 | static void encode(Encoder&, const WebCore::LayoutPoint&); |
318 | static bool decode(Decoder&, WebCore::LayoutPoint&); |
319 | }; |
320 | |
321 | template<> 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 | |
327 | template<> struct ArgumentCoder<WebCore::Length> { |
328 | static void encode(Encoder&, const WebCore::Length&); |
329 | static bool decode(Decoder&, WebCore::Length&); |
330 | }; |
331 | |
332 | template<> struct ArgumentCoder<WebCore::ViewportAttributes> { |
333 | static void encode(Encoder&, const WebCore::ViewportAttributes&); |
334 | static bool decode(Decoder&, WebCore::ViewportAttributes&); |
335 | }; |
336 | |
337 | template<> struct ArgumentCoder<WebCore::MimeClassInfo> { |
338 | static void encode(Encoder&, const WebCore::MimeClassInfo&); |
339 | static Optional<WebCore::MimeClassInfo> decode(Decoder&); |
340 | }; |
341 | |
342 | template<> struct ArgumentCoder<WebCore::PluginInfo> { |
343 | static void encode(Encoder&, const WebCore::PluginInfo&); |
344 | static Optional<WebCore::PluginInfo> decode(Decoder&); |
345 | }; |
346 | |
347 | template<> struct ArgumentCoder<WebCore::AuthenticationChallenge> { |
348 | static void encode(Encoder&, const WebCore::AuthenticationChallenge&); |
349 | static bool decode(Decoder&, WebCore::AuthenticationChallenge&); |
350 | }; |
351 | |
352 | template<> 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 | |
359 | template<> 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 | |
366 | template<> struct ArgumentCoder<WebCore::Cursor> { |
367 | static void encode(Encoder&, const WebCore::Cursor&); |
368 | static bool decode(Decoder&, WebCore::Cursor&); |
369 | }; |
370 | |
371 | template<> 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 | |
378 | template<> 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 | |
385 | template<> struct ArgumentCoder<WebCore::WindowFeatures> { |
386 | static void encode(Encoder&, const WebCore::WindowFeatures&); |
387 | static bool decode(Decoder&, WebCore::WindowFeatures&); |
388 | }; |
389 | |
390 | template<> 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) |
397 | template<> 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) |
404 | template<> 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 | |
410 | template<> 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) |
417 | template<> struct ArgumentCoder<WebCore::SelectionRect> { |
418 | static void encode(Encoder&, const WebCore::SelectionRect&); |
419 | static Optional<WebCore::SelectionRect> decode(Decoder&); |
420 | }; |
421 | |
422 | template<> struct ArgumentCoder<WebCore::Highlight> { |
423 | static void encode(Encoder&, const WebCore::Highlight&); |
424 | static bool decode(Decoder&, WebCore::Highlight&); |
425 | }; |
426 | |
427 | template<> struct ArgumentCoder<WebCore::PasteboardWebContent> { |
428 | static void encode(Encoder&, const WebCore::PasteboardWebContent&); |
429 | static bool decode(Decoder&, WebCore::PasteboardWebContent&); |
430 | }; |
431 | |
432 | template<> struct ArgumentCoder<WebCore::PasteboardImage> { |
433 | static void encode(Encoder&, const WebCore::PasteboardImage&); |
434 | static bool decode(Decoder&, WebCore::PasteboardImage&); |
435 | }; |
436 | #endif |
437 | |
438 | template<> struct ArgumentCoder<WebCore::PasteboardCustomData> { |
439 | static void encode(Encoder&, const WebCore::PasteboardCustomData&); |
440 | static bool decode(Decoder&, WebCore::PasteboardCustomData&); |
441 | }; |
442 | |
443 | template<> 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) |
449 | template<> 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) |
456 | template<> 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) |
463 | template<> struct ArgumentCoder<WebCore::CurlProxySettings> { |
464 | static void encode(Encoder&, const WebCore::CurlProxySettings&); |
465 | static Optional<WebCore::CurlProxySettings> decode(Decoder&); |
466 | }; |
467 | #endif |
468 | |
469 | template<> struct ArgumentCoder<WebCore::CompositionUnderline> { |
470 | static void encode(Encoder&, const WebCore::CompositionUnderline&); |
471 | static Optional<WebCore::CompositionUnderline> decode(Decoder&); |
472 | }; |
473 | |
474 | template<> 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) |
480 | template<> struct ArgumentCoder<WebCore::DataListSuggestionInformation> { |
481 | static void encode(Encoder&, const WebCore::DataListSuggestionInformation&); |
482 | static bool decode(Decoder&, WebCore::DataListSuggestionInformation&); |
483 | }; |
484 | #endif |
485 | |
486 | template<> struct ArgumentCoder<WebCore::DictationAlternative> { |
487 | static void encode(Encoder&, const WebCore::DictationAlternative&); |
488 | static Optional<WebCore::DictationAlternative> decode(Decoder&); |
489 | }; |
490 | |
491 | template<> struct ArgumentCoder<WebCore::FileChooserSettings> { |
492 | static void encode(Encoder&, const WebCore::FileChooserSettings&); |
493 | static bool decode(Decoder&, WebCore::FileChooserSettings&); |
494 | }; |
495 | |
496 | template<> struct ArgumentCoder<WebCore::ShareData> { |
497 | static void encode(Encoder&, const WebCore::ShareData&); |
498 | static bool decode(Decoder&, WebCore::ShareData&); |
499 | }; |
500 | |
501 | template<> struct ArgumentCoder<WebCore::ShareDataWithParsedURL> { |
502 | static void encode(Encoder&, const WebCore::ShareDataWithParsedURL&); |
503 | static bool decode(Decoder&, WebCore::ShareDataWithParsedURL&); |
504 | }; |
505 | |
506 | template<> struct ArgumentCoder<WebCore::GrammarDetail> { |
507 | static void encode(Encoder&, const WebCore::GrammarDetail&); |
508 | static Optional<WebCore::GrammarDetail> decode(Decoder&); |
509 | }; |
510 | |
511 | template<> struct ArgumentCoder<WebCore::TextCheckingRequestData> { |
512 | static void encode(Encoder&, const WebCore::TextCheckingRequestData&); |
513 | static bool decode(Decoder&, WebCore::TextCheckingRequestData&); |
514 | }; |
515 | |
516 | template<> struct ArgumentCoder<WebCore::TextCheckingResult> { |
517 | static void encode(Encoder&, const WebCore::TextCheckingResult&); |
518 | static Optional<WebCore::TextCheckingResult> decode(Decoder&); |
519 | }; |
520 | |
521 | template<> struct ArgumentCoder<WebCore::UserStyleSheet> { |
522 | static void encode(Encoder&, const WebCore::UserStyleSheet&); |
523 | static bool decode(Decoder&, WebCore::UserStyleSheet&); |
524 | }; |
525 | |
526 | template<> struct ArgumentCoder<WebCore::ScrollableAreaParameters> { |
527 | static void encode(Encoder&, const WebCore::ScrollableAreaParameters&); |
528 | static bool decode(Decoder&, WebCore::ScrollableAreaParameters&); |
529 | }; |
530 | |
531 | template<> struct ArgumentCoder<WebCore::FixedPositionViewportConstraints> { |
532 | static void encode(Encoder&, const WebCore::FixedPositionViewportConstraints&); |
533 | static bool decode(Decoder&, WebCore::FixedPositionViewportConstraints&); |
534 | }; |
535 | |
536 | template<> struct ArgumentCoder<WebCore::StickyPositionViewportConstraints> { |
537 | static void encode(Encoder&, const WebCore::StickyPositionViewportConstraints&); |
538 | static bool decode(Decoder&, WebCore::StickyPositionViewportConstraints&); |
539 | }; |
540 | |
541 | template<> 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) |
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 (Encoder&, const WebCore::DictionaryPopupInfo&); |
584 | static bool (Decoder&, WebCore::DictionaryPopupInfo&); |
585 | static void (Encoder&, const WebCore::DictionaryPopupInfo&); |
586 | static bool (Decoder&, WebCore::DictionaryPopupInfo&); |
587 | }; |
588 | |
589 | #if ENABLE(WIRELESS_PLAYBACK_TARGET) |
590 | template<> 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 | |
598 | template<> struct ArgumentCoder<WebCore::RecentSearch> { |
599 | static void encode(Encoder&, const WebCore::RecentSearch&); |
600 | static Optional<WebCore::RecentSearch> decode(Decoder&); |
601 | }; |
602 | |
603 | template<> struct ArgumentCoder<WebCore::ExceptionDetails> { |
604 | static void encode(Encoder&, const WebCore::ExceptionDetails&); |
605 | static bool decode(Decoder&, WebCore::ExceptionDetails&); |
606 | }; |
607 | |
608 | template<> 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 | |
615 | template<> struct ArgumentCoder<WebCore::Payment> { |
616 | static void encode(Encoder&, const WebCore::Payment&); |
617 | static Optional<WebCore::Payment> decode(Decoder&); |
618 | }; |
619 | |
620 | template<> struct ArgumentCoder<WebCore::PaymentAuthorizationResult> { |
621 | static void encode(Encoder&, const WebCore::PaymentAuthorizationResult&); |
622 | static Optional<WebCore::PaymentAuthorizationResult> decode(Decoder&); |
623 | }; |
624 | |
625 | template<> struct ArgumentCoder<WebCore::PaymentContact> { |
626 | static void encode(Encoder&, const WebCore::PaymentContact&); |
627 | static Optional<WebCore::PaymentContact> decode(Decoder&); |
628 | }; |
629 | |
630 | template<> struct ArgumentCoder<WebCore::PaymentError> { |
631 | static void encode(Encoder&, const WebCore::PaymentError&); |
632 | static Optional<WebCore::PaymentError> decode(Decoder&); |
633 | }; |
634 | |
635 | template<> struct ArgumentCoder<WebCore::PaymentMerchantSession> { |
636 | static void encode(Encoder&, const WebCore::PaymentMerchantSession&); |
637 | static Optional<WebCore::PaymentMerchantSession> decode(Decoder&); |
638 | }; |
639 | |
640 | template<> struct ArgumentCoder<WebCore::PaymentMethod> { |
641 | static void encode(Encoder&, const WebCore::PaymentMethod&); |
642 | static Optional<WebCore::PaymentMethod> decode(Decoder&); |
643 | }; |
644 | |
645 | template<> struct ArgumentCoder<WebCore::PaymentMethodUpdate> { |
646 | static void encode(Encoder&, const WebCore::PaymentMethodUpdate&); |
647 | static Optional<WebCore::PaymentMethodUpdate> decode(Decoder&); |
648 | }; |
649 | |
650 | template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest> { |
651 | static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest&); |
652 | static bool decode(Decoder&, WebCore::ApplePaySessionPaymentRequest&); |
653 | }; |
654 | |
655 | template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::ContactFields> { |
656 | static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::ContactFields&); |
657 | static bool decode(Decoder&, WebCore::ApplePaySessionPaymentRequest::ContactFields&); |
658 | }; |
659 | |
660 | template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::LineItem> { |
661 | static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::LineItem&); |
662 | static Optional<WebCore::ApplePaySessionPaymentRequest::LineItem> decode(Decoder&); |
663 | }; |
664 | |
665 | template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::MerchantCapabilities> { |
666 | static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::MerchantCapabilities&); |
667 | static bool decode(Decoder&, WebCore::ApplePaySessionPaymentRequest::MerchantCapabilities&); |
668 | }; |
669 | |
670 | template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::ShippingMethod> { |
671 | static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::ShippingMethod&); |
672 | static Optional<WebCore::ApplePaySessionPaymentRequest::ShippingMethod> decode(Decoder&); |
673 | }; |
674 | |
675 | template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems> { |
676 | static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems&); |
677 | static Optional<WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems> decode(Decoder&); |
678 | }; |
679 | |
680 | template<> struct ArgumentCoder<WebCore::ShippingContactUpdate> { |
681 | static void encode(Encoder&, const WebCore::ShippingContactUpdate&); |
682 | static Optional<WebCore::ShippingContactUpdate> decode(Decoder&); |
683 | }; |
684 | |
685 | template<> 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) |
693 | template<> 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 | |
701 | template<> 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 | |
710 | template<> struct ArgumentCoder<WebCore::ServiceWorkerOrClientData> { |
711 | static void encode(Encoder&, const WebCore::ServiceWorkerOrClientData&); |
712 | static bool decode(Decoder&, WebCore::ServiceWorkerOrClientData&); |
713 | }; |
714 | |
715 | template<> 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 | |
724 | template<> 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 | |
731 | template<> struct ArgumentCoder<WebCore::MediaSelectionOption> { |
732 | static void encode(Encoder&, const WebCore::MediaSelectionOption&); |
733 | static Optional<WebCore::MediaSelectionOption> decode(Decoder&); |
734 | }; |
735 | |
736 | template<> struct ArgumentCoder<WebCore::PromisedAttachmentInfo> { |
737 | static void encode(Encoder&, const WebCore::PromisedAttachmentInfo&); |
738 | static bool decode(Decoder&, WebCore::PromisedAttachmentInfo&); |
739 | }; |
740 | |
741 | template<> 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 | |
746 | template<> 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 | |
755 | template<> 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 | |
764 | namespace WTF { |
765 | |
766 | template<> 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 | |
775 | template<> 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 | |
785 | template<> 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 | |
800 | template<> 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 | |
810 | template<> 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) |
820 | template<> 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) |
830 | template<> 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 | |
840 | template<> 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 | |
849 | template <> struct EnumTraits<WebCore::WorkerType> { |
850 | using values = EnumValues< |
851 | WebCore::WorkerType, |
852 | WebCore::WorkerType::Classic, |
853 | WebCore::WorkerType::Module |
854 | >; |
855 | }; |
856 | |
857 | template<> 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) |
867 | template <> 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 | |
877 | template<> struct EnumTraits<WTFLogChannelState> { |
878 | using values = EnumValues< |
879 | WTFLogChannelState, |
880 | WTFLogChannelState::Off, |
881 | WTFLogChannelState::On, |
882 | WTFLogChannelState::OnWithAccumulation |
883 | >; |
884 | }; |
885 | |
886 | #undef Always |
887 | template<> 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 | |