Bug 158254
Summary: | Bindings generator: Improve support for sharing enums between idl files | ||
---|---|---|---|
Product: | WebKit | Reporter: | Adam Bergkvist <adam.bergkvist> |
Component: | Bindings | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | cdumez, darin, eric.carlson |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | |||
Bug Blocks: | 143211 |
Adam Bergkvist
This can be done in two steps:
1. Define the enum in each idl file, but support sharing the underlying C++ enum. This does not currently work due to duplication of generated enum conversion functions.
2. Allow "importing" an idl enum in an other idl file. This would probably require some work, but would minimize the need for mirrored enums that needs to be synced.
Example where this could be useful:
RTCPeerConnection.idl:
[StrictTypeChecking, RaisesException] RTCRtpTransceiver addTransceiver(MediaStreamTrack track, optional RTCRtpTransceiverInit init);
[StrictTypeChecking, RaisesException] RTCRtpTransceiver addTransceiver(DOMString kind, optional RTCRtpTransceiverInit init);
enum RTCRtpTransceiverDirection { "sendrecv", "sendonly", "recvonly", "inactive" };
dictionary RTCRtpTransceiverInit {
RTCRtpTransceiverDirection direction = "sendrecv";
};
RTCRtpTransceiver.idl:
readonly attribute RTCRtpTransceiverDirection direction;
void setDirection(RTCRtpTransceiverDirection direction);
enum RTCRtpTransceiverDirection { "sendrecv", "sendonly", "recvonly", "inactive" };
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |