Back out bug 1063889 (rev 2f5df573f4a3) because windowsx.h defines GetFirstChild/GetNextSibling macros, so will make the world blow up if you include it anywhere near nsIDOMNode/nsINode. r=bustage

This commit is contained in:
Boris Zbarsky 2014-09-08 12:25:17 -04:00
Родитель 7be7c1afee
Коммит 3e0cc1e8d6
6 изменённых файлов: 12 добавлений и 40 удалений

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

@ -1216,7 +1216,6 @@ def UnionTypes(descriptors, dictionaries, callbacks, config):
def addHeadersForType(f):
if f.nullable():
headers.add("mozilla/dom/Nullable.h")
isSequence = f.isSequence()
f = f.unroll()
if f.isInterface():
if f.isSpiderMonkeyInterface():
@ -1228,14 +1227,10 @@ def UnionTypes(descriptors, dictionaries, callbacks, config):
typeDesc = p.getDescriptor(f.inner.identifier.name)
except NoSuchDescriptorError:
continue
if typeDesc.interface.isCallback() or isSequence:
if typeDesc.interface.isCallback():
# Callback interfaces always use strong refs, so
# we need to include the right header to be able
# to Release() in our inlined code.
#
# Similarly, sequences always contain strong
# refs, so we'll need the header to handler
# those.
headers.add(typeDesc.headerFile)
else:
declarations.add((typeDesc.nativeType, False))
@ -4656,7 +4651,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
if type.isSpiderMonkeyInterface():
assert not isEnforceRange and not isClamp
name = type.unroll().name # unroll() because it may be nullable
name = type.name
arrayType = CGGeneric(name)
declType = arrayType
if type.nullable():
@ -6207,6 +6202,8 @@ def getUnionMemberName(type):
return type.inner.identifier.name
if type.isEnum():
return type.inner.identifier.name
if type.isArray() or type.isSequence() or type.isMozMap():
return str(type)
return type.name
@ -12451,8 +12448,7 @@ class CGNativeMember(ClassMethod):
if not self.typedArraysAreStructs:
return "JS::Handle<JSObject*>", False, False
# Unroll for the name, in case we're nullable.
return type.unroll().name, True, True
return type.name, True, True
if type.isDOMString() or type.isScalarValueString():
if isMember:

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

@ -1764,10 +1764,7 @@ class IDLNullableType(IDLType):
assert not innerType.isVoid()
assert not innerType == BuiltinTypes[IDLBuiltinType.Types.any]
name = innerType.name
if innerType.isComplete():
name += "OrNull"
IDLType.__init__(self, location, name)
IDLType.__init__(self, location, innerType.name)
self.inner = innerType
self.builtin = False
@ -1880,7 +1877,7 @@ class IDLNullableType(IDLType):
"be a union type that itself has a nullable "
"type as a member type", [self.location])
self.name = self.inner.name + "OrNull"
self.name = self.inner.name
return self
def unroll(self):
@ -1903,10 +1900,6 @@ class IDLSequenceType(IDLType):
IDLType.__init__(self, location, parameterType.name)
self.inner = parameterType
self.builtin = False
# Need to set self.name up front if our inner type is already complete,
# since in that case our .complete() won't be called.
if self.inner.isComplete():
self.name = self.inner.name + "Sequence"
def __eq__(self, other):
return isinstance(other, IDLSequenceType) and self.inner == other.inner
@ -1968,7 +1961,7 @@ class IDLSequenceType(IDLType):
def complete(self, scope):
self.inner = self.inner.complete(scope)
self.name = self.inner.name + "Sequence"
self.name = self.inner.name
return self
def unroll(self):
@ -1994,10 +1987,6 @@ class IDLMozMapType(IDLType):
IDLType.__init__(self, location, parameterType.name)
self.inner = parameterType
self.builtin = False
# Need to set self.name up front if our inner type is already complete,
# since in that case our .complete() won't be called.
if self.inner.isComplete():
self.name = self.inner.name + "MozMap"
def __eq__(self, other):
return isinstance(other, IDLMozMapType) and self.inner == other.inner
@ -2023,7 +2012,7 @@ class IDLMozMapType(IDLType):
def complete(self, scope):
self.inner = self.inner.complete(scope)
self.name = self.inner.name + "MozMap"
self.name = self.inner.name
return self
def unroll(self):
@ -2088,6 +2077,9 @@ class IDLUnionType(IDLType):
return typeName(type._identifier.object())
if isinstance(type, IDLObjectWithIdentifier):
return typeName(type.identifier)
if (isinstance(type, IDLType) and
(type.isArray() or type.isSequence() or type.isMozMap)):
return str(type)
return type.name
for (i, type) in enumerate(self.memberTypes):

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

@ -603,10 +603,6 @@ public:
void PassUnion20(JSContext*, const ObjectSequenceOrLong&);
void PassUnion21(const LongMozMapOrLong&);
void PassUnion22(JSContext*, const ObjectMozMapOrLong&);
void PassUnion23(const NodeSequenceOrLong&);
void PassUnion24(const NodeOrNullSequenceOrLong&);
void PassUnion25(const NodeSequenceSequenceOrLong&);
void PassUnion26(const NodeOrNullSequenceSequenceOrLong&);
void PassUnionWithCallback(const EventHandlerNonNullOrNullOrLong& arg);
void PassUnionWithByteString(const ByteStringOrLong&);
void PassUnionWithMozMap(const StringMozMapOrString&);

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

@ -567,10 +567,6 @@ interface TestInterface {
void passUnion20(optional (sequence<object> or long) arg = []);
void passUnion21((MozMap<long> or long) arg);
void passUnion22((MozMap<object> or long) arg);
void passUnion23((sequence<Node> or long) arg);
void passUnion24((sequence<Node?> or long) arg);
void passUnion25((sequence<sequence<Node>> or long) arg);
void passUnion26((sequence<sequence<Node?>> or long) arg);
void passUnionWithCallback((EventHandler or long) arg);
void passUnionWithByteString((ByteString or long) arg);
void passUnionWithMozMap((MozMap<DOMString> or DOMString) arg);

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

@ -431,10 +431,6 @@ interface TestExampleInterface {
void passUnion20(optional (sequence<object> or long) arg = []);
void passUnion21((MozMap<long> or long) arg);
void passUnion22((MozMap<object> or long) arg);
void passUnion23((sequence<Node> or long) arg);
void passUnion24((sequence<Node?> or long) arg);
void passUnion25((sequence<sequence<Node>> or long) arg);
void passUnion26((sequence<sequence<Node?>> or long) arg);
void passUnionWithCallback((EventHandler or long) arg);
void passUnionWithByteString((ByteString or long) arg);
void passUnionWithMozMap((MozMap<DOMString> or DOMString) arg);

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

@ -451,10 +451,6 @@ interface TestJSImplInterface {
void passUnion20(optional (sequence<object> or long) arg = []);
void passUnion21((MozMap<long> or long) arg);
void passUnion22((MozMap<object> or long) arg);
void passUnion23((sequence<Node> or long) arg);
void passUnion24((sequence<Node?> or long) arg);
void passUnion25((sequence<sequence<Node>> or long) arg);
void passUnion26((sequence<sequence<Node?>> or long) arg);
void passUnionWithCallback((EventHandler or long) arg);
void passUnionWithByteString((ByteString or long) arg);
void passUnionWithMozMap((MozMap<DOMString> or DOMString) arg);