Bug 958576 part 1. Create a binding_detail namespace and move AutoSequence to it. r=peterv

Note that we can't name this namespace "detail", because then we'd
have both ::mozilla::detail and ::mozilla::dom::detail namespaces in
the tree and various template name lookups that look for "detail::Foo"
would get confused, and the code would not compile.  C++ strikes
again.
This commit is contained in:
Boris Zbarsky 2014-01-22 14:37:10 -05:00
Родитель b35c1e7891
Коммит 5052fd5d63
4 изменённых файлов: 11 добавлений и 6 удалений

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

@ -2943,7 +2943,8 @@ CanvasRenderingContext2D::SetMozDashOffset(double mozDashOffset)
} }
void void
CanvasRenderingContext2D::SetLineDash(const mozilla::dom::AutoSequence<double>& aSegments) { CanvasRenderingContext2D::SetLineDash(const Sequence<double>& aSegments)
{
FallibleTArray<mozilla::gfx::Float>& dash = CurrentState().dash; FallibleTArray<mozilla::gfx::Float>& dash = CurrentState().dash;
dash.Clear(); dash.Clear();

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

@ -338,7 +338,7 @@ public:
void SetMozDash(JSContext* cx, const JS::Value& mozDash, void SetMozDash(JSContext* cx, const JS::Value& mozDash,
mozilla::ErrorResult& error); mozilla::ErrorResult& error);
void SetLineDash(const mozilla::dom::AutoSequence<double>& mSegments); void SetLineDash(const Sequence<double>& mSegments);
void GetLineDash(nsTArray<double>& mSegments) const; void GetLineDash(nsTArray<double>& mSegments) const;
void SetLineDashOffset(double mOffset); void SetLineDashOffset(double mOffset);

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

@ -1597,6 +1597,8 @@ template<typename T>
void DoTraceSequence(JSTracer* trc, InfallibleTArray<T>& seq); void DoTraceSequence(JSTracer* trc, InfallibleTArray<T>& seq);
// Class for simple sequence arguments, only used internally by codegen. // Class for simple sequence arguments, only used internally by codegen.
namespace binding_detail {
template<typename T> template<typename T>
class AutoSequence : public AutoFallibleTArray<T, 16> class AutoSequence : public AutoFallibleTArray<T, 16>
{ {
@ -1610,6 +1612,8 @@ public:
} }
}; };
} // namespace binding_detail
// Class used to trace sequences, with specializations for various // Class used to trace sequences, with specializations for various
// sequence types. // sequence types.
template<typename T, template<typename T,

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

@ -3030,7 +3030,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
if isMember or isOptional or nullable or isCallbackReturnValue: if isMember or isOptional or nullable or isCallbackReturnValue:
sequenceClass = "Sequence" sequenceClass = "Sequence"
else: else:
sequenceClass = "AutoSequence" sequenceClass = "binding_detail::AutoSequence"
# XXXbz we can't include the index in the the sourceDescription, because # XXXbz we can't include the index in the the sourceDescription, because
# we don't really have a way to pass one in dynamically at runtime... # we don't really have a way to pass one in dynamically at runtime...
@ -3832,7 +3832,7 @@ for (uint32_t i = 0; i < length; ++i) {
# Since we're not a member and not nullable or optional, no one will # Since we're not a member and not nullable or optional, no one will
# see our real type, so we can do the fast version of the dictionary # see our real type, so we can do the fast version of the dictionary
# that doesn't pre-initialize members. # that doesn't pre-initialize members.
typeName = "dictionary_detail::Fast" + typeName typeName = "binding_detail::Fast" + typeName
declType = CGGeneric(typeName) declType = CGGeneric(typeName)
@ -4170,7 +4170,7 @@ class CGArgumentConverter(CGThing):
raise TypeError("Shouldn't need holders for variadics") raise TypeError("Shouldn't need holders for variadics")
replacer = dict(self.argcAndIndex, **self.replacementVariables) replacer = dict(self.argcAndIndex, **self.replacementVariables)
replacer["seqType"] = CGTemplatedType("AutoSequence", replacer["seqType"] = CGTemplatedType("binding_detail::AutoSequence",
typeConversion.declType).define() typeConversion.declType).define()
if typeNeedsRooting(self.argument.type): if typeNeedsRooting(self.argument.type):
rooterDecl = ("SequenceRooter<%s> ${holderName}(cx, &${declName});\n" % rooterDecl = ("SequenceRooter<%s> ${holderName}(cx, &${declName});\n" %
@ -9258,7 +9258,7 @@ if (""",
isStruct=True) isStruct=True)
return CGList([struct, return CGList([struct,
CGNamespace.build(['dictionary_detail'], CGNamespace.build(['binding_detail'],
fastStruct)], fastStruct)],
"\n") "\n")