Bug 310157
| Summary: | [Inspector] Protocol C++ generator should support nullable event parameters | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | juliopiubellow |
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | bburg, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
juliopiubellow
The shared inspector protocol C++ generator currently does not preserve "nullable": true on event parameters, even
though nullable object members are already modeled correctly. That forces callers to hand-craft JSON envelopes for
events whose parameters may be explicitly null, which defeats the purpose of the generated protocol types and weakens
type guarantees. Add shared support for nullable event parameters so generated frontend dispatchers can accept typed
nullable values and serialize them as either the expected protocol type or JSON null.
While implementing WebDriver BiDi browsing-context events, we ran into a gap in the shared inspector codegen: event
parameters currently preserve optional, but they do not preserve nullable. As a result, generated event notifier
signatures can express only a required typed value or an omitted value for optional parameters, but not an explicit null
value required by the protocol. This is why nullable object members work today, but nullable event parameters do not.
The intended direction is to add shared nullable-event-parameter support to the inspector protocol model and C++
generator, likely by introducing a concrete JSON null type and a typed nullable wrapper for generated protocol C++ so
that non-null values are still forced to be the expected type. This should land as separate shared infrastructure work
before the WebDriver BiDi PR that wants to rely on it.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/173295523>
Blaze Burg
https://github.com/WebKit/WebKit/pull/60920