Bug 1028588 - Update AccEventGen.py to whitelist the dangerous public destructors that it generates - r=tbsaunde
authorBenoit Jacob <bjacob@mozilla.com>
Mon, 07 Jul 2014 14:27:30 -0400
changeset 214638 eac85d5073ef6549df1cc352e666f2c88b294ad8
parent 214637 4d276769e9ddc88d2dd2912f448116c9efba042e
child 214639 261d818388d28fa95170cf9eddeb43809ee7415b
push idunknown
push userunknown
push dateunknown
reviewerstbsaunde
bugs1028588
milestone33.0a1
Bug 1028588 - Update AccEventGen.py to whitelist the dangerous public destructors that it generates - r=tbsaunde
accessible/xpcom/AccEventGen.py
--- a/accessible/xpcom/AccEventGen.py
+++ b/accessible/xpcom/AccEventGen.py
@@ -76,16 +76,24 @@ def print_header_file(fd, conf):
             for iface in filter(lambda i: i.name != "nsISupports", baseinterfaces):
                 fd.write("  NS_DECL_%s\n" % iface.name.upper())
 
             fd.write("private:\n")
             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)