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 VelocityData; |
129 | struct ViewportAttributes; |
130 | struct WindowFeatures; |
131 | |
132 | template <typename> class RectEdges; |
133 | using FloatBoxExtent = RectEdges<float>; |
134 | |
135 | #if PLATFORM(COCOA) |
136 | struct KeypressCommand; |
137 | #endif |
138 | |
139 | #if PLATFORM(IOS_FAMILY) |
140 | class FloatQuad; |
141 | class SelectionRect; |
142 | struct Highlight; |
143 | struct PasteboardImage; |
144 | struct PasteboardWebContent; |
145 | struct ViewportArguments; |
146 | #endif |
147 | |
148 | #if ENABLE(DATALIST_ELEMENT) |
149 | struct DataListSuggestionInformation; |
150 | #endif |
151 | |
152 | #if USE(SOUP) |
153 | struct SoupNetworkProxySettings; |
154 | #endif |
155 | |
156 | #if USE(LIBWPE) |
157 | struct PasteboardWebContent; |
158 | #endif |
159 | |
160 | #if ENABLE(CONTENT_FILTERING) |
161 | class ContentFilterUnblockHandler; |
162 | #endif |
163 | |
164 | #if ENABLE(WIRELESS_PLAYBACK_TARGET) |
165 | class MediaPlaybackTargetContext; |
166 | #endif |
167 | |
168 | #if ENABLE(MEDIA_SESSION) |
169 | class MediaSessionMetadata; |
170 | #endif |
171 | |
172 | #if ENABLE(MEDIA_STREAM) |
173 | struct MediaConstraints; |
174 | #endif |
175 | |
176 | #if ENABLE(ATTACHMENT_ELEMENT) |
177 | struct SerializedAttachmentData; |
178 | #endif |
179 | |
180 | #if ENABLE(INDEXED_DATABASE) |
181 | using IDBKeyPath = Variant<String, Vector<String>>; |
182 | #endif |
183 | } |
184 | |
185 | namespace IPC { |
186 | |
187 | template<> struct ArgumentCoder<WebCore::AffineTransform> { |
188 | static void encode(Encoder&, const WebCore::AffineTransform&); |
189 | static bool decode(Decoder&, WebCore::AffineTransform&); |
190 | }; |
191 | |
192 | template<> struct ArgumentCoder<WebCore::CacheQueryOptions> { |
193 | static void encode(Encoder&, const WebCore::CacheQueryOptions&); |
194 | static bool decode(Decoder&, WebCore::CacheQueryOptions&); |
195 | }; |
196 | |
197 | template<> struct ArgumentCoder<WebCore::DOMCacheEngine::CacheInfo> { |
198 | static void encode(Encoder&, const WebCore::DOMCacheEngine::CacheInfo&); |
199 | static Optional<WebCore::DOMCacheEngine::CacheInfo> decode(Decoder&); |
200 | }; |
201 | |
202 | template<> 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) |
208 | template<> struct ArgumentCoder<WebCore::TouchActionData> { |
209 | static void encode(Encoder&, const WebCore::TouchActionData&); |
210 | static Optional<WebCore::TouchActionData> decode(Decoder&); |
211 | }; |
212 | #endif |
213 | |
214 | template<> struct ArgumentCoder<WebCore::EventTrackingRegions> { |
215 | static void encode(Encoder&, const WebCore::EventTrackingRegions&); |
216 | static bool decode(Decoder&, WebCore::EventTrackingRegions&); |
217 | }; |
218 | |
219 | template<> struct ArgumentCoder<WebCore::TransformationMatrix> { |
220 | static void encode(Encoder&, const WebCore::TransformationMatrix&); |
221 | static bool decode(Decoder&, WebCore::TransformationMatrix&); |
222 | }; |
223 | |
224 | template<> struct ArgumentCoder<WebCore::LinearTimingFunction> { |
225 | static void encode(Encoder&, const WebCore::LinearTimingFunction&); |
226 | static bool decode(Decoder&, WebCore::LinearTimingFunction&); |
227 | }; |
228 | |
229 | template<> struct ArgumentCoder<WebCore::CubicBezierTimingFunction> { |
230 | static void encode(Encoder&, const WebCore::CubicBezierTimingFunction&); |
231 | static bool decode(Decoder&, WebCore::CubicBezierTimingFunction&); |
232 | }; |
233 | |
234 | template<> struct ArgumentCoder<WebCore::StepsTimingFunction> { |
235 | static void encode(Encoder&, const WebCore::StepsTimingFunction&); |
236 | static bool decode(Decoder&, WebCore::StepsTimingFunction&); |
237 | }; |
238 | |
239 | template<> struct ArgumentCoder<WebCore::SpringTimingFunction> { |
240 | static void encode(Encoder&, const WebCore::SpringTimingFunction&); |
241 | static bool decode(Decoder&, WebCore::SpringTimingFunction&); |
242 | }; |
243 | |
244 | template<> struct ArgumentCoder<WebCore::CertificateInfo> { |
245 | static void encode(Encoder&, const WebCore::CertificateInfo&); |
246 | static bool decode(Decoder&, WebCore::CertificateInfo&); |
247 | }; |
248 | |
249 | template<> 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 | |
255 | template<> struct ArgumentCoder<WebCore::FloatPoint3D> { |
256 | static void encode(Encoder&, const WebCore::FloatPoint3D&); |
257 | static bool decode(Decoder&, WebCore::FloatPoint3D&); |
258 | }; |
259 | |
260 | template<> 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 | |
266 | template<> struct ArgumentCoder<WebCore::FloatBoxExtent> { |
267 | static void encode(Encoder&, const WebCore::FloatBoxExtent&); |
268 | static bool decode(Decoder&, WebCore::FloatBoxExtent&); |
269 | }; |
270 | |
271 | template<> struct ArgumentCoder<WebCore::FloatSize> { |
272 | static void encode(Encoder&, const WebCore::FloatSize&); |
273 | static bool decode(Decoder&, WebCore::FloatSize&); |
274 | }; |
275 | |
276 | template<> 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) |
282 | template<> struct ArgumentCoder<WebCore::FloatQuad> { |
283 | static void encode(Encoder&, const WebCore::FloatQuad&); |
284 | static Optional<WebCore::FloatQuad> decode(Decoder&); |
285 | }; |
286 | |
287 | template<> 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 | |
294 | template<> 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 | |
300 | template<> 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 | |
306 | template<> 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 | |
312 | template<> struct ArgumentCoder<WebCore::LayoutSize> { |
313 | static void encode(Encoder&, const WebCore::LayoutSize&); |
314 | static bool decode(Decoder&, WebCore::LayoutSize&); |
315 | }; |
316 | |
317 | template<> struct ArgumentCoder<WebCore::LayoutPoint> { |
318 | static void encode(Encoder&, const WebCore::LayoutPoint&); |
319 | static bool decode(Decoder&, WebCore::LayoutPoint&); |
320 | }; |
321 | |
322 | template<> 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 | |
328 | template<> struct ArgumentCoder<WebCore::Length> { |
329 | static void encode(Encoder&, const WebCore::Length&); |
330 | static bool decode(Decoder&, WebCore::Length&); |
331 | }; |
332 | |
333 | template<> struct ArgumentCoder<WebCore::ViewportAttributes> { |
334 | static void encode(Encoder&, const WebCore::ViewportAttributes&); |
335 | static bool decode(Decoder&, WebCore::ViewportAttributes&); |
336 | }; |
337 | |
338 | template<> struct ArgumentCoder<WebCore::VelocityData> { |
339 | static void encode(Encoder&, const WebCore::VelocityData&); |
340 | static bool decode(Decoder&, WebCore::VelocityData&); |
341 | }; |
342 | |
343 | template<> struct ArgumentCoder<WebCore::MimeClassInfo> { |
344 | static void encode(Encoder&, const WebCore::MimeClassInfo&); |
345 | static Optional<WebCore::MimeClassInfo> decode(Decoder&); |
346 | }; |
347 | |
348 | template<> struct ArgumentCoder<WebCore::PluginInfo> { |
349 | static void encode(Encoder&, const WebCore::PluginInfo&); |
350 | static Optional<WebCore::PluginInfo> decode(Decoder&); |
351 | }; |
352 | |
353 | template<> struct ArgumentCoder<WebCore::AuthenticationChallenge> { |
354 | static void encode(Encoder&, const WebCore::AuthenticationChallenge&); |
355 | static bool decode(Decoder&, WebCore::AuthenticationChallenge&); |
356 | }; |
357 | |
358 | template<> 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 | |
365 | template<> 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 | |
372 | template<> struct ArgumentCoder<WebCore::Cursor> { |
373 | static void encode(Encoder&, const WebCore::Cursor&); |
374 | static bool decode(Decoder&, WebCore::Cursor&); |
375 | }; |
376 | |
377 | template<> 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 | |
384 | template<> 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 | |
391 | template<> struct ArgumentCoder<WebCore::WindowFeatures> { |
392 | static void encode(Encoder&, const WebCore::WindowFeatures&); |
393 | static bool decode(Decoder&, WebCore::WindowFeatures&); |
394 | }; |
395 | |
396 | template<> 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) |
403 | template<> 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) |
410 | template<> 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 | |
416 | template<> 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) |
423 | template<> struct ArgumentCoder<WebCore::SelectionRect> { |
424 | static void encode(Encoder&, const WebCore::SelectionRect&); |
425 | static Optional<WebCore::SelectionRect> decode(Decoder&); |
426 | }; |
427 | |
428 | template<> struct ArgumentCoder<WebCore::Highlight> { |
429 | static void encode(Encoder&, const WebCore::Highlight&); |
430 | static bool decode(Decoder&, WebCore::Highlight&); |
431 | }; |
432 | |
433 | template<> struct ArgumentCoder<WebCore::PasteboardWebContent> { |
434 | static void encode(Encoder&, const WebCore::PasteboardWebContent&); |
435 | static bool decode(Decoder&, WebCore::PasteboardWebContent&); |
436 | }; |
437 | |
438 | template<> struct ArgumentCoder<WebCore::PasteboardImage> { |
439 | static void encode(Encoder&, const WebCore::PasteboardImage&); |
440 | static bool decode(Decoder&, WebCore::PasteboardImage&); |
441 | }; |
442 | #endif |
443 | |
444 | template<> struct ArgumentCoder<WebCore::PasteboardCustomData> { |
445 | static void encode(Encoder&, const WebCore::PasteboardCustomData&); |
446 | static bool decode(Decoder&, WebCore::PasteboardCustomData&); |
447 | }; |
448 | |
449 | template<> 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) |
455 | template<> 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) |
462 | template<> 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) |
469 | template<> struct ArgumentCoder<WebCore::CurlProxySettings> { |
470 | static void encode(Encoder&, const WebCore::CurlProxySettings&); |
471 | static Optional<WebCore::CurlProxySettings> decode(Decoder&); |
472 | }; |
473 | #endif |
474 | |
475 | template<> struct ArgumentCoder<WebCore::CompositionUnderline> { |
476 | static void encode(Encoder&, const WebCore::CompositionUnderline&); |
477 | static Optional<WebCore::CompositionUnderline> decode(Decoder&); |
478 | }; |
479 | |
480 | template<> 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) |
486 | template<> struct ArgumentCoder<WebCore::DataListSuggestionInformation> { |
487 | static void encode(Encoder&, const WebCore::DataListSuggestionInformation&); |
488 | static bool decode(Decoder&, WebCore::DataListSuggestionInformation&); |
489 | }; |
490 | #endif |
491 | |
492 | template<> struct ArgumentCoder<WebCore::DictationAlternative> { |
493 | static void encode(Encoder&, const WebCore::DictationAlternative&); |
494 | static Optional<WebCore::DictationAlternative> decode(Decoder&); |
495 | }; |
496 | |
497 | template<> struct ArgumentCoder<WebCore::FileChooserSettings> { |
498 | static void encode(Encoder&, const WebCore::FileChooserSettings&); |
499 | static bool decode(Decoder&, WebCore::FileChooserSettings&); |
500 | }; |
501 | |
502 | template<> struct ArgumentCoder<WebCore::ShareData> { |
503 | static void encode(Encoder&, const WebCore::ShareData&); |
504 | static bool decode(Decoder&, WebCore::ShareData&); |
505 | }; |
506 | |
507 | template<> struct ArgumentCoder<WebCore::ShareDataWithParsedURL> { |
508 | static void encode(Encoder&, const WebCore::ShareDataWithParsedURL&); |
509 | static bool decode(Decoder&, WebCore::ShareDataWithParsedURL&); |
510 | }; |
511 | |
512 | template<> struct ArgumentCoder<WebCore::GrammarDetail> { |
513 | static void encode(Encoder&, const WebCore::GrammarDetail&); |
514 | static Optional<WebCore::GrammarDetail> decode(Decoder&); |
515 | }; |
516 | |
517 | template<> struct ArgumentCoder<WebCore::TextCheckingRequestData> { |
518 | static void encode(Encoder&, const WebCore::TextCheckingRequestData&); |
519 | static bool decode(Decoder&, WebCore::TextCheckingRequestData&); |
520 | }; |
521 | |
522 | template<> struct ArgumentCoder<WebCore::TextCheckingResult> { |
523 | static void encode(Encoder&, const WebCore::TextCheckingResult&); |
524 | static Optional<WebCore::TextCheckingResult> decode(Decoder&); |
525 | }; |
526 | |
527 | template<> struct ArgumentCoder<WebCore::UserStyleSheet> { |
528 | static void encode(Encoder&, const WebCore::UserStyleSheet&); |
529 | static bool decode(Decoder&, WebCore::UserStyleSheet&); |
530 | }; |
531 | |
532 | template<> struct ArgumentCoder<WebCore::ScrollableAreaParameters> { |
533 | static void encode(Encoder&, const WebCore::ScrollableAreaParameters&); |
534 | static bool decode(Decoder&, WebCore::ScrollableAreaParameters&); |
535 | }; |
536 | |
537 | template<> struct ArgumentCoder<WebCore::FixedPositionViewportConstraints> { |
538 | static void encode(Encoder&, const WebCore::FixedPositionViewportConstraints&); |
539 | static bool decode(Decoder&, WebCore::FixedPositionViewportConstraints&); |
540 | }; |
541 | |
542 | template<> struct ArgumentCoder<WebCore::StickyPositionViewportConstraints> { |
543 | static void encode(Encoder&, const WebCore::StickyPositionViewportConstraints&); |
544 | static bool decode(Decoder&, WebCore::StickyPositionViewportConstraints&); |
545 | }; |
546 | |
547 | template<> 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) |
553 | template<> struct ArgumentCoder<WebCore::FilterOperations> { |
554 | static void encode(Encoder&, const WebCore::FilterOperations&); |
555 | static bool decode(Decoder&, WebCore::FilterOperations&); |
556 | }; |
557 | |
558 | template<> struct ArgumentCoder<WebCore::FilterOperation> { |
559 | static void encode(Encoder&, const WebCore::FilterOperation&); |
560 | }; |
561 | bool decodeFilterOperation(Decoder&, RefPtr<WebCore::FilterOperation>&); |
562 | #endif |
563 | |
564 | template<> 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) |
570 | template<> 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) |
577 | template<> struct ArgumentCoder<WebCore::MediaSessionMetadata> { |
578 | static void encode(Encoder&, const WebCore::MediaSessionMetadata&); |
579 | static bool decode(Decoder&, WebCore::MediaSessionMetadata&); |
580 | }; |
581 | #endif |
582 | |
583 | template<> struct ArgumentCoder<WebCore::TextIndicatorData> { |
584 | static void encode(Encoder&, const WebCore::TextIndicatorData&); |
585 | static Optional<WebCore::TextIndicatorData> decode(Decoder&); |
586 | }; |
587 | |
588 | template<> struct ArgumentCoder<WebCore::DictionaryPopupInfo> { |
589 | static void (Encoder&, const WebCore::DictionaryPopupInfo&); |
590 | static bool (Decoder&, WebCore::DictionaryPopupInfo&); |
591 | static void (Encoder&, const WebCore::DictionaryPopupInfo&); |
592 | static bool (Decoder&, WebCore::DictionaryPopupInfo&); |
593 | }; |
594 | |
595 | #if ENABLE(WIRELESS_PLAYBACK_TARGET) |
596 | template<> 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 | |
604 | template<> struct ArgumentCoder<WebCore::RecentSearch> { |
605 | static void encode(Encoder&, const WebCore::RecentSearch&); |
606 | static Optional<WebCore::RecentSearch> decode(Decoder&); |
607 | }; |
608 | |
609 | template<> struct ArgumentCoder<WebCore::ExceptionDetails> { |
610 | static void encode(Encoder&, const WebCore::ExceptionDetails&); |
611 | static bool decode(Decoder&, WebCore::ExceptionDetails&); |
612 | }; |
613 | |
614 | template<> 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 | |
621 | template<> struct ArgumentCoder<WebCore::Payment> { |
622 | static void encode(Encoder&, const WebCore::Payment&); |
623 | static Optional<WebCore::Payment> decode(Decoder&); |
624 | }; |
625 | |
626 | template<> struct ArgumentCoder<WebCore::PaymentAuthorizationResult> { |
627 | static void encode(Encoder&, const WebCore::PaymentAuthorizationResult&); |
628 | static Optional<WebCore::PaymentAuthorizationResult> decode(Decoder&); |
629 | }; |
630 | |
631 | template<> struct ArgumentCoder<WebCore::PaymentContact> { |
632 | static void encode(Encoder&, const WebCore::PaymentContact&); |
633 | static Optional<WebCore::PaymentContact> decode(Decoder&); |
634 | }; |
635 | |
636 | template<> struct ArgumentCoder<WebCore::PaymentError> { |
637 | static void encode(Encoder&, const WebCore::PaymentError&); |
638 | static Optional<WebCore::PaymentError> decode(Decoder&); |
639 | }; |
640 | |
641 | template<> struct ArgumentCoder<WebCore::PaymentMerchantSession> { |
642 | static void encode(Encoder&, const WebCore::PaymentMerchantSession&); |
643 | static Optional<WebCore::PaymentMerchantSession> decode(Decoder&); |
644 | }; |
645 | |
646 | template<> struct ArgumentCoder<WebCore::PaymentMethod> { |
647 | static void encode(Encoder&, const WebCore::PaymentMethod&); |
648 | static Optional<WebCore::PaymentMethod> decode(Decoder&); |
649 | }; |
650 | |
651 | template<> struct ArgumentCoder<WebCore::PaymentMethodUpdate> { |
652 | static void encode(Encoder&, const WebCore::PaymentMethodUpdate&); |
653 | static Optional<WebCore::PaymentMethodUpdate> decode(Decoder&); |
654 | }; |
655 | |
656 | template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest> { |
657 | static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest&); |
658 | static bool decode(Decoder&, WebCore::ApplePaySessionPaymentRequest&); |
659 | }; |
660 | |
661 | template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::ContactFields> { |
662 | static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::ContactFields&); |
663 | static bool decode(Decoder&, WebCore::ApplePaySessionPaymentRequest::ContactFields&); |
664 | }; |
665 | |
666 | template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::LineItem> { |
667 | static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::LineItem&); |
668 | static Optional<WebCore::ApplePaySessionPaymentRequest::LineItem> decode(Decoder&); |
669 | }; |
670 | |
671 | template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::MerchantCapabilities> { |
672 | static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::MerchantCapabilities&); |
673 | static bool decode(Decoder&, WebCore::ApplePaySessionPaymentRequest::MerchantCapabilities&); |
674 | }; |
675 | |
676 | template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::ShippingMethod> { |
677 | static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::ShippingMethod&); |
678 | static Optional<WebCore::ApplePaySessionPaymentRequest::ShippingMethod> decode(Decoder&); |
679 | }; |
680 | |
681 | template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems> { |
682 | static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems&); |
683 | static Optional<WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems> decode(Decoder&); |
684 | }; |
685 | |
686 | template<> struct ArgumentCoder<WebCore::ShippingContactUpdate> { |
687 | static void encode(Encoder&, const WebCore::ShippingContactUpdate&); |
688 | static Optional<WebCore::ShippingContactUpdate> decode(Decoder&); |
689 | }; |
690 | |
691 | template<> 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) |
699 | template<> 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 | |
707 | template<> 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 | |
716 | template<> struct ArgumentCoder<WebCore::ServiceWorkerOrClientData> { |
717 | static void encode(Encoder&, const WebCore::ServiceWorkerOrClientData&); |
718 | static bool decode(Decoder&, WebCore::ServiceWorkerOrClientData&); |
719 | }; |
720 | |
721 | template<> 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 | |
730 | template<> 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 | |
737 | template<> struct ArgumentCoder<WebCore::MediaSelectionOption> { |
738 | static void encode(Encoder&, const WebCore::MediaSelectionOption&); |
739 | static Optional<WebCore::MediaSelectionOption> decode(Decoder&); |
740 | }; |
741 | |
742 | template<> struct ArgumentCoder<WebCore::PromisedAttachmentInfo> { |
743 | static void encode(Encoder&, const WebCore::PromisedAttachmentInfo&); |
744 | static bool decode(Decoder&, WebCore::PromisedAttachmentInfo&); |
745 | }; |
746 | |
747 | template<> 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 | |
752 | template<> 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 | |
761 | template<> 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 | |
770 | namespace WTF { |
771 | |
772 | template<> 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 | |
781 | template<> 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 | |
791 | template<> 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 | |
806 | template<> 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 | |
816 | template<> 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) |
826 | template<> 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) |
836 | template<> 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 | |
846 | template<> 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 | |
855 | template <> struct EnumTraits<WebCore::WorkerType> { |
856 | using values = EnumValues< |
857 | WebCore::WorkerType, |
858 | WebCore::WorkerType::Classic, |
859 | WebCore::WorkerType::Module |
860 | >; |
861 | }; |
862 | |
863 | template<> 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) |
873 | template <> 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 | |
883 | template<> struct EnumTraits<WTFLogChannelState> { |
884 | using values = EnumValues< |
885 | WTFLogChannelState, |
886 | WTFLogChannelState::Off, |
887 | WTFLogChannelState::On, |
888 | WTFLogChannelState::OnWithAccumulation |
889 | >; |
890 | }; |
891 | |
892 | #undef Always |
893 | template<> 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 | |