Bug 801991 - Remove the ability to generate custom quickstubs; r=peterv

This commit is contained in:
Ms2ger 2012-11-04 09:00:06 +01:00
Родитель 1494a04258
Коммит c1e34c61d4
2 изменённых файлов: 6 добавлений и 31 удалений

Просмотреть файл

@ -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',

Просмотреть файл

@ -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)