4848// nsGkAtomList.h is generated by StaticAtoms.py and has entries that look
4949// like this:
5050//
51- // GK_ATOM(one, "one", nsStaticAtom, Atom)
52- // GK_ATOM(two, "two", nsICSSPseudoElement, PseudoElementAtom)
53- // GK_ATOM(three, "three", nsICSSAnonBoxPseudo, InheritingAnonBoxAtom)
51+ // GK_ATOM(one, "one", 0x01234567, nsStaticAtom, Atom)
52+ // GK_ATOM(two, "two", 0x12345678, nsICSSPseudoElement, PseudoElementAtom)
53+ // GK_ATOM(three, "three", 0x23456789, nsICSSAnonBoxPseudo, InheritingAnonBoxAtom)
5454//
5555// After macro expansion, the atom definitions look like the following:
5656//
120120// // The initialization of the atoms themselves.
121121// nsStaticAtom(
122122// u"one", 3,
123+ // 0x01234567,
123124// offsetof(GkAtoms, mAtoms[static_cast<size_t>(GkAtoms::Atoms::one)]) -
124125// offsetof(GkAtoms, one_string)),
125126// nsStaticAtom(
126127// u"two", 3,
128+ // 0x12345678,
127129// offsetof(GkAtoms, mAtoms[static_cast<size_t>(GkAtoms::Atoms::two)]) -
128130// offsetof(GkAtoms, two_string)),
129131// nsStaticAtom(
130132// u"three", 3,
133+ // 0x23456789,
131134// offsetof(GkAtoms, mAtoms[static_cast<size_t>(GkAtoms::Atoms::three)]) -
132135// offsetof(GkAtoms, three_string)),
133136// }
156159
157160// Trivial subclasses of nsStaticAtom so that function signatures can require
158161// an atom from a specific atom list.
159- #define DEFINE_STATIC_ATOM_SUBCLASS (name_ ) \
160- class name_ : public nsStaticAtom \
161- { \
162- public: \
163- constexpr name_ (const char16_t * aStr, uint32_t aLength, uint32_t aOffset) \
164- : nsStaticAtom(aStr, aLength, aOffset) {} \
162+ #define DEFINE_STATIC_ATOM_SUBCLASS (name_ ) \
163+ class name_ : public nsStaticAtom \
164+ { \
165+ public: \
166+ constexpr name_ (const char16_t * aStr, uint32_t aLength, \
167+ uint32_t aHash, uint32_t aOffset) \
168+ : nsStaticAtom(aStr, aLength, aHash, aOffset) {} \
165169 };
166170
167171DEFINE_STATIC_ATOM_SUBCLASS (nsICSSAnonBoxPseudo)
@@ -181,14 +185,14 @@ namespace detail {
181185struct GkAtoms
182186{
183187 // The declaration of each atom's string.
184- #define GK_ATOM (name_, value_, type_, atom_type_ ) \
188+ #define GK_ATOM (name_, value_, hash_, type_, atom_type_ ) \
185189 const char16_t name_##_string[sizeof (value_)];
186190 #include " nsGkAtomList.h"
187191 #undef GK_ATOM
188192
189193 // The enum value for each atom.
190194 enum class Atoms {
191- #define GK_ATOM (name_, value_, type_, atom_type_ ) \
195+ #define GK_ATOM (name_, value_, hash_, type_, atom_type_ ) \
192196 name_,
193197 #include " nsGkAtomList.h"
194198 #undef GK_ATOM
@@ -221,7 +225,7 @@ class nsGkAtoms
221225 //
222226 // XXX: Eventually this should be combined with its definition and the
223227 // pointer should be made `constexpr`. See bug 1449787.
224- #define GK_ATOM (name_, value_, type_, atom_type_ ) \
228+ #define GK_ATOM (name_, value_, hash_, type_, atom_type_ ) \
225229 static type_* name_;
226230 #include " nsGkAtomList.h"
227231 #undef GK_ATOM
0 commit comments