--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -51,17 +51,17 @@ def mayUseXrayExpandoSlots(descriptor, a
def toStringBool(arg):
"""
Converts IDL/Python Boolean (True/False) to C++ Boolean (true/false)
"""
return str(not not arg).lower()
def toBindingNamespace(arg):
- return arg + "Binding"
+ return arg + "_Binding"
def isTypeCopyConstructible(type):
# Nullable and sequence stuff doesn't affect copy-constructibility
type = type.unroll()
return (type.isPrimitive() or type.isString() or type.isEnum() or
(type.isUnion() and
CGUnionStruct.isUnionCopyConstructible(type)) or
@@ -1738,24 +1738,24 @@ class CGClassFinalizeHook(CGAbstractClas
def generate_code(self):
return finalizeHook(self.descriptor, self.name,
self.args[0].name, self.args[1].name).define()
def objectMovedHook(descriptor, hookName, obj, old):
assert descriptor.wrapperCache
return fill("""
- if (self) {
- UpdateWrapper(self, self, ${obj}, ${old});
- }
-
- return 0;
- """,
- obj=obj,
- old=old)
+ if (self) {
+ UpdateWrapper(self, self, ${obj}, ${old});
+ }
+
+ return 0;
+ """,
+ obj=obj,
+ old=old)
class CGClassObjectMovedHook(CGAbstractClassHook):
"""
A hook for objectMovedOp, used to update the wrapper cache when an object it
is holding moves.
"""
def __init__(self, descriptor):
@@ -13633,23 +13633,23 @@ class CGRegisterGlobalNames(CGAbstractMe
CGAbstractMethod.__init__(self, None, 'RegisterWebIDLGlobalNames',
'void', [])
self.config = config
def definition_body(self):
def getCheck(desc):
if not desc.isExposedConditionally():
return "nullptr"
- return "%sBinding::ConstructorEnabled" % desc.name
+ return "%s_Binding::ConstructorEnabled" % desc.name
define = ""
currentOffset = 0
for (name, desc) in getGlobalNames(self.config):
length = len(name)
- define += "WebIDLGlobalNameHash::Register(%i, %i, %sBinding::CreateInterfaceObjects, %s, constructors::id::%s);\n" % (
+ define += "WebIDLGlobalNameHash::Register(%i, %i, %s_Binding::CreateInterfaceObjects, %s, constructors::id::%s);\n" % (
currentOffset, length, desc.name, getCheck(desc), desc.name)
currentOffset += length + 1 # Add trailing null.
return define
def dependencySortObjects(objects, dependencyGetter, nameGetter):
"""
Sort IDL objects with dependencies on each other such that if A
@@ -14912,17 +14912,17 @@ class CGExampleClass(CGBindingImplClass)
else:
reflectorArg = ", JS::MutableHandle<JSObject*> aReflector"
reflectorPassArg = ", aReflector"
returnType = "bool"
classImpl = ccImpl + ctordtor + "\n" + dedent("""
${returnType}
${nativeType}::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto${reflectorArg})
{
- return ${ifaceName}Binding::Wrap(aCx, this, aGivenProto${reflectorPassArg});
+ return ${ifaceName}_Binding::Wrap(aCx, this, aGivenProto${reflectorPassArg});
}
""")
return string.Template(classImpl).substitute(
ifaceName=self.descriptor.name,
nativeType=self.nativeLeafName(self.descriptor),
parentType=self.nativeLeafName(self.parentDesc) if self.parentIface else "",
returnType=returnType,
@@ -15328,17 +15328,17 @@ class CGJSImplClass(CGBindingImplClass):
methods=self.methodDecls,
decorators=decorators,
extradeclarations=extradeclarations,
extradefinitions=extradefinitions)
def getWrapObjectBody(self):
return fill(
"""
- JS::Rooted<JSObject*> obj(aCx, ${name}Binding::Wrap(aCx, this, aGivenProto));
+ JS::Rooted<JSObject*> obj(aCx, ${name}_Binding::Wrap(aCx, this, aGivenProto));
if (!obj) {
return nullptr;
}
// Now define it on our chrome object
JSAutoRealm ar(aCx, mImpl->CallbackOrNull());
if (!JS_WrapObject(aCx, &obj)) {
return nullptr;
@@ -16848,17 +16848,17 @@ class CGIterableMethodGenerator(CGGeneri
""",
ifaceName=descriptor.interface.identifier.name))
return
CGGeneric.__init__(self, fill(
"""
typedef ${iterClass} itrType;
RefPtr<itrType> result(new itrType(self,
itrType::IterableIteratorType::${itrMethod},
- &${ifaceName}IteratorBinding::Wrap));
+ &${ifaceName}Iterator_Binding::Wrap));
""",
iterClass=iteratorNativeType(descriptor),
ifaceName=descriptor.interface.identifier.name,
itrMethod=methodName.title()))
class GlobalGenRoots():
"""
@@ -17141,22 +17141,22 @@ class GlobalGenRoots():
curr = CGIncludeGuard('RegisterWorkletBindings', curr)
# Done.
return curr
@staticmethod
def ResolveSystemBinding(config):
curr = CGList([], "\n")
-
+
descriptors = config.getDescriptors(hasInterfaceObject=True,
isExposedInSystemGlobals=True,
register=True)
properties = [desc.name for desc in descriptors]
-
+
curr.append(CGStringTable("IdString", properties, static=True))
initValues = []
for desc in descriptors:
bindingNS = toBindingNamespace(desc.name)
if desc.isExposedConditionally():
enabled = "%s::ConstructorEnabled" % bindingNS
else:
@@ -17165,17 +17165,17 @@ class GlobalGenRoots():
initValues.append("{ %s, %s },\n" % (enabled, define))
curr.append(CGGeneric(fill("""
struct SystemProperty
{
WebIDLGlobalNameHash::ConstructorEnabled enabled;
ProtoGetter define;
PinnedStringId id;
};
-
+
static SystemProperty properties[] = {
$*{init}
};
static bool idsInited = false;
""",
init="".join(initValues))))
@@ -17630,17 +17630,17 @@ class CGEventClass(CGBindingImplClass):
CGClass.__init__(self, className,
bases=[ClassBase(self.parentType)],
methods=extraMethods+self.methodDecls,
members=members,
extradeclarations=baseDeclarations)
def getWrapObjectBody(self):
- return "return %sBinding::Wrap(aCx, this, aGivenProto);\n" % self.descriptor.name
+ return "return %s_Binding::Wrap(aCx, this, aGivenProto);\n" % self.descriptor.name
def needCC(self):
return (len(self.membersNeedingCC) != 0 or
len(self.membersNeedingTrace) != 0)
def implTraverse(self):
retVal = ""
for m in self.membersNeedingCC: