PSA: New implementations of IDL union types

52 views
Skip to first unread message

Yuki Shiino

unread,
May 18, 2021, 12:32:32 PM5/18/21
to blink-dev
tl;dr: Auto-generated IDL union classes are now GarbageCollected.

Blink-V8 bindings team has been developing Web IDL compiler v2 in order to improve the spec conformance and flexibility to support more features.  IDL interfaces were upgraded to the new implementation last summer, IDL callback functions, IDL callback interfaces, and IDL enumerations were upgraded to the new one, too.  This week, IDL unions have been upgraded to the new one with the following changes (we're very sorry about the late notice).

Changes that affect Blink developers:
1. The new IDL union classes are now GarbageCollected.
  old_union.Foo() is replaced with new_union->Foo().
2. Generated file paths are different.
3. Generated class names are different.
  old: DoubleOrDoubleSequence
  new: V8UnionDoubleOrDoubleSequence
4. Minor changes
4-a. (A or B) and (B or A) in *.idl generated separate types (AOrB and BOrA).  Now both IDL definitions generate a single V8UnionAOrB.
4-b. (A? or B) and (A or B) in *.idl generated a single type AOrB.  Now they generate separate types V8UnionAOrBOrNull and V8UnionAOrB.
4-c. New switch-statement-friendly API, GetContentType()

During the transition to the new implementations, "#if defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)" guards are put in the code base where IDL unions are used.  Within a week (unless we observe a severe issue), we'll be going to remove the #if guards as soon as we confirm that the patch sticks.  We apologize for any inconveniences you experience.

Disclaimer:
IDL dictionaries are not yet supported by the new Web IDL compiler.  IDL dictionaries are generated by the old code generator and do not use the new IDL unions yet, so IDL dictionary members of type IDL unions use the old IDL union types for the time being.  IDL dictionaries are planned to be upgraded soon.

Cheers,
Yuki Shiino

Yuki Shiino

unread,
May 21, 2021, 4:21:32 PM5/21/21
to Yuki Shiino, blink-dev
During the transition to the new implementations, "#if defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)" guards are put in the code base where IDL unions are used.  Within a week (unless we observe a severe issue), we'll be going to remove the #if guards as soon as we confirm that the patch sticks.  We apologize for any inconveniences you experience.

Updates: The temporary code (#if defined(...) guards) has been removed.  Thank you all for your cooperations.

Cheers,
Yuki Shiino


2021年5月19日(水) 1:31 Yuki Shiino <yukis...@chromium.org>:
Reply all
Reply to author
Forward
0 new messages