Bug 1034923 - Make AccEventGen.py code generator generate classes with private destructors. r=tbsaunde
authorAndrew McCreight <continuation@gmail.com>
Mon, 28 Jul 2014 10:15:58 -0700
changeset 219328 2fd5026e35f1a437d4adf3efa786e904c25b8594
parent 219327 b84ac541b00e265174030f7e446ac90b765ae79c
child 219329 e1601237530ecb37ef810b5354a42bdb08e271c3
push idunknown
push userunknown
push dateunknown
reviewerstbsaunde
bugs1034923
milestone34.0a1
Bug 1034923 - Make AccEventGen.py code generator generate classes with private destructors. r=tbsaunde
accessible/xpcom/AccEventGen.py
--- a/accessible/xpcom/AccEventGen.py
+++ b/accessible/xpcom/AccEventGen.py
@@ -63,37 +63,29 @@ def print_header_file(fd, conf):
 
             attributes = allAttributes(iface)
             args = map(writeAttributeParams, attributes)
             fd.write("  %s(%s) :\n" % (classname, ", ".join(args)))
 
             initializers = []
             for a in attributes:
                 initializers.append("m%s(a%s)" % (firstCap(a.name), firstCap(a.name)))
-            fd.write("  %s\n  {}\n" % ", ".join(initializers))
-            fd.write("  ~%s() {}\n\n" % classname)
+            fd.write("  %s\n  {}\n\n" % ", ".join(initializers))
             fd.write("  NS_DECL_CYCLE_COLLECTING_ISUPPORTS\n")
             fd.write("  NS_DECL_CYCLE_COLLECTION_CLASS(%s)\n" % (classname))
 
             for iface in filter(lambda i: i.name != "nsISupports", baseinterfaces):
                 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:
                 fd.write("  %s\n" % attributeVariableTypeAndName(a))
             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")
 
 def interfaceAttributeTypes(idl):
     ifaces = filter(lambda p: p.kind == "interface", idl.productions)
     attributes = []
     for i in ifaces:
         ifaceAttributes = allAttributes(i)
         attributes.extend(ifaceAttributes)