Bug 220916

Summary: Synchronous messages cannot be answered with different type of encoder
Product: WebKit Reporter: Kimmo Kinnunen <kkinnunen>
Component: WebKit2Assignee: Kimmo Kinnunen <kkinnunen>
Status: RESOLVED INVALID    
Severity: Normal CC: eric.carlson, ews-watchlist, glenn, jer.noble, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch ews-feeder: commit-queue-

Description Kimmo Kinnunen 2021-01-25 04:27:35 PST
Synchronous messages cannot be answered with different type of encoder

Current generated message handler has a special case for async messages and a special case for synchronous messages.
The synchronous messages message handler signature is (Connection& connection, Decoder& decoder, Encoder& replyEncoder).

This is inconvenient for planned WebGL IPC "stream" feature.
In the "stream" use-case, most of the sync messages would come in the same way as async messages, via SHM memory buffer.
The reply should go to the SHM memory buffer too, with the help of stream-specific encoder.
Since the stream-specific encoder is not IPC::Encoder, current generated message handlers cannot support this.

A solution could be to move the sync reply id to the end of the message payload, so that the message handling of async and sync messages can be unified.
Comment 1 Kimmo Kinnunen 2021-01-25 04:52:38 PST
Created attachment 418276 [details]
Patch
Comment 2 Kimmo Kinnunen 2021-01-25 04:57:53 PST
Created attachment 418278 [details]
Patch
Comment 3 Radar WebKit Bug Importer 2021-02-01 04:28:13 PST
<rdar://problem/73825012>
Comment 4 Kimmo Kinnunen 2021-02-25 04:03:23 PST
This is probably not needed. Currently the handleMessage function can dig out the sync reply id for the streams.

Marking this as not blocking webglgpup and configuration changed.