Bug 1444031 - Rename nsStaticAtom::mAtom as mAtomp. r=froydnj draft
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 08 Mar 2018 11:42:06 +1100
changeset 764756 9a217e02dcc8d92ff7a85f49bfaf2e3bfe5ca13a
parent 764755 c99ce1425e9cabd1a0a99240d7949c8f06d69b4e
child 764757 492c576a42549377e4ca06936d9624fdaa15dd8a
push id101838
push usernnethercote@mozilla.com
push dateThu, 08 Mar 2018 08:15:02 +0000
reviewersfroydnj
bugs1444031, 1411469
milestone60.0a1
Bug 1444031 - Rename nsStaticAtom::mAtom as mAtomp. r=froydnj Because (a) that name better indicates that it's a pointer to a pointer, and (b) because nsStaticAtom::mString is going to be renamed as mAtom in bug 1411469. MozReview-Commit-ID: D5tuNOstMgr
dom/base/nsAtomListUtils.cpp
layout/style/nsCSSAnonBoxes.cpp
layout/style/nsCSSPseudoClasses.cpp
layout/style/nsCSSPseudoElements.cpp
xpcom/ds/nsAtomTable.cpp
xpcom/ds/nsStaticAtom.h
--- a/dom/base/nsAtomListUtils.cpp
+++ b/dom/base/nsAtomListUtils.cpp
@@ -14,13 +14,13 @@
 
 /* static */ bool
 nsAtomListUtils::IsMember(nsAtom *aAtom,
                           const nsStaticAtomSetup* aSetup,
                           uint32_t aCount)
 {
     for (const nsStaticAtomSetup *setup = aSetup, *setup_end = aSetup + aCount;
          setup != setup_end; ++setup) {
-        if (aAtom == *(setup->mAtom))
+        if (aAtom == *(setup->mAtomp))
             return true;
     }
     return false;
 }
--- a/layout/style/nsCSSAnonBoxes.cpp
+++ b/layout/style/nsCSSAnonBoxes.cpp
@@ -61,22 +61,22 @@ nsCSSAnonBoxes::IsTreePseudoElement(nsAt
 }
 #endif
 
 /* static*/ nsCSSAnonBoxes::NonInheriting
 nsCSSAnonBoxes::NonInheritingTypeForPseudoTag(nsAtom* aPseudo)
 {
   MOZ_ASSERT(IsNonInheritingAnonBox(aPseudo));
   for (NonInheritingBase i = 0; i < ArrayLength(sCSSAnonBoxAtomSetup); ++i) {
-    if (*sCSSAnonBoxAtomSetup[i].mAtom == aPseudo) {
+    if (*sCSSAnonBoxAtomSetup[i].mAtomp == aPseudo) {
       return static_cast<NonInheriting>(i);
     }
   }
 
   MOZ_CRASH("Bogus pseudo passed to NonInheritingTypeForPseudoTag");
 }
 
 /* static */ nsAtom*
 nsCSSAnonBoxes::GetNonInheritingPseudoAtom(NonInheriting aBoxType)
 {
   MOZ_ASSERT(aBoxType < NonInheriting::_Count);
-  return *sCSSAnonBoxAtomSetup[static_cast<NonInheritingBase>(aBoxType)].mAtom;
+  return *sCSSAnonBoxAtomSetup[static_cast<NonInheritingBase>(aBoxType)].mAtomp;
 }
--- a/layout/style/nsCSSPseudoClasses.cpp
+++ b/layout/style/nsCSSPseudoClasses.cpp
@@ -111,24 +111,24 @@ nsCSSPseudoClasses::HasNthPairArg(Type a
          aType == Type::nthLastOfType;
 }
 
 void
 nsCSSPseudoClasses::PseudoTypeToString(Type aType, nsAString& aString)
 {
   MOZ_ASSERT(aType < Type::Count, "Unexpected type");
   auto idx = static_cast<CSSPseudoClassTypeBase>(aType);
-  (*sCSSPseudoClassAtomSetup[idx].mAtom)->ToString(aString);
+  (*sCSSPseudoClassAtomSetup[idx].mAtomp)->ToString(aString);
 }
 
 /* static */ CSSPseudoClassType
 nsCSSPseudoClasses::GetPseudoType(nsAtom* aAtom, EnabledState aEnabledState)
 {
   for (uint32_t i = 0; i < ArrayLength(sCSSPseudoClassAtomSetup); ++i) {
-    if (*sCSSPseudoClassAtomSetup[i].mAtom == aAtom) {
+    if (*sCSSPseudoClassAtomSetup[i].mAtomp == aAtom) {
       Type type = Type(i);
       return IsEnabled(type, aEnabledState) ? type : Type::NotPseudo;
     }
   }
   return Type::NotPseudo;
 }
 
 /* static */ bool
--- a/layout/style/nsCSSPseudoElements.cpp
+++ b/layout/style/nsCSSPseudoElements.cpp
@@ -78,17 +78,17 @@ nsCSSPseudoElements::IsCSS2PseudoElement
 }
 
 /* static */ CSSPseudoElementType
 nsCSSPseudoElements::GetPseudoType(nsAtom *aAtom, EnabledState aEnabledState)
 {
   for (CSSPseudoElementTypeBase i = 0;
        i < ArrayLength(sCSSPseudoElementAtomSetup);
        ++i) {
-    if (*sCSSPseudoElementAtomSetup[i].mAtom == aAtom) {
+    if (*sCSSPseudoElementAtomSetup[i].mAtomp == aAtom) {
       auto type = static_cast<Type>(i);
       // ::moz-placeholder is an alias for ::placeholder
       if (type == CSSPseudoElementType::mozPlaceholder) {
         type = CSSPseudoElementType::placeholder;
       }
       return IsEnabled(type, aEnabledState) ? type : Type::NotPseudo;
     }
   }
@@ -110,17 +110,17 @@ nsCSSPseudoElements::GetPseudoType(nsAto
   return Type::NotPseudo;
 }
 
 /* static */ nsAtom*
 nsCSSPseudoElements::GetPseudoAtom(Type aType)
 {
   NS_ASSERTION(aType < Type::Count, "Unexpected type");
   return *sCSSPseudoElementAtomSetup[
-    static_cast<CSSPseudoElementTypeBase>(aType)].mAtom;
+    static_cast<CSSPseudoElementTypeBase>(aType)].mAtomp;
 }
 
 /* static */ already_AddRefed<nsAtom>
 nsCSSPseudoElements::GetPseudoAtom(const nsAString& aPseudoElement)
 {
   if (DOMStringIsNull(aPseudoElement) || aPseudoElement.IsEmpty() ||
       aPseudoElement.First() != char16_t(':')) {
     return nullptr;
--- a/xpcom/ds/nsAtomTable.cpp
+++ b/xpcom/ds/nsAtomTable.cpp
@@ -675,17 +675,17 @@ void
 nsAtomTable::RegisterStaticAtoms(const nsStaticAtomSetup* aSetup,
                                  uint32_t aCount)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_RELEASE_ASSERT(!gStaticAtomsDone, "Static atom insertion is finished!");
 
   for (uint32_t i = 0; i < aCount; ++i) {
     const char16_t* string = aSetup[i].mString;
-    nsStaticAtom** atomp = aSetup[i].mAtom;
+    nsStaticAtom** atomp = aSetup[i].mAtomp;
 
     MOZ_ASSERT(nsCRT::IsAscii(string));
 
     uint32_t stringLen = NS_strlen(string);
 
     uint32_t hash;
     AtomTableKey key(string, stringLen, &hash);
     nsAtomSubTable& table = SelectSubTable(key);
--- a/xpcom/ds/nsStaticAtom.h
+++ b/xpcom/ds/nsStaticAtom.h
@@ -108,17 +108,17 @@ class nsStaticAtom;
   { name_##_buffer, reinterpret_cast<nsStaticAtom**>(&class_::name_) },
 
 // Holds data used to initialize large number of atoms during startup. Use
 // NS_STATIC_ATOM_SETUP to initialize these structs. They should never be
 // accessed directly other than from nsAtomTable.cpp.
 struct nsStaticAtomSetup
 {
   const char16_t* const mString;
-  nsStaticAtom** const mAtom;
+  nsStaticAtom** const mAtomp;
 };
 
 // Register an array of static atoms with the atom table.
 template<uint32_t N>
 void
 NS_RegisterStaticAtoms(const nsStaticAtomSetup (&aSetup)[N])
 {
   extern void RegisterStaticAtoms(const nsStaticAtomSetup* aSetup,