mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1034923 - Make AccEventGen.py code generator generate classes with private destructors. r=tbsaunde
This commit is contained in:
parent
c595fb5556
commit
6a63277739
@ -68,27 +68,19 @@ def print_header_file(fd, conf):
|
|||||||
initializers = []
|
initializers = []
|
||||||
for a in attributes:
|
for a in attributes:
|
||||||
initializers.append("m%s(a%s)" % (firstCap(a.name), firstCap(a.name)))
|
initializers.append("m%s(a%s)" % (firstCap(a.name), firstCap(a.name)))
|
||||||
fd.write(" %s\n {}\n" % ", ".join(initializers))
|
fd.write(" %s\n {}\n\n" % ", ".join(initializers))
|
||||||
fd.write(" ~%s() {}\n\n" % classname)
|
|
||||||
fd.write(" NS_DECL_CYCLE_COLLECTING_ISUPPORTS\n")
|
fd.write(" NS_DECL_CYCLE_COLLECTING_ISUPPORTS\n")
|
||||||
fd.write(" NS_DECL_CYCLE_COLLECTION_CLASS(%s)\n" % (classname))
|
fd.write(" NS_DECL_CYCLE_COLLECTION_CLASS(%s)\n" % (classname))
|
||||||
|
|
||||||
for iface in filter(lambda i: i.name != "nsISupports", baseinterfaces):
|
for iface in filter(lambda i: i.name != "nsISupports", baseinterfaces):
|
||||||
fd.write(" NS_DECL_%s\n" % iface.name.upper())
|
fd.write(" NS_DECL_%s\n" % iface.name.upper())
|
||||||
|
|
||||||
fd.write("private:\n")
|
fd.write("\nprivate:\n")
|
||||||
|
fd.write(" ~%s() {}\n\n" % classname)
|
||||||
for a in attributes:
|
for a in attributes:
|
||||||
fd.write(" %s\n" % attributeVariableTypeAndName(a))
|
fd.write(" %s\n" % attributeVariableTypeAndName(a))
|
||||||
fd.write("};\n\n")
|
fd.write("};\n\n")
|
||||||
|
|
||||||
fd.write("namespace mozilla {\n"
|
|
||||||
"template<>\n"
|
|
||||||
"struct HasDangerousPublicDestructor<%s>\n"
|
|
||||||
"{\n"
|
|
||||||
" static const bool value = true;\n"
|
|
||||||
"};\n"
|
|
||||||
"}\n" % classname)
|
|
||||||
|
|
||||||
fd.write("#endif\n")
|
fd.write("#endif\n")
|
||||||
|
|
||||||
def interfaceAttributeTypes(idl):
|
def interfaceAttributeTypes(idl):
|
||||||
|
Loading…
Reference in New Issue
Block a user