Bindings generator: Improve support for sharing enums between idl files
https://bugs.webkit.org/show_bug.cgi?id=158254
Summary Bindings generator: Improve support for sharing enums between idl files
Adam Bergkvist
Reported 2016-06-01 01:37:47 PDT
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
Note You need to log in before you can comment on or make changes to this bug.