зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1330699 part 10. Rename the MozMap C++ type to "record" and give it a template parameter for the key type. r=qdot
Also renames all the test functions to mention "Record" instead of "MozMap". --HG-- rename : dom/bindings/MozMap.h => dom/bindings/Record.h
This commit is contained in:
Родитель
46964f231f
Коммит
1471a0e8e3
|
@ -50,7 +50,7 @@ namespace mozilla {
|
|||
enum UseCounter : int16_t;
|
||||
|
||||
namespace dom {
|
||||
template<typename DataType> class MozMap;
|
||||
template<typename KeyType, typename ValueType> class Record;
|
||||
|
||||
nsresult
|
||||
UnwrapArgImpl(JSContext* cx, JS::Handle<JSObject*> src, const nsIID& iid,
|
||||
|
@ -2067,25 +2067,26 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
void TraceMozMap(JSTracer* trc, MozMap<T>& map)
|
||||
template<typename K, typename V>
|
||||
void TraceRecord(JSTracer* trc, Record<K, V>& record)
|
||||
{
|
||||
for (auto& entry : map.Entries()) {
|
||||
for (auto& entry : record.Entries()) {
|
||||
// Act like it's a one-element sequence to leverage all that infrastructure.
|
||||
SequenceTracer<T>::TraceSequence(trc, &entry.mValue, &entry.mValue + 1);
|
||||
SequenceTracer<V>::TraceSequence(trc, &entry.mValue, &entry.mValue + 1);
|
||||
}
|
||||
}
|
||||
|
||||
// sequence<MozMap>
|
||||
template<typename T>
|
||||
class SequenceTracer<MozMap<T>, false, false, false>
|
||||
// sequence<record>
|
||||
template<typename K, typename V>
|
||||
class SequenceTracer<Record<K, V>, false, false, false>
|
||||
{
|
||||
explicit SequenceTracer() = delete; // Should never be instantiated
|
||||
|
||||
public:
|
||||
static void TraceSequence(JSTracer* trc, MozMap<T>* seqp, MozMap<T>* end) {
|
||||
static void TraceSequence(JSTracer* trc, Record<K, V>* seqp,
|
||||
Record<K, V>* end) {
|
||||
for (; seqp != end; ++seqp) {
|
||||
TraceMozMap(trc, *seqp);
|
||||
TraceRecord(trc, *seqp);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -2163,51 +2164,51 @@ public:
|
|||
SequenceType mSequenceType;
|
||||
};
|
||||
|
||||
// Rooter class for MozMap; this is what we mostly use in the codegen.
|
||||
template<typename T>
|
||||
class MOZ_RAII MozMapRooter final : private JS::CustomAutoRooter
|
||||
// Rooter class for Record; this is what we mostly use in the codegen.
|
||||
template<typename K, typename V>
|
||||
class MOZ_RAII RecordRooter final : private JS::CustomAutoRooter
|
||||
{
|
||||
public:
|
||||
MozMapRooter(JSContext *aCx, MozMap<T>* aMozMap
|
||||
RecordRooter(JSContext *aCx, Record<K, V>* aRecord
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
|
||||
: JS::CustomAutoRooter(aCx MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT),
|
||||
mMozMap(aMozMap),
|
||||
mMozMapType(eMozMap)
|
||||
mRecord(aRecord),
|
||||
mRecordType(eRecord)
|
||||
{
|
||||
}
|
||||
|
||||
MozMapRooter(JSContext *aCx, Nullable<MozMap<T>>* aMozMap
|
||||
RecordRooter(JSContext *aCx, Nullable<Record<K, V>>* aRecord
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
|
||||
: JS::CustomAutoRooter(aCx MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT),
|
||||
mNullableMozMap(aMozMap),
|
||||
mMozMapType(eNullableMozMap)
|
||||
mNullableRecord(aRecord),
|
||||
mRecordType(eNullableRecord)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
enum MozMapType {
|
||||
eMozMap,
|
||||
eNullableMozMap
|
||||
enum RecordType {
|
||||
eRecord,
|
||||
eNullableRecord
|
||||
};
|
||||
|
||||
virtual void trace(JSTracer *trc) override
|
||||
{
|
||||
if (mMozMapType == eMozMap) {
|
||||
TraceMozMap(trc, *mMozMap);
|
||||
if (mRecordType == eRecord) {
|
||||
TraceRecord(trc, *mRecord);
|
||||
} else {
|
||||
MOZ_ASSERT(mMozMapType == eNullableMozMap);
|
||||
if (!mNullableMozMap->IsNull()) {
|
||||
TraceMozMap(trc, mNullableMozMap->Value());
|
||||
MOZ_ASSERT(mRecordType == eNullableRecord);
|
||||
if (!mNullableRecord->IsNull()) {
|
||||
TraceRecord(trc, mNullableRecord->Value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
union {
|
||||
MozMap<T>* mMozMap;
|
||||
Nullable<MozMap<T>>* mNullableMozMap;
|
||||
Record<K, V>* mRecord;
|
||||
Nullable<Record<K, V>>* mNullableRecord;
|
||||
};
|
||||
|
||||
MozMapType mMozMapType;
|
||||
RecordType mRecordType;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
|
|
@ -996,6 +996,8 @@ class CGElseChain(CGThing):
|
|||
|
||||
class CGTemplatedType(CGWrapper):
|
||||
def __init__(self, templateName, child, isConst=False, isReference=False):
|
||||
if isinstance(child, list):
|
||||
child = CGList(child, ", ")
|
||||
const = "const " if isConst else ""
|
||||
pre = "%s%s<" % (const, templateName)
|
||||
ref = "&" if isReference else ""
|
||||
|
@ -1165,10 +1167,10 @@ class CGHeaders(CGWrapper):
|
|||
bindingHeaders.add("mozilla/dom/PrimitiveConversions.h")
|
||||
elif unrolled.isRecord():
|
||||
if dictionary or jsImplementedDescriptors:
|
||||
declareIncludes.add("mozilla/dom/MozMap.h")
|
||||
declareIncludes.add("mozilla/dom/Record.h")
|
||||
else:
|
||||
bindingHeaders.add("mozilla/dom/MozMap.h")
|
||||
# Also add headers for the type the MozMap is
|
||||
bindingHeaders.add("mozilla/dom/Record.h")
|
||||
# Also add headers for the type the record is
|
||||
# parametrized over, if needed.
|
||||
addHeadersForType((t.inner, dictionary))
|
||||
|
||||
|
@ -1391,7 +1393,7 @@ def UnionTypes(unionTypes, config):
|
|||
# code.
|
||||
headers.add(CGHeaders.getDeclarationFilename(f.callback))
|
||||
elif f.isRecord():
|
||||
headers.add("mozilla/dom/MozMap.h")
|
||||
headers.add("mozilla/dom/Record.h")
|
||||
# And add headers for the type we're parametrized over
|
||||
addHeadersForType(f.inner)
|
||||
|
||||
|
@ -1459,8 +1461,8 @@ def UnionConversions(unionTypes, config):
|
|||
elif f.isPrimitive():
|
||||
headers.add("mozilla/dom/PrimitiveConversions.h")
|
||||
elif f.isRecord():
|
||||
headers.add("mozilla/dom/MozMap.h")
|
||||
# And the internal type of the MozMap
|
||||
headers.add("mozilla/dom/Record.h")
|
||||
# And the internal type of the record
|
||||
addHeadersForType(f.inner)
|
||||
|
||||
# We plan to include UnionTypes.h no matter what, so it's
|
||||
|
@ -4471,6 +4473,13 @@ def handleDefaultStringValue(defaultValue, method):
|
|||
}
|
||||
|
||||
|
||||
def recordKeyDeclType(recordType):
|
||||
assert recordType.keyType.isString()
|
||||
if recordType.keyType.isByteString():
|
||||
return CGGeneric("nsCString")
|
||||
return CGGeneric("nsString")
|
||||
|
||||
|
||||
# If this function is modified, modify CGNativeMember.getArg and
|
||||
# CGNativeMember.getRetvalInfo accordingly. The latter cares about the decltype
|
||||
# and holdertype we end up using, because it needs to be able to return the code
|
||||
|
@ -4665,7 +4674,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
|||
declArgs = "cx"
|
||||
else:
|
||||
assert (isMember in
|
||||
("Sequence", "Variadic", "Dictionary", "OwningUnion", "MozMap"))
|
||||
("Sequence", "Variadic", "Dictionary", "OwningUnion", "Record"))
|
||||
# We'll get traced by the sequence or dictionary or union tracer
|
||||
declType = CGGeneric("JSObject*")
|
||||
declArgs = None
|
||||
|
@ -4833,36 +4842,38 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
|||
if type.isRecord():
|
||||
assert not isEnforceRange and not isClamp
|
||||
if failureCode is None:
|
||||
notMozMap = ('ThrowErrorMessage(cx, MSG_NOT_OBJECT, "%s");\n'
|
||||
notRecord = ('ThrowErrorMessage(cx, MSG_NOT_OBJECT, "%s");\n'
|
||||
"%s" % (firstCap(sourceDescription), exceptionCode))
|
||||
else:
|
||||
notMozMap = failureCode
|
||||
notRecord = failureCode
|
||||
|
||||
nullable = type.nullable()
|
||||
# Be very careful not to change "type": we need it later
|
||||
if nullable:
|
||||
valueType = type.inner.inner
|
||||
recordType = type.inner
|
||||
else:
|
||||
valueType = type.inner
|
||||
recordType = type
|
||||
valueType = recordType.inner
|
||||
|
||||
valueInfo = getJSToNativeConversionInfo(
|
||||
valueType, descriptorProvider, isMember="MozMap",
|
||||
valueType, descriptorProvider, isMember="Record",
|
||||
exceptionCode=exceptionCode, lenientFloatCode=lenientFloatCode,
|
||||
isCallbackReturnValue=isCallbackReturnValue,
|
||||
sourceDescription="value in %s" % sourceDescription,
|
||||
nestingLevel=incrementNestingLevel())
|
||||
if valueInfo.dealWithOptional:
|
||||
raise TypeError("Shouldn't have optional things in MozMap")
|
||||
raise TypeError("Shouldn't have optional things in record")
|
||||
if valueInfo.holderType is not None:
|
||||
raise TypeError("Shouldn't need holders for MozMap")
|
||||
raise TypeError("Shouldn't need holders for record")
|
||||
|
||||
typeName = CGTemplatedType("MozMap", valueInfo.declType)
|
||||
mozMapType = typeName.define()
|
||||
declType = CGTemplatedType("Record", [recordKeyDeclType(recordType),
|
||||
valueInfo.declType])
|
||||
typeName = declType.define()
|
||||
if nullable:
|
||||
typeName = CGTemplatedType("Nullable", typeName)
|
||||
mozMapRef = "${declName}.SetValue()"
|
||||
declType = CGTemplatedType("Nullable", declType)
|
||||
recordRef = "${declName}.SetValue()"
|
||||
else:
|
||||
mozMapRef = "${declName}"
|
||||
recordRef = "${declName}"
|
||||
|
||||
valueConversion = string.Template(valueInfo.template).substitute({
|
||||
"val": "temp",
|
||||
|
@ -4876,17 +4887,17 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
|||
|
||||
templateBody = fill(
|
||||
"""
|
||||
auto& mozMapEntries = ${mozMapRef}.Entries();
|
||||
auto& recordEntries = ${recordRef}.Entries();
|
||||
|
||||
JS::Rooted<JSObject*> mozMapObj(cx, &$${val}.toObject());
|
||||
JS::Rooted<JSObject*> recordObj(cx, &$${val}.toObject());
|
||||
JS::AutoIdVector ids(cx);
|
||||
// Keep skipping symbols until
|
||||
// https://github.com/heycam/webidl/issues/294 is sorted out.
|
||||
if (!js::GetPropertyKeys(cx, mozMapObj,
|
||||
if (!js::GetPropertyKeys(cx, recordObj,
|
||||
JSITER_OWNONLY | JSITER_HIDDEN, &ids)) {
|
||||
$*{exceptionCode}
|
||||
}
|
||||
if (!mozMapEntries.SetCapacity(ids.length(), mozilla::fallible)) {
|
||||
if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
|
||||
JS_ReportOutOfMemory(cx);
|
||||
$*{exceptionCode}
|
||||
}
|
||||
|
@ -4899,7 +4910,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
|||
MOZ_ASSERT(!JSID_IS_SYMBOL(curId), "No symbols, we said!");
|
||||
|
||||
JS::Rooted<JS::PropertyDescriptor> desc(cx);
|
||||
if (!JS_GetOwnPropertyDescriptorById(cx, mozMapObj, curId,
|
||||
if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
|
||||
&desc)) {
|
||||
$*{exceptionCode}
|
||||
}
|
||||
|
@ -4916,44 +4927,45 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
|||
}
|
||||
MOZ_ASSERT(!isSymbol, "We said, no symbols!");
|
||||
|
||||
if (!JS_GetPropertyById(cx, mozMapObj, curId, &temp)) {
|
||||
if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
|
||||
$*{exceptionCode}
|
||||
}
|
||||
|
||||
// Safe to do an infallible append here, because we did a
|
||||
// SetCapacity above to the right capacity.
|
||||
${mozMapType}::EntryType* entry = mozMapEntries.AppendElement();
|
||||
${typeName}::EntryType* entry = recordEntries.AppendElement();
|
||||
entry->mKey = propName;
|
||||
${valueType}& slot = entry->mValue;
|
||||
$*{valueConversion}
|
||||
}
|
||||
""",
|
||||
exceptionCode=exceptionCode,
|
||||
mozMapRef=mozMapRef,
|
||||
mozMapType=mozMapType,
|
||||
recordRef=recordRef,
|
||||
typeName=typeName,
|
||||
valueType=valueInfo.declType.define(),
|
||||
valueConversion=valueConversion)
|
||||
|
||||
templateBody = wrapObjectTemplate(templateBody, type,
|
||||
"${declName}.SetNull();\n",
|
||||
notMozMap)
|
||||
notRecord)
|
||||
|
||||
declType = typeName
|
||||
declArgs = None
|
||||
holderType = None
|
||||
holderArgs = None
|
||||
# MozMap arguments that might contain traceable things need
|
||||
# record arguments that might contain traceable things need
|
||||
# to get traced
|
||||
if not isMember and isCallbackReturnValue:
|
||||
# Go ahead and just convert directly into our actual return value
|
||||
declType = CGWrapper(declType, post="&")
|
||||
declArgs = "aRetVal"
|
||||
elif not isMember and typeNeedsRooting(valueType):
|
||||
holderType = CGTemplatedType("MozMapRooter", valueInfo.declType)
|
||||
# If our MozMap is nullable, this will set the Nullable to be
|
||||
holderType = CGTemplatedType("RecordRooter",
|
||||
[recordKeyDeclType(recordType),
|
||||
valueInfo.declType])
|
||||
# If our record is nullable, this will set the Nullable to be
|
||||
# not-null, but that's ok because we make an explicit SetNull() call
|
||||
# on it as needed if our JS value is actually null.
|
||||
holderArgs = "cx, &%s" % mozMapRef
|
||||
holderArgs = "cx, &%s" % recordRef
|
||||
|
||||
return JSToNativeConversionInfo(templateBody, declType=declType,
|
||||
declArgs=declArgs,
|
||||
|
@ -5036,16 +5048,16 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
|||
else:
|
||||
setDictionary = None
|
||||
|
||||
mozMapMemberTypes = filter(lambda t: t.isRecord(), memberTypes)
|
||||
if len(mozMapMemberTypes) > 0:
|
||||
assert len(mozMapMemberTypes) == 1
|
||||
name = getUnionMemberName(mozMapMemberTypes[0])
|
||||
mozMapObject = CGGeneric(
|
||||
recordMemberTypes = filter(lambda t: t.isRecord(), memberTypes)
|
||||
if len(recordMemberTypes) > 0:
|
||||
assert len(recordMemberTypes) == 1
|
||||
name = getUnionMemberName(recordMemberTypes[0])
|
||||
recordObject = CGGeneric(
|
||||
"done = (failed = !%s.TrySetTo%s(cx, ${val}, tryNext, ${passedToJSImpl})) || !tryNext;\n" %
|
||||
(unionArgumentObj, name))
|
||||
names.append(name)
|
||||
else:
|
||||
mozMapObject = None
|
||||
recordObject = None
|
||||
|
||||
objectMemberTypes = filter(lambda t: t.isObject(), memberTypes)
|
||||
if len(objectMemberTypes) > 0:
|
||||
|
@ -5061,10 +5073,10 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
|||
else:
|
||||
object = None
|
||||
|
||||
hasObjectTypes = interfaceObject or sequenceObject or dateObject or callbackObject or object or mozMapObject
|
||||
hasObjectTypes = interfaceObject or sequenceObject or dateObject or callbackObject or object or recordObject
|
||||
if hasObjectTypes:
|
||||
# "object" is not distinguishable from other types
|
||||
assert not object or not (interfaceObject or sequenceObject or dateObject or callbackObject or mozMapObject)
|
||||
assert not object or not (interfaceObject or sequenceObject or dateObject or callbackObject or recordObject)
|
||||
if sequenceObject or dateObject or callbackObject:
|
||||
# An object can be both an sequence object and a callback or
|
||||
# dictionary, but we shouldn't have both in the union's members
|
||||
|
@ -5084,9 +5096,9 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
|||
if dateObject:
|
||||
templateBody.prepend(CGGeneric("JS::Rooted<JSObject*> argObj(cx, &${val}.toObject());\n"))
|
||||
|
||||
if mozMapObject:
|
||||
if recordObject:
|
||||
templateBody = CGList([templateBody,
|
||||
CGIfWrapper(mozMapObject, "!done")])
|
||||
CGIfWrapper(recordObject, "!done")])
|
||||
|
||||
templateBody = CGIfWrapper(templateBody, "${val}.isObject()")
|
||||
else:
|
||||
|
@ -5826,7 +5838,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
|||
assert not isEnforceRange and not isClamp
|
||||
|
||||
declArgs = None
|
||||
if isMember in ("Variadic", "Sequence", "Dictionary", "MozMap"):
|
||||
if isMember in ("Variadic", "Sequence", "Dictionary", "Record"):
|
||||
# Rooting is handled by the sequence and dictionary tracers.
|
||||
declType = "JS::Value"
|
||||
else:
|
||||
|
@ -6347,7 +6359,7 @@ def getMaybeWrapValueFuncForType(type):
|
|||
|
||||
|
||||
sequenceWrapLevel = 0
|
||||
mozMapWrapLevel = 0
|
||||
recordWrapLevel = 0
|
||||
|
||||
|
||||
def getWrapTemplateForType(type, descriptorProvider, result, successCode,
|
||||
|
@ -6526,13 +6538,13 @@ def getWrapTemplateForType(type, descriptorProvider, result, successCode,
|
|||
return (code, False)
|
||||
|
||||
if type.isRecord():
|
||||
# Now do non-nullable MozMap. Our success code is just to break to
|
||||
# Now do non-nullable record. Our success code is just to break to
|
||||
# where we define the property on the object. Note that we bump the
|
||||
# mozMapWrapLevel around this call so that nested MozMap conversions
|
||||
# recordWrapLevel around this call so that nested record conversions
|
||||
# will use different temp value names.
|
||||
global mozMapWrapLevel
|
||||
valueName = "mozMapValue%d" % mozMapWrapLevel
|
||||
mozMapWrapLevel += 1
|
||||
global recordWrapLevel
|
||||
valueName = "recordValue%d" % recordWrapLevel
|
||||
recordWrapLevel += 1
|
||||
innerTemplate = wrapForType(
|
||||
type.inner, descriptorProvider,
|
||||
{
|
||||
|
@ -6545,7 +6557,7 @@ def getWrapTemplateForType(type, descriptorProvider, result, successCode,
|
|||
'obj': "returnObj",
|
||||
'typedArraysAreStructs': typedArraysAreStructs
|
||||
})
|
||||
mozMapWrapLevel -= 1
|
||||
recordWrapLevel -= 1
|
||||
code = fill(
|
||||
"""
|
||||
|
||||
|
@ -6970,14 +6982,15 @@ def getRetvalDeclarationForType(returnType, descriptorProvider,
|
|||
returnType = returnType.inner
|
||||
result, _, _, _, _ = getRetvalDeclarationForType(returnType.inner,
|
||||
descriptorProvider,
|
||||
isMember="MozMap")
|
||||
isMember="Record")
|
||||
# While we have our inner type, set up our rooter, if needed
|
||||
if not isMember and typeNeedsRooting(returnType):
|
||||
rooter = CGGeneric("MozMapRooter<%s> resultRooter(cx, &result);\n" %
|
||||
result.define())
|
||||
rooter = CGGeneric("RecordRooter<%s> resultRooter(cx, &result);\n" %
|
||||
("nsString, " + result.define()))
|
||||
else:
|
||||
rooter = None
|
||||
result = CGTemplatedType("MozMap", result)
|
||||
result = CGTemplatedType("Record", [recordKeyDeclType(returnType),
|
||||
result])
|
||||
if nullable:
|
||||
result = CGTemplatedType("Nullable", result)
|
||||
return result, "ref", rooter, None, None
|
||||
|
@ -7239,7 +7252,7 @@ class MethodNotNewObjectError(Exception):
|
|||
# nested sequences we don't use the same variable name to iterate over
|
||||
# different sequences.
|
||||
sequenceWrapLevel = 0
|
||||
mapWrapLevel = 0
|
||||
recordWrapLevel = 0
|
||||
|
||||
|
||||
def wrapTypeIntoCurrentCompartment(type, value, isMember=True):
|
||||
|
@ -7304,20 +7317,20 @@ def wrapTypeIntoCurrentCompartment(type, value, isMember=True):
|
|||
origType = type
|
||||
if type.nullable():
|
||||
type = type.inner
|
||||
mozMapRef = "%s.Value()" % value
|
||||
recordRef = "%s.Value()" % value
|
||||
else:
|
||||
mozMapRef = value
|
||||
global mapWrapLevel
|
||||
entryRef = "mapEntry%d" % mapWrapLevel
|
||||
mapWrapLevel += 1
|
||||
recordRef = value
|
||||
global recordWrapLevel
|
||||
entryRef = "mapEntry%d" % recordWrapLevel
|
||||
recordWrapLevel += 1
|
||||
wrapElement = wrapTypeIntoCurrentCompartment(type.inner,
|
||||
"%s.mValue" % entryRef)
|
||||
mapWrapLevel -= 1
|
||||
recordWrapLevel -= 1
|
||||
if not wrapElement:
|
||||
return None
|
||||
wrapCode = CGWrapper(CGIndenter(wrapElement),
|
||||
pre=("for (auto& %s : %s.Entries()) {\n" %
|
||||
(entryRef, mozMapRef)),
|
||||
(entryRef, recordRef)),
|
||||
post="}\n")
|
||||
if origType.nullable():
|
||||
wrapCode = CGIfWrapper(wrapCode, "!%s.IsNull()" % value)
|
||||
|
@ -8158,7 +8171,7 @@ class CGMethodCall(CGThing):
|
|||
if distinguishingType(s).isSequence())
|
||||
|
||||
# Now append all the overloads that take a dictionary or callback
|
||||
# interface or MozMap. There should be only one of these!
|
||||
# interface or record. There should be only one of these!
|
||||
genericObjectSigs = [
|
||||
s for s in possibleSignatures
|
||||
if (distinguishingType(s).isDictionary() or
|
||||
|
@ -9840,13 +9853,18 @@ def getUnionAccessorSignatureType(type, descriptorProvider):
|
|||
if type.isSequence():
|
||||
wrapperType = "Sequence"
|
||||
else:
|
||||
wrapperType = "MozMap"
|
||||
wrapperType = "Record"
|
||||
# We don't use the returned template here, so it's OK to just pass no
|
||||
# sourceDescription.
|
||||
elementInfo = getJSToNativeConversionInfo(type.inner,
|
||||
descriptorProvider,
|
||||
isMember=wrapperType)
|
||||
return CGTemplatedType(wrapperType, elementInfo.declType,
|
||||
if wrapperType == "Sequence":
|
||||
innerType = elementInfo.declType
|
||||
else:
|
||||
innerType = [recordKeyDeclType(type), elementInfo.declType]
|
||||
|
||||
return CGTemplatedType(wrapperType, innerType,
|
||||
isConst=True, isReference=True)
|
||||
|
||||
# Nested unions are unwrapped automatically into our flatMemberTypes.
|
||||
|
@ -10204,7 +10222,7 @@ class CGUnionStruct(CGThing):
|
|||
elif t.isRecord():
|
||||
traceCases.append(
|
||||
CGCase("e" + vars["name"],
|
||||
CGGeneric("TraceMozMap(trc, mValue.m%s.Value());\n" %
|
||||
CGGeneric("TraceRecord(trc, mValue.m%s.Value());\n" %
|
||||
vars["name"])))
|
||||
else:
|
||||
assert t.isSpiderMonkeyInterface()
|
||||
|
@ -13356,7 +13374,7 @@ class CGDictionary(CGThing):
|
|||
if type.nullable():
|
||||
trace = CGIfWrapper(trace, "!%s.IsNull()" % memberNullable)
|
||||
elif type.isRecord():
|
||||
# If you implement this, add a MozMap<object> to
|
||||
# If you implement this, add a record<DOMString, object> to
|
||||
# TestInterfaceJSDictionary and test it in test_bug1036214.html
|
||||
# to make sure we end up with the correct security properties.
|
||||
assert False
|
||||
|
@ -14278,8 +14296,8 @@ class CGNativeMember(ClassMethod):
|
|||
returnCode = "aRetVal.SwapElements(${declName});\n"
|
||||
return "void", "", returnCode
|
||||
if type.isRecord():
|
||||
# If we want to handle MozMap-of-MozMap return values, we're
|
||||
# going to need to fix example codegen to not produce MozMap<void>
|
||||
# If we want to handle record-of-record return values, we're
|
||||
# going to need to fix example codegen to not produce record<void>
|
||||
# for the relevant argument...
|
||||
assert not isMember
|
||||
# In this case we convert directly into our outparam to start with
|
||||
|
@ -14333,7 +14351,8 @@ class CGNativeMember(ClassMethod):
|
|||
returnType = returnType.inner
|
||||
# And now the actual underlying type
|
||||
elementDecl = self.getReturnType(returnType.inner, True)
|
||||
type = CGTemplatedType("MozMap", CGGeneric(elementDecl))
|
||||
type = CGTemplatedType("Record", [recordKeyDeclType(returnType),
|
||||
CGGeneric(elementDecl)])
|
||||
if nullable:
|
||||
type = CGTemplatedType("Nullable", type)
|
||||
args.append(Argument("%s&" % type.define(), "aRetVal"))
|
||||
|
@ -14397,7 +14416,7 @@ class CGNativeMember(ClassMethod):
|
|||
Nullable as needed.
|
||||
|
||||
isMember can be false or one of the strings "Sequence", "Variadic",
|
||||
"MozMap"
|
||||
"Record"
|
||||
"""
|
||||
if type.isSequence():
|
||||
nullable = type.nullable()
|
||||
|
@ -14413,8 +14432,8 @@ class CGNativeMember(ClassMethod):
|
|||
if nullable:
|
||||
type = type.inner
|
||||
elementType = type.inner
|
||||
argType = self.getArgType(elementType, False, "MozMap")[0]
|
||||
decl = CGTemplatedType("MozMap", argType)
|
||||
argType = self.getArgType(elementType, False, "Record")[0]
|
||||
decl = CGTemplatedType("Record", [recordKeyDeclType(type), argType])
|
||||
return decl.define(), True, True
|
||||
|
||||
if type.isUnion():
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/**
|
||||
* Class for representing MozMap arguments. Basically an array under the hood.
|
||||
* Class for representing record arguments. Basically an array under the hood.
|
||||
*/
|
||||
|
||||
#ifndef mozilla_dom_MozMap_h
|
||||
#define mozilla_dom_MozMap_h
|
||||
#ifndef mozilla_dom_Record_h
|
||||
#define mozilla_dom_Record_h
|
||||
|
||||
#include "nsTHashtable.h"
|
||||
#include "nsHashKeys.h"
|
||||
|
@ -23,15 +23,15 @@ namespace dom {
|
|||
|
||||
namespace binding_detail {
|
||||
template<typename KeyType, typename ValueType>
|
||||
class MozMapEntry
|
||||
class RecordEntry
|
||||
{
|
||||
public:
|
||||
MozMapEntry()
|
||||
RecordEntry()
|
||||
{
|
||||
}
|
||||
|
||||
// Move constructor so we can do MozMaps of MozMaps.
|
||||
MozMapEntry(MozMapEntry<KeyType, ValueType>&& aOther)
|
||||
// Move constructor so we can do Records of Records.
|
||||
RecordEntry(RecordEntry<KeyType, ValueType>&& aOther)
|
||||
: mKey(Move(aOther.mKey)),
|
||||
mValue(Move(aOther.mValue))
|
||||
{
|
||||
|
@ -43,20 +43,19 @@ public:
|
|||
|
||||
} // namespace binding_detail
|
||||
|
||||
template<typename ValueType>
|
||||
class MozMap
|
||||
template<typename KeyType, typename ValueType>
|
||||
class Record
|
||||
{
|
||||
public:
|
||||
typedef nsString KeyType;
|
||||
typedef typename binding_detail::MozMapEntry<KeyType, ValueType> EntryType;
|
||||
typedef MozMap<ValueType> SelfType;
|
||||
typedef typename binding_detail::RecordEntry<nsString, ValueType> EntryType;
|
||||
typedef Record<KeyType, ValueType> SelfType;
|
||||
|
||||
MozMap()
|
||||
Record()
|
||||
{
|
||||
}
|
||||
|
||||
// Move constructor so we can do MozMap of MozMap.
|
||||
MozMap(SelfType&& aOther) :
|
||||
// Move constructor so we can do Record of Record.
|
||||
Record(SelfType&& aOther) :
|
||||
mEntries(Move(aOther.mEntries))
|
||||
{
|
||||
}
|
||||
|
@ -78,4 +77,4 @@ private:
|
|||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_MozMap_h
|
||||
#endif // mozilla_dom_Record_h
|
|
@ -41,10 +41,10 @@ EXPORTS.mozilla.dom += [
|
|||
'FakeString.h',
|
||||
'IterableIterator.h',
|
||||
'JSSlots.h',
|
||||
'MozMap.h',
|
||||
'NonRefcountedDOMObject.h',
|
||||
'Nullable.h',
|
||||
'PrimitiveConversions.h',
|
||||
'Record.h',
|
||||
'RootedDictionary.h',
|
||||
'SimpleGlobalObject.h',
|
||||
'StructuredClone.h',
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "mozilla/dom/Date.h"
|
||||
#include "mozilla/dom/MozMap.h"
|
||||
#include "mozilla/dom/Record.h"
|
||||
#include "mozilla/dom/TypedArray.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
@ -175,17 +175,17 @@ public:
|
|||
|
||||
static
|
||||
already_AddRefed<TestInterface> Test4(const GlobalObject&,
|
||||
const MozMap<MozMap<JS::Value>>&,
|
||||
const Record<nsString, Record<nsString, JS::Value>>&,
|
||||
ErrorResult&);
|
||||
|
||||
static
|
||||
already_AddRefed<TestInterface> Test5(const GlobalObject&,
|
||||
const MozMap<Sequence<MozMap<MozMap<Sequence<Sequence<JS::Value>>>>>>&,
|
||||
const Record<nsString, Sequence<Record<nsString, Record<nsString, Sequence<Sequence<JS::Value>>>>>>&,
|
||||
ErrorResult&);
|
||||
|
||||
static
|
||||
already_AddRefed<TestInterface> Test6(const GlobalObject&,
|
||||
const Sequence<MozMap<Sequence<Sequence<MozMap<MozMap<JS::Value>>>>>>&,
|
||||
const Sequence<Record<nsCString, Sequence<Sequence<Record<nsCString, Record<nsString, JS::Value>>>>>>&,
|
||||
ErrorResult&);
|
||||
|
||||
// Integer types
|
||||
|
@ -446,31 +446,31 @@ public:
|
|||
void ReceiveSequenceOfSequences(nsTArray< nsTArray<int32_t> >&);
|
||||
void ReceiveSequenceOfSequencesOfSequences(nsTArray<nsTArray<nsTArray<int32_t>>>&);
|
||||
|
||||
// MozMap types
|
||||
void PassMozMap(const MozMap<int32_t> &);
|
||||
void PassNullableMozMap(const Nullable< MozMap<int32_t> >&);
|
||||
void PassMozMapOfNullableInts(const MozMap<Nullable<int32_t> >&);
|
||||
void PassOptionalMozMapOfNullableInts(const Optional<MozMap<Nullable<int32_t> > > &);
|
||||
void PassOptionalNullableMozMapOfNullableInts(const Optional<Nullable<MozMap<Nullable<int32_t> > > > &);
|
||||
void PassCastableObjectMozMap(const MozMap< OwningNonNull<TestInterface> >&);
|
||||
void PassNullableCastableObjectMozMap(const MozMap< RefPtr<TestInterface> > &);
|
||||
void PassCastableObjectNullableMozMap(const Nullable< MozMap< OwningNonNull<TestInterface> > >&);
|
||||
void PassNullableCastableObjectNullableMozMap(const Nullable< MozMap< RefPtr<TestInterface> > >&);
|
||||
void PassOptionalMozMap(const Optional<MozMap<int32_t> >&);
|
||||
void PassOptionalNullableMozMap(const Optional<Nullable<MozMap<int32_t> > >&);
|
||||
void PassOptionalNullableMozMapWithDefaultValue(const Nullable< MozMap<int32_t> >&);
|
||||
void PassOptionalObjectMozMap(const Optional<MozMap<OwningNonNull<TestInterface> > >&);
|
||||
void PassExternalInterfaceMozMap(const MozMap<RefPtr<TestExternalInterface> >&);
|
||||
void PassNullableExternalInterfaceMozMap(const MozMap<RefPtr<TestExternalInterface> >&);
|
||||
void PassStringMozMap(const MozMap<nsString>&);
|
||||
void PassByteStringMozMap(const MozMap<nsCString>&);
|
||||
void PassMozMapOfMozMaps(const MozMap< MozMap<int32_t> >&);
|
||||
void ReceiveMozMap(MozMap<int32_t>&);
|
||||
void ReceiveNullableMozMap(Nullable<MozMap<int32_t>>&);
|
||||
void ReceiveMozMapOfNullableInts(MozMap<Nullable<int32_t>>&);
|
||||
void ReceiveNullableMozMapOfNullableInts(Nullable<MozMap<Nullable<int32_t>>>&);
|
||||
void ReceiveMozMapOfMozMaps(MozMap<MozMap<int32_t>>&);
|
||||
void ReceiveAnyMozMap(JSContext*, MozMap<JS::Value>&);
|
||||
// Record types
|
||||
void PassRecord(const Record<nsString, int32_t> &);
|
||||
void PassNullableRecord(const Nullable< Record<nsString, int32_t> >&);
|
||||
void PassRecordOfNullableInts(const Record<nsString, Nullable<int32_t> >&);
|
||||
void PassOptionalRecordOfNullableInts(const Optional<Record<nsString, Nullable<int32_t> > > &);
|
||||
void PassOptionalNullableRecordOfNullableInts(const Optional<Nullable<Record<nsString, Nullable<int32_t> > > > &);
|
||||
void PassCastableObjectRecord(const Record<nsString, OwningNonNull<TestInterface> >&);
|
||||
void PassNullableCastableObjectRecord(const Record<nsString, RefPtr<TestInterface> > &);
|
||||
void PassCastableObjectNullableRecord(const Nullable< Record<nsString, OwningNonNull<TestInterface> > >&);
|
||||
void PassNullableCastableObjectNullableRecord(const Nullable< Record<nsString, RefPtr<TestInterface> > >&);
|
||||
void PassOptionalRecord(const Optional<Record<nsString, int32_t> >&);
|
||||
void PassOptionalNullableRecord(const Optional<Nullable<Record<nsString, int32_t> > >&);
|
||||
void PassOptionalNullableRecordWithDefaultValue(const Nullable< Record<nsString, int32_t> >&);
|
||||
void PassOptionalObjectRecord(const Optional<Record<nsString, OwningNonNull<TestInterface> > >&);
|
||||
void PassExternalInterfaceRecord(const Record<nsString, RefPtr<TestExternalInterface> >&);
|
||||
void PassNullableExternalInterfaceRecord(const Record<nsString, RefPtr<TestExternalInterface> >&);
|
||||
void PassStringRecord(const Record<nsString, nsString>&);
|
||||
void PassByteStringRecord(const Record<nsString, nsCString>&);
|
||||
void PassRecordOfRecords(const Record<nsString, Record<nsString, int32_t> >&);
|
||||
void ReceiveRecord(Record<nsString, int32_t>&);
|
||||
void ReceiveNullableRecord(Nullable<Record<nsString, int32_t>>&);
|
||||
void ReceiveRecordOfNullableInts(Record<nsString, Nullable<int32_t>>&);
|
||||
void ReceiveNullableRecordOfNullableInts(Nullable<Record<nsString, Nullable<int32_t>>>&);
|
||||
void ReceiveRecordOfRecords(Record<nsString, Record<nsString, int32_t>>&);
|
||||
void ReceiveAnyRecord(JSContext*, Record<nsString, JS::Value>&);
|
||||
|
||||
// Typed array types
|
||||
void PassArrayBuffer(const ArrayBuffer&);
|
||||
|
@ -490,8 +490,8 @@ public:
|
|||
void PassFloat64Array(const Float64Array&);
|
||||
void PassSequenceOfArrayBuffers(const Sequence<ArrayBuffer>&);
|
||||
void PassSequenceOfNullableArrayBuffers(const Sequence<Nullable<ArrayBuffer> >&);
|
||||
void PassMozMapOfArrayBuffers(const MozMap<ArrayBuffer>&);
|
||||
void PassMozMapOfNullableArrayBuffers(const MozMap<Nullable<ArrayBuffer> >&);
|
||||
void PassRecordOfArrayBuffers(const Record<nsString, ArrayBuffer>&);
|
||||
void PassRecordOfNullableArrayBuffers(const Record<nsString, Nullable<ArrayBuffer> >&);
|
||||
void PassVariadicTypedArray(const Sequence<Float32Array>&);
|
||||
void PassVariadicNullableTypedArray(const Sequence<Nullable<Float32Array> >&);
|
||||
void ReceiveUint8Array(JSContext*, JS::MutableHandle<JSObject*>);
|
||||
|
@ -599,17 +599,17 @@ public:
|
|||
void PassSequenceOfNullableSequenceOfAny(JSContext*, const Sequence<Nullable<Sequence<JS::Value> > >&);
|
||||
void PassNullableSequenceOfNullableSequenceOfAny(JSContext*, const Nullable<Sequence<Nullable<Sequence<JS::Value> > > >&);
|
||||
void PassOptionalNullableSequenceOfNullableSequenceOfAny(JSContext*, const Optional<Nullable<Sequence<Nullable<Sequence<JS::Value> > > > >&);
|
||||
void PassMozMapOfAny(JSContext*, const MozMap<JS::Value>&);
|
||||
void PassNullableMozMapOfAny(JSContext*, const Nullable<MozMap<JS::Value> >&);
|
||||
void PassOptionalMozMapOfAny(JSContext*, const Optional<MozMap<JS::Value> >&);
|
||||
void PassOptionalNullableMozMapOfAny(JSContext*, const Optional<Nullable<MozMap<JS::Value> > >&);
|
||||
void PassOptionalMozMapOfAnyWithDefaultValue(JSContext*, const Nullable<MozMap<JS::Value> >&);
|
||||
void PassMozMapOfMozMapOfAny(JSContext*, const MozMap<MozMap<JS::Value> >&);
|
||||
void PassMozMapOfNullableMozMapOfAny(JSContext*, const MozMap<Nullable<MozMap<JS::Value> > >&);
|
||||
void PassNullableMozMapOfNullableMozMapOfAny(JSContext*, const Nullable<MozMap<Nullable<MozMap<JS::Value> > > >&);
|
||||
void PassOptionalNullableMozMapOfNullableMozMapOfAny(JSContext*, const Optional<Nullable<MozMap<Nullable<MozMap<JS::Value>>>>>&);
|
||||
void PassOptionalNullableMozMapOfNullableSequenceOfAny(JSContext*, const Optional<Nullable<MozMap<Nullable<Sequence<JS::Value>>>>>&);
|
||||
void PassOptionalNullableSequenceOfNullableMozMapOfAny(JSContext*, const Optional<Nullable<Sequence<Nullable<MozMap<JS::Value>>>>>&);
|
||||
void PassRecordOfAny(JSContext*, const Record<nsString, JS::Value>&);
|
||||
void PassNullableRecordOfAny(JSContext*, const Nullable<Record<nsString, JS::Value> >&);
|
||||
void PassOptionalRecordOfAny(JSContext*, const Optional<Record<nsString, JS::Value> >&);
|
||||
void PassOptionalNullableRecordOfAny(JSContext*, const Optional<Nullable<Record<nsString, JS::Value> > >&);
|
||||
void PassOptionalRecordOfAnyWithDefaultValue(JSContext*, const Nullable<Record<nsString, JS::Value> >&);
|
||||
void PassRecordOfRecordOfAny(JSContext*, const Record<nsString, Record<nsString, JS::Value> >&);
|
||||
void PassRecordOfNullableRecordOfAny(JSContext*, const Record<nsString, Nullable<Record<nsString, JS::Value> > >&);
|
||||
void PassNullableRecordOfNullableRecordOfAny(JSContext*, const Nullable<Record<nsString, Nullable<Record<nsString, JS::Value> > > >&);
|
||||
void PassOptionalNullableRecordOfNullableRecordOfAny(JSContext*, const Optional<Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>>&);
|
||||
void PassOptionalNullableRecordOfNullableSequenceOfAny(JSContext*, const Optional<Nullable<Record<nsString, Nullable<Sequence<JS::Value>>>>>&);
|
||||
void PassOptionalNullableSequenceOfNullableRecordOfAny(JSContext*, const Optional<Nullable<Sequence<Nullable<Record<nsString, JS::Value>>>>>&);
|
||||
void ReceiveAny(JSContext*, JS::MutableHandle<JS::Value>);
|
||||
|
||||
// object types
|
||||
|
@ -625,7 +625,7 @@ public:
|
|||
void PassNullableSequenceOfObject(JSContext*, const Nullable<Sequence<JSObject*> >&);
|
||||
void PassOptionalNullableSequenceOfNullableSequenceOfObject(JSContext*, const Optional<Nullable<Sequence<Nullable<Sequence<JSObject*> > > > >&);
|
||||
void PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(JSContext*, const Optional<Nullable<Sequence<Nullable<Sequence<JSObject*> > > > >&);
|
||||
void PassMozMapOfObject(JSContext*, const MozMap<JSObject*>&);
|
||||
void PassRecordOfObject(JSContext*, const Record<nsString, JSObject*>&);
|
||||
void ReceiveObject(JSContext*, JS::MutableHandle<JSObject*>);
|
||||
void ReceiveNullableObject(JSContext*, JS::MutableHandle<JSObject*>);
|
||||
|
||||
|
@ -675,9 +675,9 @@ public:
|
|||
void PassUnion28(const EventInitOrStringSequence&);
|
||||
void PassUnionWithCallback(const EventHandlerNonNullOrNullOrLong& arg);
|
||||
void PassUnionWithByteString(const ByteStringOrLong&);
|
||||
void PassUnionWithMozMap(const StringStringRecordOrString&);
|
||||
void PassUnionWithMozMapAndSequence(const StringStringRecordOrStringSequence&);
|
||||
void PassUnionWithSequenceAndMozMap(const StringSequenceOrStringStringRecord&);
|
||||
void PassUnionWithRecord(const StringStringRecordOrString&);
|
||||
void PassUnionWithRecordAndSequence(const StringStringRecordOrStringSequence&);
|
||||
void PassUnionWithSequenceAndRecord(const StringSequenceOrStringStringRecord&);
|
||||
void PassUnionWithUSVS(const USVStringOrLong&);
|
||||
#endif
|
||||
void PassNullableUnion(JSContext*, const Nullable<ObjectOrLong>&);
|
||||
|
@ -746,8 +746,8 @@ public:
|
|||
|
||||
void PassSequenceOfNullableUnions(const Sequence<Nullable<OwningCanvasPatternOrCanvasGradient>>&);
|
||||
void PassVariadicNullableUnion(const Sequence<Nullable<OwningCanvasPatternOrCanvasGradient>>&);
|
||||
void PassMozMapOfUnions(const MozMap<OwningCanvasPatternOrCanvasGradient>&);
|
||||
void PassMozMapOfUnions2(JSContext*, const MozMap<OwningObjectOrLong>&);
|
||||
void PassRecordOfUnions(const Record<nsString, OwningCanvasPatternOrCanvasGradient>&);
|
||||
void PassRecordOfUnions2(JSContext*, const Record<nsString, OwningObjectOrLong>&);
|
||||
|
||||
void ReceiveUnion(OwningCanvasPatternOrCanvasGradient&);
|
||||
void ReceiveUnion2(JSContext*, OwningObjectOrLong&);
|
||||
|
@ -768,7 +768,7 @@ public:
|
|||
void PassOptionalNullableDate(const Optional<Nullable<Date> >&);
|
||||
void PassOptionalNullableDateWithDefaultValue(const Nullable<Date>&);
|
||||
void PassDateSequence(const Sequence<Date>&);
|
||||
void PassDateMozMap(const MozMap<Date>&);
|
||||
void PassDateRecord(const Record<nsString, Date>&);
|
||||
void PassNullableDateSequence(const Sequence<Nullable<Date> >&);
|
||||
Date ReceiveDate();
|
||||
Nullable<Date> ReceiveNullableDate();
|
||||
|
@ -777,7 +777,7 @@ public:
|
|||
void PassPromise(Promise&);
|
||||
void PassOptionalPromise(const Optional<OwningNonNull<Promise>>&);
|
||||
void PassPromiseSequence(const Sequence<OwningNonNull<Promise>>&);
|
||||
void PassPromiseMozMap(const MozMap<RefPtr<Promise>>&);
|
||||
void PassPromiseRecord(const Record<nsString, RefPtr<Promise>>&);
|
||||
Promise* ReceivePromise();
|
||||
already_AddRefed<Promise> ReceiveAddrefedPromise();
|
||||
|
||||
|
@ -806,7 +806,7 @@ public:
|
|||
void ReceiveNullableDictionary(JSContext*, Nullable<Dict>&);
|
||||
void PassOtherDictionary(const GrandparentDict&);
|
||||
void PassSequenceOfDictionaries(JSContext*, const Sequence<Dict>&);
|
||||
void PassMozMapOfDictionaries(const MozMap<GrandparentDict>&);
|
||||
void PassRecordOfDictionaries(const Record<nsString, GrandparentDict>&);
|
||||
void PassDictionaryOrLong(JSContext*, const Dict&);
|
||||
void PassDictionaryOrLong(int32_t);
|
||||
void PassDictContainingDict(JSContext*, const DictContainingDict&);
|
||||
|
@ -878,8 +878,8 @@ public:
|
|||
void Overload16(int32_t);
|
||||
void Overload16(const Optional<TestInterface*>&);
|
||||
void Overload17(const Sequence<int32_t>&);
|
||||
void Overload17(const MozMap<int32_t>&);
|
||||
void Overload18(const MozMap<nsString>&);
|
||||
void Overload17(const Record<nsString, int32_t>&);
|
||||
void Overload18(const Record<nsString, nsString>&);
|
||||
void Overload18(const Sequence<nsString>&);
|
||||
void Overload19(const Sequence<int32_t>&);
|
||||
void Overload19(JSContext*, const Dict&);
|
||||
|
|
|
@ -22,7 +22,7 @@ callback interface TestCallbackInterface {
|
|||
long doSomethingElse(DOMString arg, TestInterface otherArg);
|
||||
void doSequenceLongArg(sequence<long> arg);
|
||||
void doSequenceStringArg(sequence<DOMString> arg);
|
||||
void doMozMapLongArg(record<DOMString, long> arg);
|
||||
void doRecordLongArg(record<DOMString, long> arg);
|
||||
sequence<long> getSequenceOfLong();
|
||||
sequence<TestInterface> getSequenceOfInterfaces();
|
||||
sequence<TestInterface>? getNullableSequenceOfInterfaces();
|
||||
|
@ -32,7 +32,7 @@ callback interface TestCallbackInterface {
|
|||
sequence<TestCallbackInterface>? getNullableSequenceOfCallbackInterfaces();
|
||||
sequence<TestCallbackInterface?> getSequenceOfNullableCallbackInterfaces();
|
||||
sequence<TestCallbackInterface?>? getNullableSequenceOfNullableCallbackInterfaces();
|
||||
record<DOMString, long> getMozMapOfLong();
|
||||
record<DOMString, long> getRecordOfLong();
|
||||
Dict? getDictionary();
|
||||
void passArrayBuffer(ArrayBuffer arg);
|
||||
void passNullableArrayBuffer(ArrayBuffer? arg);
|
||||
|
@ -418,31 +418,31 @@ interface TestInterface {
|
|||
sequence<sequence<long>> receiveSequenceOfSequences();
|
||||
sequence<sequence<sequence<long>>> receiveSequenceOfSequencesOfSequences();
|
||||
|
||||
// MozMap types
|
||||
void passMozMap(record<DOMString, long> arg);
|
||||
void passNullableMozMap(record<DOMString, long>? arg);
|
||||
void passMozMapOfNullableInts(record<DOMString, long?> arg);
|
||||
void passOptionalMozMapOfNullableInts(optional record<DOMString, long?> arg);
|
||||
void passOptionalNullableMozMapOfNullableInts(optional record<DOMString, long?>? arg);
|
||||
void passCastableObjectMozMap(record<DOMString, TestInterface> arg);
|
||||
void passNullableCastableObjectMozMap(record<DOMString, TestInterface?> arg);
|
||||
void passCastableObjectNullableMozMap(record<DOMString, TestInterface>? arg);
|
||||
void passNullableCastableObjectNullableMozMap(record<DOMString, TestInterface?>? arg);
|
||||
void passOptionalMozMap(optional record<DOMString, long> arg);
|
||||
void passOptionalNullableMozMap(optional record<DOMString, long>? arg);
|
||||
void passOptionalNullableMozMapWithDefaultValue(optional record<DOMString, long>? arg = null);
|
||||
void passOptionalObjectMozMap(optional record<DOMString, TestInterface> arg);
|
||||
void passExternalInterfaceMozMap(record<DOMString, TestExternalInterface> arg);
|
||||
void passNullableExternalInterfaceMozMap(record<DOMString, TestExternalInterface?> arg);
|
||||
void passStringMozMap(record<DOMString, DOMString> arg);
|
||||
void passByteStringMozMap(record<DOMString, ByteString> arg);
|
||||
void passMozMapOfMozMaps(record<DOMString, record<DOMString, long>> arg);
|
||||
record<DOMString, long> receiveMozMap();
|
||||
record<DOMString, long>? receiveNullableMozMap();
|
||||
record<DOMString, long?> receiveMozMapOfNullableInts();
|
||||
record<DOMString, long?>? receiveNullableMozMapOfNullableInts();
|
||||
record<DOMString, record<DOMString, long>> receiveMozMapOfMozMaps();
|
||||
record<DOMString, any> receiveAnyMozMap();
|
||||
// record types
|
||||
void passRecord(record<DOMString, long> arg);
|
||||
void passNullableRecord(record<DOMString, long>? arg);
|
||||
void passRecordOfNullableInts(record<DOMString, long?> arg);
|
||||
void passOptionalRecordOfNullableInts(optional record<DOMString, long?> arg);
|
||||
void passOptionalNullableRecordOfNullableInts(optional record<DOMString, long?>? arg);
|
||||
void passCastableObjectRecord(record<DOMString, TestInterface> arg);
|
||||
void passNullableCastableObjectRecord(record<DOMString, TestInterface?> arg);
|
||||
void passCastableObjectNullableRecord(record<DOMString, TestInterface>? arg);
|
||||
void passNullableCastableObjectNullableRecord(record<DOMString, TestInterface?>? arg);
|
||||
void passOptionalRecord(optional record<DOMString, long> arg);
|
||||
void passOptionalNullableRecord(optional record<DOMString, long>? arg);
|
||||
void passOptionalNullableRecordWithDefaultValue(optional record<DOMString, long>? arg = null);
|
||||
void passOptionalObjectRecord(optional record<DOMString, TestInterface> arg);
|
||||
void passExternalInterfaceRecord(record<DOMString, TestExternalInterface> arg);
|
||||
void passNullableExternalInterfaceRecord(record<DOMString, TestExternalInterface?> arg);
|
||||
void passStringRecord(record<DOMString, DOMString> arg);
|
||||
void passByteStringRecord(record<DOMString, ByteString> arg);
|
||||
void passRecordOfRecords(record<DOMString, record<DOMString, long>> arg);
|
||||
record<DOMString, long> receiveRecord();
|
||||
record<DOMString, long>? receiveNullableRecord();
|
||||
record<DOMString, long?> receiveRecordOfNullableInts();
|
||||
record<DOMString, long?>? receiveNullableRecordOfNullableInts();
|
||||
record<DOMString, record<DOMString, long>> receiveRecordOfRecords();
|
||||
record<DOMString, any> receiveAnyRecord();
|
||||
|
||||
// Typed array types
|
||||
void passArrayBuffer(ArrayBuffer arg);
|
||||
|
@ -462,8 +462,8 @@ interface TestInterface {
|
|||
void passFloat64Array(Float64Array arg);
|
||||
void passSequenceOfArrayBuffers(sequence<ArrayBuffer> arg);
|
||||
void passSequenceOfNullableArrayBuffers(sequence<ArrayBuffer?> arg);
|
||||
void passMozMapOfArrayBuffers(record<DOMString, ArrayBuffer> arg);
|
||||
void passMozMapOfNullableArrayBuffers(record<DOMString, ArrayBuffer?> arg);
|
||||
void passRecordOfArrayBuffers(record<DOMString, ArrayBuffer> arg);
|
||||
void passRecordOfNullableArrayBuffers(record<DOMString, ArrayBuffer?> arg);
|
||||
void passVariadicTypedArray(Float32Array... arg);
|
||||
void passVariadicNullableTypedArray(Float32Array?... arg);
|
||||
Uint8Array receiveUint8Array();
|
||||
|
@ -568,17 +568,17 @@ interface TestInterface {
|
|||
void passSequenceOfNullableSequenceOfAny(sequence<sequence<any>?> arg);
|
||||
void passNullableSequenceOfNullableSequenceOfAny(sequence<sequence<any>?>? arg);
|
||||
void passOptionalNullableSequenceOfNullableSequenceOfAny(optional sequence<sequence<any>?>? arg);
|
||||
void passMozMapOfAny(record<DOMString, any> arg);
|
||||
void passNullableMozMapOfAny(record<DOMString, any>? arg);
|
||||
void passOptionalMozMapOfAny(optional record<DOMString, any> arg);
|
||||
void passOptionalNullableMozMapOfAny(optional record<DOMString, any>? arg);
|
||||
void passOptionalMozMapOfAnyWithDefaultValue(optional record<DOMString, any>? arg = null);
|
||||
void passMozMapOfMozMapOfAny(record<DOMString, record<DOMString, any>> arg);
|
||||
void passMozMapOfNullableMozMapOfAny(record<DOMString, record<DOMString, any>?> arg);
|
||||
void passNullableMozMapOfNullableMozMapOfAny(record<DOMString, record<DOMString, any>?>? arg);
|
||||
void passOptionalNullableMozMapOfNullableMozMapOfAny(optional record<DOMString, record<DOMString, any>?>? arg);
|
||||
void passOptionalNullableMozMapOfNullableSequenceOfAny(optional record<DOMString, sequence<any>?>? arg);
|
||||
void passOptionalNullableSequenceOfNullableMozMapOfAny(optional sequence<record<DOMString, any>?>? arg);
|
||||
void passRecordOfAny(record<DOMString, any> arg);
|
||||
void passNullableRecordOfAny(record<DOMString, any>? arg);
|
||||
void passOptionalRecordOfAny(optional record<DOMString, any> arg);
|
||||
void passOptionalNullableRecordOfAny(optional record<DOMString, any>? arg);
|
||||
void passOptionalRecordOfAnyWithDefaultValue(optional record<DOMString, any>? arg = null);
|
||||
void passRecordOfRecordOfAny(record<DOMString, record<DOMString, any>> arg);
|
||||
void passRecordOfNullableRecordOfAny(record<DOMString, record<DOMString, any>?> arg);
|
||||
void passNullableRecordOfNullableRecordOfAny(record<DOMString, record<DOMString, any>?>? arg);
|
||||
void passOptionalNullableRecordOfNullableRecordOfAny(optional record<DOMString, record<DOMString, any>?>? arg);
|
||||
void passOptionalNullableRecordOfNullableSequenceOfAny(optional record<DOMString, sequence<any>?>? arg);
|
||||
void passOptionalNullableSequenceOfNullableRecordOfAny(optional sequence<record<DOMString, any>?>? arg);
|
||||
any receiveAny();
|
||||
|
||||
// object types
|
||||
|
@ -594,7 +594,7 @@ interface TestInterface {
|
|||
void passNullableSequenceOfObject(sequence<object>? arg);
|
||||
void passOptionalNullableSequenceOfNullableSequenceOfObject(optional sequence<sequence<object>?>? arg);
|
||||
void passOptionalNullableSequenceOfNullableSequenceOfNullableObject(optional sequence<sequence<object?>?>? arg);
|
||||
void passMozMapOfObject(record<DOMString, object> arg);
|
||||
void passRecordOfObject(record<DOMString, object> arg);
|
||||
object receiveObject();
|
||||
object? receiveNullableObject();
|
||||
|
||||
|
@ -632,9 +632,9 @@ interface TestInterface {
|
|||
void passUnion28(optional (EventInit or sequence<DOMString>) arg);
|
||||
void passUnionWithCallback((EventHandler or long) arg);
|
||||
void passUnionWithByteString((ByteString or long) arg);
|
||||
void passUnionWithMozMap((record<DOMString, DOMString> or DOMString) arg);
|
||||
void passUnionWithMozMapAndSequence((record<DOMString, DOMString> or sequence<DOMString>) arg);
|
||||
void passUnionWithSequenceAndMozMap((sequence<DOMString> or record<DOMString, DOMString>) arg);
|
||||
void passUnionWithRecord((record<DOMString, DOMString> or DOMString) arg);
|
||||
void passUnionWithRecordAndSequence((record<DOMString, DOMString> or sequence<DOMString>) arg);
|
||||
void passUnionWithSequenceAndRecord((sequence<DOMString> or record<DOMString, DOMString>) arg);
|
||||
void passUnionWithUSVS((USVString or long) arg);
|
||||
#endif
|
||||
void passUnionWithNullable((object? or long) arg);
|
||||
|
@ -713,9 +713,9 @@ interface TestInterface {
|
|||
|
||||
void passSequenceOfNullableUnions(sequence<(CanvasPattern or CanvasGradient)?> arg);
|
||||
void passVariadicNullableUnion((CanvasPattern or CanvasGradient)?... arg);
|
||||
void passMozMapOfUnions(record<DOMString, (CanvasPattern or CanvasGradient)> arg);
|
||||
void passRecordOfUnions(record<DOMString, (CanvasPattern or CanvasGradient)> arg);
|
||||
// XXXbz no move constructor on some unions
|
||||
// void passMozMapOfUnions2(record<DOMString, (object or long)> arg);
|
||||
// void passRecordOfUnions2(record<DOMString, (object or long)> arg);
|
||||
|
||||
(CanvasPattern or CanvasGradient) receiveUnion();
|
||||
(object or long) receiveUnion2();
|
||||
|
@ -735,7 +735,7 @@ interface TestInterface {
|
|||
void passOptionalNullableDateWithDefaultValue(optional Date? arg = null);
|
||||
void passDateSequence(sequence<Date> arg);
|
||||
void passNullableDateSequence(sequence<Date?> arg);
|
||||
void passDateMozMap(record<DOMString, Date> arg);
|
||||
void passDateRecord(record<DOMString, Date> arg);
|
||||
Date receiveDate();
|
||||
Date? receiveNullableDate();
|
||||
|
||||
|
@ -774,7 +774,7 @@ interface TestInterface {
|
|||
Dict? receiveNullableDictionary();
|
||||
void passOtherDictionary(optional GrandparentDict x);
|
||||
void passSequenceOfDictionaries(sequence<Dict> x);
|
||||
void passMozMapOfDictionaries(record<DOMString, GrandparentDict> x);
|
||||
void passRecordOfDictionaries(record<DOMString, GrandparentDict> x);
|
||||
// No support for nullable dictionaries inside a sequence (nor should there be)
|
||||
// void passSequenceOfNullableDictionaries(sequence<Dict?> x);
|
||||
void passDictionaryOrLong(optional Dict x);
|
||||
|
@ -1123,7 +1123,13 @@ dictionary Dict : ParentDict {
|
|||
record<DOMString, long> recordMember;
|
||||
record<DOMString, long>? nullableRecord;
|
||||
record<DOMString, DOMString>? nullableRecordWithDefault = null;
|
||||
record<USVString, long> usvStringRecord;
|
||||
record<USVString, long>? nullableUSVStringRecordWithDefault = null;
|
||||
record<ByteString, long> byteStringRecord;
|
||||
record<ByteString, long>? nullableByteStringRecordWithDefault = null;
|
||||
required record<DOMString, TestInterface> requiredRecord;
|
||||
required record<USVString, TestInterface> requiredUSVRecord;
|
||||
required record<ByteString, TestInterface> requiredByteRecord;
|
||||
};
|
||||
|
||||
dictionary ParentDict : GrandparentDict {
|
||||
|
|
|
@ -278,32 +278,32 @@ interface TestExampleInterface {
|
|||
//XXXbz No support for sequence of sequence return values yet.
|
||||
//sequence<sequence<long>> receiveSequenceOfSequences();
|
||||
|
||||
// MozMap types
|
||||
void passMozMap(record<DOMString, long> arg);
|
||||
void passNullableMozMap(record<DOMString, long>? arg);
|
||||
void passMozMapOfNullableInts(record<DOMString, long?> arg);
|
||||
void passOptionalMozMapOfNullableInts(optional record<DOMString, long?> arg);
|
||||
void passOptionalNullableMozMapOfNullableInts(optional record<DOMString, long?>? arg);
|
||||
void passCastableObjectMozMap(record<DOMString, TestInterface> arg);
|
||||
void passNullableCastableObjectMozMap(record<DOMString, TestInterface?> arg);
|
||||
void passCastableObjectNullableMozMap(record<DOMString, TestInterface>? arg);
|
||||
void passNullableCastableObjectNullableMozMap(record<DOMString, TestInterface?>? arg);
|
||||
void passOptionalMozMap(optional record<DOMString, long> arg);
|
||||
void passOptionalNullableMozMap(optional record<DOMString, long>? arg);
|
||||
void passOptionalNullableMozMapWithDefaultValue(optional record<DOMString, long>? arg = null);
|
||||
void passOptionalObjectMozMap(optional record<DOMString, TestInterface> arg);
|
||||
void passExternalInterfaceMozMap(record<DOMString, TestExternalInterface> arg);
|
||||
void passNullableExternalInterfaceMozMap(record<DOMString, TestExternalInterface?> arg);
|
||||
void passStringMozMap(record<DOMString, DOMString> arg);
|
||||
void passByteStringMozMap(record<DOMString, ByteString> arg);
|
||||
void passMozMapOfMozMaps(record<DOMString, record<DOMString, long>> arg);
|
||||
record<DOMString, long> receiveMozMap();
|
||||
record<DOMString, long>? receiveNullableMozMap();
|
||||
record<DOMString, long?> receiveMozMapOfNullableInts();
|
||||
record<DOMString, long?>? receiveNullableMozMapOfNullableInts();
|
||||
//XXXbz No support for MozMap of MozMaps return values yet.
|
||||
//record<DOMString, record<DOMString, long>> receiveMozMapOfMozMaps();
|
||||
record<DOMString, any> receiveAnyMozMap();
|
||||
// record types
|
||||
void passRecord(record<DOMString, long> arg);
|
||||
void passNullableRecord(record<DOMString, long>? arg);
|
||||
void passRecordOfNullableInts(record<DOMString, long?> arg);
|
||||
void passOptionalRecordOfNullableInts(optional record<DOMString, long?> arg);
|
||||
void passOptionalNullableRecordOfNullableInts(optional record<DOMString, long?>? arg);
|
||||
void passCastableObjectRecord(record<DOMString, TestInterface> arg);
|
||||
void passNullableCastableObjectRecord(record<DOMString, TestInterface?> arg);
|
||||
void passCastableObjectNullableRecord(record<DOMString, TestInterface>? arg);
|
||||
void passNullableCastableObjectNullableRecord(record<DOMString, TestInterface?>? arg);
|
||||
void passOptionalRecord(optional record<DOMString, long> arg);
|
||||
void passOptionalNullableRecord(optional record<DOMString, long>? arg);
|
||||
void passOptionalNullableRecordWithDefaultValue(optional record<DOMString, long>? arg = null);
|
||||
void passOptionalObjectRecord(optional record<DOMString, TestInterface> arg);
|
||||
void passExternalInterfaceRecord(record<DOMString, TestExternalInterface> arg);
|
||||
void passNullableExternalInterfaceRecord(record<DOMString, TestExternalInterface?> arg);
|
||||
void passStringRecord(record<DOMString, DOMString> arg);
|
||||
void passByteStringRecord(record<DOMString, ByteString> arg);
|
||||
void passRecordOfRecords(record<DOMString, record<DOMString, long>> arg);
|
||||
record<DOMString, long> receiveRecord();
|
||||
record<DOMString, long>? receiveNullableRecord();
|
||||
record<DOMString, long?> receiveRecordOfNullableInts();
|
||||
record<DOMString, long?>? receiveNullableRecordOfNullableInts();
|
||||
//XXXbz No support for record of records return values yet.
|
||||
//record<DOMString, record<DOMString, long>> receiveRecordOfRecords();
|
||||
record<DOMString, any> receiveAnyRecord();
|
||||
|
||||
// Typed array types
|
||||
void passArrayBuffer(ArrayBuffer arg);
|
||||
|
@ -323,8 +323,8 @@ interface TestExampleInterface {
|
|||
void passFloat64Array(Float64Array arg);
|
||||
void passSequenceOfArrayBuffers(sequence<ArrayBuffer> arg);
|
||||
void passSequenceOfNullableArrayBuffers(sequence<ArrayBuffer?> arg);
|
||||
void passMozMapOfArrayBuffers(record<DOMString, ArrayBuffer> arg);
|
||||
void passMozMapOfNullableArrayBuffers(record<DOMString, ArrayBuffer?> arg);
|
||||
void passRecordOfArrayBuffers(record<DOMString, ArrayBuffer> arg);
|
||||
void passRecordOfNullableArrayBuffers(record<DOMString, ArrayBuffer?> arg);
|
||||
void passVariadicTypedArray(Float32Array... arg);
|
||||
void passVariadicNullableTypedArray(Float32Array?... arg);
|
||||
Uint8Array receiveUint8Array();
|
||||
|
@ -400,17 +400,17 @@ interface TestExampleInterface {
|
|||
void passSequenceOfNullableSequenceOfAny(sequence<sequence<any>?> arg);
|
||||
void passNullableSequenceOfNullableSequenceOfAny(sequence<sequence<any>?>? arg);
|
||||
void passOptionalNullableSequenceOfNullableSequenceOfAny(optional sequence<sequence<any>?>? arg);
|
||||
void passMozMapOfAny(record<DOMString, any> arg);
|
||||
void passNullableMozMapOfAny(record<DOMString, any>? arg);
|
||||
void passOptionalMozMapOfAny(optional record<DOMString, any> arg);
|
||||
void passOptionalNullableMozMapOfAny(optional record<DOMString, any>? arg);
|
||||
void passOptionalMozMapOfAnyWithDefaultValue(optional record<DOMString, any>? arg = null);
|
||||
void passMozMapOfMozMapOfAny(record<DOMString, record<DOMString, any>> arg);
|
||||
void passMozMapOfNullableMozMapOfAny(record<DOMString, record<DOMString, any>?> arg);
|
||||
void passNullableMozMapOfNullableMozMapOfAny(record<DOMString, record<DOMString, any>?>? arg);
|
||||
void passOptionalNullableMozMapOfNullableMozMapOfAny(optional record<DOMString, record<DOMString, any>?>? arg);
|
||||
void passOptionalNullableMozMapOfNullableSequenceOfAny(optional record<DOMString, sequence<any>?>? arg);
|
||||
void passOptionalNullableSequenceOfNullableMozMapOfAny(optional sequence<record<DOMString, any>?>? arg);
|
||||
void passRecordOfAny(record<DOMString, any> arg);
|
||||
void passNullableRecordOfAny(record<DOMString, any>? arg);
|
||||
void passOptionalRecordOfAny(optional record<DOMString, any> arg);
|
||||
void passOptionalNullableRecordOfAny(optional record<DOMString, any>? arg);
|
||||
void passOptionalRecordOfAnyWithDefaultValue(optional record<DOMString, any>? arg = null);
|
||||
void passRecordOfRecordOfAny(record<DOMString, record<DOMString, any>> arg);
|
||||
void passRecordOfNullableRecordOfAny(record<DOMString, record<DOMString, any>?> arg);
|
||||
void passNullableRecordOfNullableRecordOfAny(record<DOMString, record<DOMString, any>?>? arg);
|
||||
void passOptionalNullableRecordOfNullableRecordOfAny(optional record<DOMString, record<DOMString, any>?>? arg);
|
||||
void passOptionalNullableRecordOfNullableSequenceOfAny(optional record<DOMString, sequence<any>?>? arg);
|
||||
void passOptionalNullableSequenceOfNullableRecordOfAny(optional sequence<record<DOMString, any>?>? arg);
|
||||
any receiveAny();
|
||||
|
||||
// object types
|
||||
|
@ -426,7 +426,7 @@ interface TestExampleInterface {
|
|||
void passNullableSequenceOfObject(sequence<object>? arg);
|
||||
void passOptionalNullableSequenceOfNullableSequenceOfObject(optional sequence<sequence<object>?>? arg);
|
||||
void passOptionalNullableSequenceOfNullableSequenceOfNullableObject(optional sequence<sequence<object?>?>? arg);
|
||||
void passMozMapOfObject(record<DOMString, object> arg);
|
||||
void passRecordOfObject(record<DOMString, object> arg);
|
||||
object receiveObject();
|
||||
object? receiveNullableObject();
|
||||
|
||||
|
@ -465,9 +465,9 @@ interface TestExampleInterface {
|
|||
void passUnion28(optional (EventInit or sequence<DOMString>) arg);
|
||||
void passUnionWithCallback((EventHandler or long) arg);
|
||||
void passUnionWithByteString((ByteString or long) arg);
|
||||
void passUnionWithMozMap((record<DOMString, DOMString> or DOMString) arg);
|
||||
void passUnionWithMozMapAndSequence((record<DOMString, DOMString> or sequence<DOMString>) arg);
|
||||
void passUnionWithSequenceAndMozMap((sequence<DOMString> or record<DOMString, DOMString>) arg);
|
||||
void passUnionWithRecord((record<DOMString, DOMString> or DOMString) arg);
|
||||
void passUnionWithRecordAndSequence((record<DOMString, DOMString> or sequence<DOMString>) arg);
|
||||
void passUnionWithSequenceAndRecord((sequence<DOMString> or record<DOMString, DOMString>) arg);
|
||||
void passUnionWithSVS((USVString or long) arg);
|
||||
#endif
|
||||
void passUnionWithNullable((object? or long) arg);
|
||||
|
@ -546,9 +546,9 @@ interface TestExampleInterface {
|
|||
|
||||
void passSequenceOfNullableUnions(sequence<(CanvasPattern or CanvasGradient)?> arg);
|
||||
void passVariadicNullableUnion((CanvasPattern or CanvasGradient)?... arg);
|
||||
void passMozMapOfUnions(record<DOMString, (CanvasPattern or CanvasGradient)> arg);
|
||||
void passRecordOfUnions(record<DOMString, (CanvasPattern or CanvasGradient)> arg);
|
||||
// XXXbz no move constructor on some unions
|
||||
// void passMozMapOfUnions2(record<DOMString, (object or long)> arg);
|
||||
// void passRecordOfUnions2(record<DOMString, (object or long)> arg);
|
||||
|
||||
(CanvasPattern or CanvasGradient) receiveUnion();
|
||||
(object or long) receiveUnion2();
|
||||
|
@ -568,7 +568,7 @@ interface TestExampleInterface {
|
|||
void passOptionalNullableDateWithDefaultValue(optional Date? arg = null);
|
||||
void passDateSequence(sequence<Date> arg);
|
||||
void passNullableDateSequence(sequence<Date?> arg);
|
||||
void passDateMozMap(record<DOMString, Date> arg);
|
||||
void passDateRecord(record<DOMString, Date> arg);
|
||||
Date receiveDate();
|
||||
Date? receiveNullableDate();
|
||||
|
||||
|
@ -607,7 +607,7 @@ interface TestExampleInterface {
|
|||
Dict? receiveNullableDictionary();
|
||||
void passOtherDictionary(optional GrandparentDict x);
|
||||
void passSequenceOfDictionaries(sequence<Dict> x);
|
||||
void passMozMapOfDictionaries(record<DOMString, GrandparentDict> x);
|
||||
void passRecordOfDictionaries(record<DOMString, GrandparentDict> x);
|
||||
// No support for nullable dictionaries inside a sequence (nor should there be)
|
||||
// void passSequenceOfNullableDictionaries(sequence<Dict?> x);
|
||||
void passDictionaryOrLong(optional Dict x);
|
||||
|
|
|
@ -289,32 +289,32 @@ interface TestJSImplInterface {
|
|||
//XXXbz No support for sequence of sequence return values yet.
|
||||
//sequence<sequence<long>> receiveSequenceOfSequences();
|
||||
|
||||
// MozMap types
|
||||
void passMozMap(record<DOMString, long> arg);
|
||||
void passNullableMozMap(record<DOMString, long>? arg);
|
||||
void passMozMapOfNullableInts(record<DOMString, long?> arg);
|
||||
void passOptionalMozMapOfNullableInts(optional record<DOMString, long?> arg);
|
||||
void passOptionalNullableMozMapOfNullableInts(optional record<DOMString, long?>? arg);
|
||||
void passCastableObjectMozMap(record<DOMString, TestJSImplInterface> arg);
|
||||
void passNullableCastableObjectMozMap(record<DOMString, TestJSImplInterface?> arg);
|
||||
void passCastableObjectNullableMozMap(record<DOMString, TestJSImplInterface>? arg);
|
||||
void passNullableCastableObjectNullableMozMap(record<DOMString, TestJSImplInterface?>? arg);
|
||||
void passOptionalMozMap(optional record<DOMString, long> arg);
|
||||
void passOptionalNullableMozMap(optional record<DOMString, long>? arg);
|
||||
void passOptionalNullableMozMapWithDefaultValue(optional record<DOMString, long>? arg = null);
|
||||
void passOptionalObjectMozMap(optional record<DOMString, TestJSImplInterface> arg);
|
||||
void passExternalInterfaceMozMap(record<DOMString, TestExternalInterface> arg);
|
||||
void passNullableExternalInterfaceMozMap(record<DOMString, TestExternalInterface?> arg);
|
||||
void passStringMozMap(record<DOMString, DOMString> arg);
|
||||
void passByteStringMozMap(record<DOMString, ByteString> arg);
|
||||
void passMozMapOfMozMaps(record<DOMString, record<DOMString, long>> arg);
|
||||
record<DOMString, long> receiveMozMap();
|
||||
record<DOMString, long>? receiveNullableMozMap();
|
||||
record<DOMString, long?> receiveMozMapOfNullableInts();
|
||||
record<DOMString, long?>? receiveNullableMozMapOfNullableInts();
|
||||
//XXXbz No support for MozMap of MozMaps return values yet.
|
||||
//record<DOMString, record<DOMString, long>> receiveMozMapOfMozMaps();
|
||||
record<DOMString, any> receiveAnyMozMap();
|
||||
// record types
|
||||
void passRecord(record<DOMString, long> arg);
|
||||
void passNullableRecord(record<DOMString, long>? arg);
|
||||
void passRecordOfNullableInts(record<DOMString, long?> arg);
|
||||
void passOptionalRecordOfNullableInts(optional record<DOMString, long?> arg);
|
||||
void passOptionalNullableRecordOfNullableInts(optional record<DOMString, long?>? arg);
|
||||
void passCastableObjectRecord(record<DOMString, TestInterface> arg);
|
||||
void passNullableCastableObjectRecord(record<DOMString, TestInterface?> arg);
|
||||
void passCastableObjectNullableRecord(record<DOMString, TestInterface>? arg);
|
||||
void passNullableCastableObjectNullableRecord(record<DOMString, TestInterface?>? arg);
|
||||
void passOptionalRecord(optional record<DOMString, long> arg);
|
||||
void passOptionalNullableRecord(optional record<DOMString, long>? arg);
|
||||
void passOptionalNullableRecordWithDefaultValue(optional record<DOMString, long>? arg = null);
|
||||
void passOptionalObjectRecord(optional record<DOMString, TestInterface> arg);
|
||||
void passExternalInterfaceRecord(record<DOMString, TestExternalInterface> arg);
|
||||
void passNullableExternalInterfaceRecord(record<DOMString, TestExternalInterface?> arg);
|
||||
void passStringRecord(record<DOMString, DOMString> arg);
|
||||
void passByteStringRecord(record<DOMString, ByteString> arg);
|
||||
void passRecordOfRecords(record<DOMString, record<DOMString, long>> arg);
|
||||
record<DOMString, long> receiveRecord();
|
||||
record<DOMString, long>? receiveNullableRecord();
|
||||
record<DOMString, long?> receiveRecordOfNullableInts();
|
||||
record<DOMString, long?>? receiveNullableRecordOfNullableInts();
|
||||
//XXXbz No support for record of records return values yet.
|
||||
//record<DOMString, record<DOMString, long>> receiveRecordOfRecords();
|
||||
record<DOMString, any> receiveAnyRecord();
|
||||
|
||||
// Typed array types
|
||||
void passArrayBuffer(ArrayBuffer arg);
|
||||
|
@ -334,8 +334,8 @@ interface TestJSImplInterface {
|
|||
void passFloat64Array(Float64Array arg);
|
||||
void passSequenceOfArrayBuffers(sequence<ArrayBuffer> arg);
|
||||
void passSequenceOfNullableArrayBuffers(sequence<ArrayBuffer?> arg);
|
||||
void passMozMapOfArrayBuffers(record<DOMString, ArrayBuffer> arg);
|
||||
void passMozMapOfNullableArrayBuffers(record<DOMString, ArrayBuffer?> arg);
|
||||
void passRecordOfArrayBuffers(record<DOMString, ArrayBuffer> arg);
|
||||
void passRecordOfNullableArrayBuffers(record<DOMString, ArrayBuffer?> arg);
|
||||
void passVariadicTypedArray(Float32Array... arg);
|
||||
void passVariadicNullableTypedArray(Float32Array?... arg);
|
||||
Uint8Array receiveUint8Array();
|
||||
|
@ -412,17 +412,17 @@ interface TestJSImplInterface {
|
|||
void passSequenceOfNullableSequenceOfAny(sequence<sequence<any>?> arg);
|
||||
void passNullableSequenceOfNullableSequenceOfAny(sequence<sequence<any>?>? arg);
|
||||
void passOptionalNullableSequenceOfNullableSequenceOfAny(optional sequence<sequence<any>?>? arg);
|
||||
void passMozMapOfAny(record<DOMString, any> arg);
|
||||
void passNullableMozMapOfAny(record<DOMString, any>? arg);
|
||||
void passOptionalMozMapOfAny(optional record<DOMString, any> arg);
|
||||
void passOptionalNullableMozMapOfAny(optional record<DOMString, any>? arg);
|
||||
void passOptionalMozMapOfAnyWithDefaultValue(optional record<DOMString, any>? arg = null);
|
||||
void passMozMapOfMozMapOfAny(record<DOMString, record<DOMString, any>> arg);
|
||||
void passMozMapOfNullableMozMapOfAny(record<DOMString, record<DOMString, any>?> arg);
|
||||
void passNullableMozMapOfNullableMozMapOfAny(record<DOMString, record<DOMString, any>?>? arg);
|
||||
void passOptionalNullableMozMapOfNullableMozMapOfAny(optional record<DOMString, record<DOMString, any>?>? arg);
|
||||
void passOptionalNullableMozMapOfNullableSequenceOfAny(optional record<DOMString, sequence<any>?>? arg);
|
||||
void passOptionalNullableSequenceOfNullableMozMapOfAny(optional sequence<record<DOMString, any>?>? arg);
|
||||
void passRecordOfAny(record<DOMString, any> arg);
|
||||
void passNullableRecordOfAny(record<DOMString, any>? arg);
|
||||
void passOptionalRecordOfAny(optional record<DOMString, any> arg);
|
||||
void passOptionalNullableRecordOfAny(optional record<DOMString, any>? arg);
|
||||
void passOptionalRecordOfAnyWithDefaultValue(optional record<DOMString, any>? arg = null);
|
||||
void passRecordOfRecordOfAny(record<DOMString, record<DOMString, any>> arg);
|
||||
void passRecordOfNullableRecordOfAny(record<DOMString, record<DOMString, any>?> arg);
|
||||
void passNullableRecordOfNullableRecordOfAny(record<DOMString, record<DOMString, any>?>? arg);
|
||||
void passOptionalNullableRecordOfNullableRecordOfAny(optional record<DOMString, record<DOMString, any>?>? arg);
|
||||
void passOptionalNullableRecordOfNullableSequenceOfAny(optional record<DOMString, sequence<any>?>? arg);
|
||||
void passOptionalNullableSequenceOfNullableRecordOfAny(optional sequence<record<DOMString, any>?>? arg);
|
||||
any receiveAny();
|
||||
|
||||
// object types
|
||||
|
@ -438,7 +438,7 @@ interface TestJSImplInterface {
|
|||
void passNullableSequenceOfObject(sequence<object>? arg);
|
||||
void passOptionalNullableSequenceOfNullableSequenceOfObject(optional sequence<sequence<object>?>? arg);
|
||||
void passOptionalNullableSequenceOfNullableSequenceOfNullableObject(optional sequence<sequence<object?>?>? arg);
|
||||
void passMozMapOfObject(record<DOMString, object> arg);
|
||||
void passRecordOfObject(record<DOMString, object> arg);
|
||||
object receiveObject();
|
||||
object? receiveNullableObject();
|
||||
|
||||
|
@ -476,9 +476,9 @@ interface TestJSImplInterface {
|
|||
void passUnion28(optional (EventInit or sequence<DOMString>) arg);
|
||||
void passUnionWithCallback((EventHandler or long) arg);
|
||||
void passUnionWithByteString((ByteString or long) arg);
|
||||
void passUnionWithMozMap((record<DOMString, DOMString> or DOMString) arg);
|
||||
void passUnionWithMozMapAndSequence((record<DOMString, DOMString> or sequence<DOMString>) arg);
|
||||
void passUnionWithSequenceAndMozMap((sequence<DOMString> or record<DOMString, DOMString>) arg);
|
||||
void passUnionWithRecord((record<DOMString, DOMString> or DOMString) arg);
|
||||
void passUnionWithRecordAndSequence((record<DOMString, DOMString> or sequence<DOMString>) arg);
|
||||
void passUnionWithSequenceAndRecord((sequence<DOMString> or record<DOMString, DOMString>) arg);
|
||||
void passUnionWithSVS((USVString or long) arg);
|
||||
#endif
|
||||
void passUnionWithNullable((object? or long) arg);
|
||||
|
@ -557,9 +557,9 @@ interface TestJSImplInterface {
|
|||
|
||||
void passSequenceOfNullableUnions(sequence<(CanvasPattern or CanvasGradient)?> arg);
|
||||
void passVariadicNullableUnion((CanvasPattern or CanvasGradient)?... arg);
|
||||
void passMozMapOfUnions(record<DOMString, (CanvasPattern or CanvasGradient)> arg);
|
||||
void passRecordOfUnions(record<DOMString, (CanvasPattern or CanvasGradient)> arg);
|
||||
// XXXbz no move constructor on some unions
|
||||
// void passMozMapOfUnions2(record<DOMString, (object or long)> arg);
|
||||
// void passRecordOfUnions2(record<DOMString, (object or long)> arg);
|
||||
|
||||
(CanvasPattern or CanvasGradient) receiveUnion();
|
||||
(object or long) receiveUnion2();
|
||||
|
@ -579,7 +579,7 @@ interface TestJSImplInterface {
|
|||
void passOptionalNullableDateWithDefaultValue(optional Date? arg = null);
|
||||
void passDateSequence(sequence<Date> arg);
|
||||
void passNullableDateSequence(sequence<Date?> arg);
|
||||
void passDateMozMap(record<DOMString, Date> arg);
|
||||
void passDateRecord(record<DOMString, Date> arg);
|
||||
Date receiveDate();
|
||||
Date? receiveNullableDate();
|
||||
|
||||
|
@ -618,7 +618,7 @@ interface TestJSImplInterface {
|
|||
Dict? receiveNullableDictionary();
|
||||
void passOtherDictionary(optional GrandparentDict x);
|
||||
void passSequenceOfDictionaries(sequence<Dict> x);
|
||||
void passMozMapOfDictionaries(record<DOMString, GrandparentDict> x);
|
||||
void passRecordOfDictionaries(record<DOMString, GrandparentDict> x);
|
||||
// No support for nullable dictionaries inside a sequence (nor should there be)
|
||||
// void passSequenceOfNullableDictionaries(sequence<Dict?> x);
|
||||
void passDictionaryOrLong(optional Dict x);
|
||||
|
|
|
@ -69,7 +69,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1036214
|
|||
is(t.pingPongDictionary(myDict).innerDictionary.innerObject.answer, "rabbithole", "ping pong works with layered dicts");
|
||||
is(t.pingPongDictionaryOrLong({anyMember: 42}), 42, "ping pong (dict or long) works with dict");
|
||||
is(t.pingPongDictionaryOrLong(42), 42, "ping pong (dict or long) works with long");
|
||||
ok(/canary/.test(t.pingPongMap({ someVal: 42, someOtherVal: "canary" })), "ping pong works with mozmap");
|
||||
ok(/canary/.test(t.pingPongMap({ someVal: 42, someOtherVal: "canary" })), "ping pong works with record");
|
||||
is(t.objectSequenceLength([{}, {}, {}]), 3, "ping pong works with object sequence");
|
||||
is(t.anySequenceLength([42, 'string', {}, undefined]), 4, "ping pong works with any sequence");
|
||||
|
||||
|
@ -99,7 +99,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1036214
|
|||
checkThrows(() => t.pingPongDictionary({ objectOrStringMember: xoObj }), "dictionary pingpong objectorstring");
|
||||
checkThrows(() => t.pingPongDictionaryOrLong({ objectMember: xoObj }), "unionable dictionary");
|
||||
checkThrows(() => t.pingPongDictionaryOrLong({ anyMember: xoObj }), "unionable dictionary");
|
||||
checkThrows(() => t.pingPongMap({ someMember: 42, someOtherMember: {}, crossOriginMember: xoObj }), "mozmap");
|
||||
checkThrows(() => t.pingPongMap({ someMember: 42, someOtherMember: {}, crossOriginMember: xoObj }), "record");
|
||||
checkThrows(() => t.objectSequenceLength([{}, {}, xoObj, {}]), "object sequence");
|
||||
checkThrows(() => t.anySequenceLength([42, 'someString', xoObj, {}]), "any sequence");
|
||||
});
|
||||
|
|
|
@ -20,7 +20,7 @@ class ErrorResult;
|
|||
|
||||
namespace dom {
|
||||
|
||||
template<typename T> class MozMap;
|
||||
template<typename K, typename V> class Record;
|
||||
class HeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord;
|
||||
class OwningHeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord;
|
||||
|
||||
|
|
|
@ -306,7 +306,7 @@ InternalHeaders::Fill(const Sequence<Sequence<nsCString>>& aInit, ErrorResult& a
|
|||
}
|
||||
|
||||
void
|
||||
InternalHeaders::Fill(const MozMap<nsCString>& aInit, ErrorResult& aRv)
|
||||
InternalHeaders::Fill(const Record<nsCString, nsCString>& aInit, ErrorResult& aRv)
|
||||
{
|
||||
for (auto& entry : aInit.Entries()) {
|
||||
Append(NS_ConvertUTF16toUTF8(entry.mKey), entry.mValue, aRv);
|
||||
|
|
|
@ -20,7 +20,7 @@ class ErrorResult;
|
|||
|
||||
namespace dom {
|
||||
|
||||
template<typename T> class MozMap;
|
||||
template<typename K, typename V> class Record;
|
||||
class HeadersEntry;
|
||||
|
||||
class InternalHeaders final
|
||||
|
@ -101,7 +101,7 @@ public:
|
|||
|
||||
void Fill(const InternalHeaders& aInit, ErrorResult& aRv);
|
||||
void Fill(const Sequence<Sequence<nsCString>>& aInit, ErrorResult& aRv);
|
||||
void Fill(const MozMap<nsCString>& aInit, ErrorResult& aRv);
|
||||
void Fill(const Record<nsCString, nsCString>& aInit, ErrorResult& aRv);
|
||||
void FillResponseHeaders(nsIRequest* aRequest);
|
||||
|
||||
bool HasOnlySimpleHeaders() const;
|
||||
|
|
Загрузка…
Ссылка в новой задаче