Remove debugging code for setters and methods to avoid weird behaviour from calling the native setters and methods twice.

--HG--
extra : rebase_source : bc087eb4c541411d5adc696b267295d4d172614e
This commit is contained in:
Peter Van der Beken 2009-08-24 08:44:16 -07:00
Родитель 21eeef5922
Коммит 6455108d73
1 изменённых файлов: 45 добавлений и 53 удалений

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

@ -751,6 +751,9 @@ def writeQuickStub(f, customMethodCalls, member, stubName, isSetter=False):
if customMethodCall is not None: if customMethodCall is not None:
f.write("%s\n" % customMethodCall['code']) f.write("%s\n" % customMethodCall['code'])
if customMethodCall is None or isGetter:
if customMethodCall is not None:
f.write("#ifdef DEBUG\n") f.write("#ifdef DEBUG\n")
f.write(" nsresult debug_rv;\n") f.write(" nsresult debug_rv;\n")
f.write(" nsCOMPtr<%s> debug_self = do_QueryInterface(self);\n" f.write(" nsCOMPtr<%s> debug_self = do_QueryInterface(self);\n"
@ -781,10 +784,10 @@ def writeQuickStub(f, customMethodCalls, member, stubName, isSetter=False):
else: else:
args = "arg0" args = "arg0"
f.write(" %s = %s->%s(%s);\n" % (nsresultname, selfname, comName, args)) f.write(" %s = %s->%s(%s);\n"
% (nsresultname, selfname, comName, args))
if customMethodCall is not None: if customMethodCall is not None:
if isMethod or isGetter:
checkSuccess = "NS_SUCCEEDED(debug_rv)" checkSuccess = "NS_SUCCEEDED(debug_rv)"
if canFail: if canFail:
checkSuccess += " == NS_SUCCEEDED(rv)" checkSuccess += " == NS_SUCCEEDED(rv)"
@ -1087,11 +1090,6 @@ def writeTraceableQuickStub(f, customMethodCalls, member, stubName):
if customMethodCall is not None: if customMethodCall is not None:
f.write("%s\n" % customMethodCall['code']) f.write("%s\n" % customMethodCall['code'])
f.write("#ifdef DEBUG\n")
f.write(" nsresult debug_rv;\n")
f.write(" nsCOMPtr<%s> debug_self = do_QueryInterface(self);\n"
% member.iface.name);
prefix = 'debug_'
else: else:
if not rvdeclared: if not rvdeclared:
f.write(" nsresult rv;\n") f.write(" nsresult rv;\n")
@ -1111,9 +1109,9 @@ def writeTraceableQuickStub(f, customMethodCalls, member, stubName):
argNames.append(outParamForm(resultname, member.realtype)) argNames.append(outParamForm(resultname, member.realtype))
args = ', '.join(argNames) args = ', '.join(argNames)
f.write(" %s = %s->%s(%s);\n" % (nsresultname, selfname, comName, args)) f.write(" %s = %s->%s(%s);\n"
% (nsresultname, selfname, comName, args))
if customMethodCall is None:
# Check for errors. # Check for errors.
f.write(" if (NS_FAILED(rv)) {\n") f.write(" if (NS_FAILED(rv)) {\n")
if haveCcx: if haveCcx:
@ -1123,12 +1121,6 @@ def writeTraceableQuickStub(f, customMethodCalls, member, stubName):
f.write(" xpc_qsThrowMethodFailedWithDetails(cx, rv, " f.write(" xpc_qsThrowMethodFailedWithDetails(cx, rv, "
"\"%s\", \"%s\");\n" % (member.iface.name, member.name)) "\"%s\", \"%s\");\n" % (member.iface.name, member.name))
writeFailure(f, getTraceInfoDefaultReturn(member.type), 2) writeFailure(f, getTraceInfoDefaultReturn(member.type), 2)
else:
f.write(" NS_ASSERTION(NS_SUCCEEDED(debug_rv) && "
"xpc_qsSameResult(debug_result, result),\n"
" \"Got the wrong answer from the custom "
"method call!\");\n")
f.write("#endif\n")
# Convert the return value. # Convert the return value.
writeTraceableResultConv(f, member.realtype) writeTraceableResultConv(f, member.realtype)