| Index: mojom/generators/c/cgen/type_table.go
|
| diff --git a/mojom/generators/c/cgen/type_table.go b/mojom/generators/c/cgen/type_table.go
|
| index 4a913eb1b71f13208e69853c69524b2f184bdc5b..736abade048590c8c7756d246b99cb59106ac23b 100644
|
| --- a/mojom/generators/c/cgen/type_table.go
|
| +++ b/mojom/generators/c/cgen/type_table.go
|
| @@ -20,7 +20,6 @@ type StructPointerTableEntry struct {
|
| MinVersion uint32
|
| ElemType string
|
| Nullable bool
|
| - KeepGoing bool
|
| }
|
|
|
| type UnionPointerTableEntry struct {
|
| @@ -28,7 +27,6 @@ type UnionPointerTableEntry struct {
|
| Tag uint32
|
| Nullable bool
|
| ElemType string
|
| - KeepGoing bool
|
| }
|
|
|
| type ArrayPointerTableEntry struct {
|
| @@ -78,11 +76,11 @@ func (table *TypeTableTemplate) getTableForUDT(typeRef mojom_types.TypeReference
|
| switch udt.(type) {
|
| case *mojom_types.UserDefinedTypeStructType:
|
| structName := *udt.Interface().(mojom_types.MojomStruct).DeclData.FullIdentifier
|
| - elemTable = mojomToCName(structName) + "__PointerTable"
|
| + elemTable = "&" + mojomToCName(structName) + "__TypeTable"
|
| elemType = "MOJOM_ELEMENT_TYPE_STRUCT"
|
| case *mojom_types.UserDefinedTypeUnionType:
|
| unionName := *udt.Interface().(mojom_types.MojomUnion).DeclData.FullIdentifier
|
| - elemTable = mojomToCName(unionName) + "__PointerTable"
|
| + elemTable = "&" + mojomToCName(unionName) + "__TypeTable"
|
| elemType = "MOJOM_ELEMENT_TYPE_UNION"
|
| case *mojom_types.UserDefinedTypeInterfaceType:
|
| elemTable = "NULL"
|
| @@ -98,7 +96,7 @@ func (table *TypeTableTemplate) getTableForUDT(typeRef mojom_types.TypeReference
|
| func (table *TypeTableTemplate) makeTableForType(prefix string, dataType mojom_types.Type) (elemTable string, elemType string, nullable bool) {
|
| switch dataType.(type) {
|
| case *mojom_types.TypeStringType:
|
| - elemTable = "(void*)&MojomStringPointerEntry"
|
| + elemTable = "&MojomTypeTableStringEntry"
|
| elemType = "MOJOM_ELEMENT_TYPE_ARRAY"
|
| nullable = dataType.Interface().(mojom_types.StringType).Nullable
|
| case *mojom_types.TypeArrayType:
|
| @@ -140,7 +138,7 @@ func (table *TypeTableTemplate) makeArrayPointerEntry(prefix string, f mojom_typ
|
| numElements = uint32(f.FixedLength)
|
| }
|
| entry := ArrayPointerTableEntry{
|
| - Name: prefix + "__PointerEntry",
|
| + Name: prefix + "__ArrayEntry",
|
| NumElements: numElements,
|
| Nullable: f.Nullable,
|
| }
|
| @@ -152,7 +150,7 @@ func (table *TypeTableTemplate) makeArrayPointerEntry(prefix string, f mojom_typ
|
|
|
| func (table *TypeTableTemplate) makeMapPointerTable(prefix string, f mojom_types.MapType) string {
|
| structTable := StructPointerTable{
|
| - Name: prefix + "__PointerTable",
|
| + Name: prefix + "__TypeTable",
|
| }
|
| // The key array has offset 0.
|
| // The value array has offset 8.
|
| @@ -160,7 +158,6 @@ func (table *TypeTableTemplate) makeMapPointerTable(prefix string, f mojom_types
|
| table.makeStructPointerTableEntry(fmt.Sprintf("%s_%d", prefix, 0), 0, 0, f.KeyType))
|
| structTable.Entries = append(structTable.Entries,
|
| table.makeStructPointerTableEntry(fmt.Sprintf("%s_%d", prefix, 8), 8, 0, f.ValueType))
|
| - structTable.Entries[1].KeepGoing = false
|
|
|
| table.Structs = append(table.Structs, structTable)
|
| return structTable.Name
|
| @@ -211,7 +208,6 @@ func (table *TypeTableTemplate) makeStructPointerTableEntry(prefix string, offse
|
| MinVersion: minVersion,
|
| ElemType: elemType,
|
| Nullable: nullable,
|
| - KeepGoing: true,
|
| }
|
| }
|
|
|
| @@ -220,7 +216,7 @@ func (table *TypeTableTemplate) makeStructPointerTableEntry(prefix string, offse
|
| func (table *TypeTableTemplate) insertStructPointerTable(s mojom_types.MojomStruct) {
|
| structTablePrefix := mojomToCName(*s.DeclData.FullIdentifier)
|
| structTable := StructPointerTable{
|
| - Name: structTablePrefix + "__PointerTable",
|
| + Name: structTablePrefix + "__TypeTable",
|
| }
|
| for _, field := range s.Fields {
|
| if table.isPointerOrHandle(field.Type) {
|
| @@ -228,9 +224,6 @@ func (table *TypeTableTemplate) insertStructPointerTable(s mojom_types.MojomStru
|
| structTablePrefix, uint32(field.Offset), field.MinVersion, field.Type))
|
| }
|
| }
|
| - if len(structTable.Entries) > 0 {
|
| - structTable.Entries[len(structTable.Entries)-1].KeepGoing = false
|
| - }
|
| table.PublicStructNames = append(table.PublicStructNames, structTable.Name)
|
| table.Structs = append(table.Structs, structTable)
|
| }
|
| @@ -243,7 +236,6 @@ func (table *TypeTableTemplate) makeUnionPointerTableEntry(prefix string, tag ui
|
| Tag: tag,
|
| Nullable: nullable,
|
| ElemType: elemType,
|
| - KeepGoing: true,
|
| }
|
| }
|
|
|
| @@ -252,16 +244,13 @@ func (table *TypeTableTemplate) makeUnionPointerTableEntry(prefix string, tag ui
|
| func (table *TypeTableTemplate) insertUnionPointerTable(u mojom_types.MojomUnion) {
|
| unionTablePrefix := mojomToCName(*u.DeclData.FullIdentifier)
|
| unionTable := UnionPointerTable{
|
| - Name: unionTablePrefix + "__PointerTable",
|
| + Name: unionTablePrefix + "__TypeTable",
|
| }
|
| for _, field := range u.Fields {
|
| if table.isPointerOrHandle(field.Type) {
|
| unionTable.Entries = append(unionTable.Entries, table.makeUnionPointerTableEntry(unionTablePrefix, uint32(field.Tag), field.Type))
|
| }
|
| }
|
| - if len(unionTable.Entries) > 0 {
|
| - unionTable.Entries[len(unionTable.Entries)-1].KeepGoing = false
|
| - }
|
| table.PublicUnionNames = append(table.PublicUnionNames, unionTable.Name)
|
| table.Unions = append(table.Unions, unionTable)
|
| }
|
|
|