From c1e34c61d4870b2345303cbcba9c7f3af3633595 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sun, 4 Nov 2012 09:00:06 +0100 Subject: [PATCH] Bug 801991 - Remove the ability to generate custom quickstubs; r=peterv --- js/xpconnect/src/dom_quickstubs.qsconf | 10 ---------- js/xpconnect/src/qsgen.py | 27 ++++++-------------------- 2 files changed, 6 insertions(+), 31 deletions(-) diff --git a/js/xpconnect/src/dom_quickstubs.qsconf b/js/xpconnect/src/dom_quickstubs.qsconf index abd1c1c2e0cd..43fa395486a6 100644 --- a/js/xpconnect/src/dom_quickstubs.qsconf +++ b/js/xpconnect/src/dom_quickstubs.qsconf @@ -514,16 +514,6 @@ nsIDOMStorage_Clear_customMethodCallCode = """ JS_ClearNonGlobalObject(cx, obj); """ -CUSTOM_QS = { - 'skipgen': True, - 'traceable': False -} - -CUSTOM_QS_TN = { - 'skipgen': True, - 'traceable': True -} - customMethodCalls = { 'nsIDOMNode_GetNextSibling': { 'thisType': 'nsINode', diff --git a/js/xpconnect/src/qsgen.py b/js/xpconnect/src/qsgen.py index 21cf53089651..d5b456b3c68e 100644 --- a/js/xpconnect/src/qsgen.py +++ b/js/xpconnect/src/qsgen.py @@ -180,7 +180,7 @@ def addStubMember(memberId, member): # Add this member to the list. member.iface.stubMembers.append(member) -def checkStubMember(member, isCustom): +def checkStubMember(member): memberId = member.iface.name + "." + member.name if member.kind not in ('method', 'attribute'): raise UserError("Member %s is %r, not a method or attribute." @@ -195,8 +195,7 @@ def checkStubMember(member, isCustom): if (member.kind == 'attribute' and not member.readonly - and isSpecificInterfaceType(member.realtype, 'nsIVariant') - and not isCustom): + and isSpecificInterfaceType(member.realtype, 'nsIVariant')): raise UserError( "Attribute %s: Non-readonly attributes of type nsIVariant " "are not supported." @@ -233,7 +232,6 @@ class Configuration: # optional settings self.irregularFilenames = config.get('irregularFilenames', {}) self.customIncludes = config.get('customIncludes', []) - self.customQuickStubs = config.get('customQuickStubs', []) self.customReturnInterfaces = config.get('customReturnInterfaces', []) self.customMethodCalls = config.get('customMethodCalls', {}) @@ -317,9 +315,7 @@ def readConfigFile(filename, includePath, cachedir): # Now go through and check all the interfaces' members for iface in stubbedInterfaces: for member in iface.stubMembers: - cmc = conf.customMethodCalls.get(iface.name + "_" + header.methodNativeName(member), None) - skipgen = cmc is not None and cmc.get('skipgen', False) - checkStubMember(member, skipgen) + checkStubMember(member) for iface in conf.customReturnInterfaces: # just ensure that it exists so that we can grab it later @@ -1029,20 +1025,15 @@ def writeQuickStub(f, customMethodCalls, member, stubName, isSetter=False): f.write(callTemplate) def writeAttrStubs(f, customMethodCalls, stringtable, attr): - cmc = customMethodCalls.get(attr.iface.name + "_" + header.methodNativeName(attr), None) - custom = cmc and cmc.get('skipgen', False) - getterName = (attr.iface.name + '_' + header.attributeNativeName(attr, True)) - if not custom: - writeQuickStub(f, customMethodCalls, attr, getterName) + writeQuickStub(f, customMethodCalls, attr, getterName) if attr.readonly: setterName = 'xpc_qsGetterOnlyPropertyStub' else: setterName = (attr.iface.name + '_' + header.attributeNativeName(attr, False)) - if not custom: - writeQuickStub(f, customMethodCalls, attr, setterName, isSetter=True) + writeQuickStub(f, customMethodCalls, attr, setterName, isSetter=True) ps = ('{%d, %s, %s}' % (stringtable.stringIndex(attr.name), getterName, setterName)) @@ -1051,12 +1042,8 @@ def writeAttrStubs(f, customMethodCalls, stringtable, attr): def writeMethodStub(f, customMethodCalls, stringtable, method): """ Write a method stub to `f`. Return an xpc_qsFunctionSpec initializer. """ - cmc = customMethodCalls.get(method.iface.name + "_" + header.methodNativeName(method), None) - custom = cmc and cmc.get('skipgen', False) - stubName = method.iface.name + '_' + header.methodNativeName(method) - if not custom: - writeQuickStub(f, customMethodCalls, method, stubName) + writeQuickStub(f, customMethodCalls, method, stubName) fs = '{%d, %d, %s}' % (stringtable.stringIndex(method.name), len(method.params), stubName) return fs @@ -1305,8 +1292,6 @@ def writeStubFile(filename, headerFilename, conf, interfaces): f.write('#include "%s"\n' % customInclude) f.write("\n\n") writeResultXPCInterfacesArray(f, conf, frozenset(resulttypes)) - for customQS in conf.customQuickStubs: - f.write('#include "%s"\n' % customQS) stringtable = StringTable() for iface in interfaces: writeStubsForInterface(f, conf.customMethodCalls, stringtable, iface)