Bug 220519

Summary: Some type serialization encoders are implemented in Encoder class
Product: WebKit Reporter: Kimmo Kinnunen <kkinnunen>
Component: WebKit2Assignee: Kimmo Kinnunen <kkinnunen>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 217211, 219641    
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch none

Description Kimmo Kinnunen 2021-01-11 11:49:51 PST
Some type encoders are implemented in Encoder class

Most type encoders for IPC serialization are implemented in the type (T::encode(Encoder&)) or in ArgumentCoder<T> template.

However, arithmetic types and enums are implemented in Encoder.

This makes it hard to implement other types of Encoders, since this code should be somehow duplicated or extracted redundantly to a base template.

Instead, it would be consistent if all the serialization would be in in the T::encode or ArgumentCoder<T>::encode.

This would be important for WebGL IPC, where the stream serialization would in general use the base serialization code, but some details of the Encoder would need to differ.
Comment 1 Kimmo Kinnunen 2021-01-11 12:05:57 PST
Created attachment 417398 [details]
Patch
Comment 2 Kimmo Kinnunen 2021-01-11 12:52:10 PST
Created attachment 417404 [details]
Patch
Comment 3 Radar WebKit Bug Importer 2021-01-18 11:50:13 PST
<rdar://problem/73327684>
Comment 4 Chris Dumez 2021-01-26 08:46:54 PST
Comment on attachment 417404 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=417404&action=review

> Source/WebKit/ChangeLog:15
> +        corresponidng modification to Decoder class for consistency.

typo: corresponidng
Comment 5 Kimmo Kinnunen 2021-01-27 10:42:09 PST
Created attachment 418559 [details]
Patch
Comment 6 Kimmo Kinnunen 2021-01-27 11:08:20 PST
Created attachment 418563 [details]
Patch
Comment 7 EWS 2021-01-29 05:03:16 PST
Committed r272058: <https://trac.webkit.org/changeset/272058>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418563 [details].