Bug 1316290 - Use 'auto' type specifier for some variable decls that are assigned to "new", in /layout. r=dholbert
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Wed, 09 Nov 2016 15:34:49 +0200
changeset 352274 aa3568c773f5e6fc5c8d9313bc7df5d3a425fdee
parent 352273 8b045b23dd94b54b385ad7cca335b79b87f91f42
child 352275 b1e344ef212dbd4ba46c082d7840babc9a55f685
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1316290
milestone52.0a1
Bug 1316290 - Use 'auto' type specifier for some variable decls that are assigned to "new", in /layout. r=dholbert MozReview-Commit-ID: hEBEzzmMlC
layout/base/nsRefreshDriver.cpp
layout/style/nsCSSRuleProcessor.cpp
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -2232,18 +2232,18 @@ nsRefreshDriver::SetThrottled(bool aThro
   }
 }
 
 /*static*/ void
 nsRefreshDriver::PVsyncActorCreated(VsyncChild* aVsyncChild)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!XRE_IsParentProcess());
-  VsyncRefreshDriverTimer* vsyncRefreshDriverTimer =
-                           new VsyncRefreshDriverTimer(aVsyncChild);
+  auto* vsyncRefreshDriverTimer =
+      new VsyncRefreshDriverTimer(aVsyncChild);
 
   // If we are using software timer, swap current timer to
   // VsyncRefreshDriverTimer.
   if (sRegularRateTimer) {
     sRegularRateTimer->SwapRefreshDrivers(vsyncRefreshDriverTimer);
     delete sRegularRateTimer;
   }
   sRegularRateTimer = vsyncRefreshDriverTimer;
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -274,17 +274,17 @@ RuleHash_ClearEntry(PLDHashTable *table,
 static void
 RuleHash_MoveEntry(PLDHashTable *table, const PLDHashEntryHdr *from,
                    PLDHashEntryHdr *to)
 {
   NS_PRECONDITION(from != to, "This is not going to work!");
   RuleHashTableEntry *oldEntry =
     const_cast<RuleHashTableEntry*>(
       static_cast<const RuleHashTableEntry*>(from));
-  RuleHashTableEntry *newEntry = new (KnownNotNull, to) RuleHashTableEntry();
+  auto* newEntry = new (KnownNotNull, to) RuleHashTableEntry();
   newEntry->mRules.SwapElements(oldEntry->mRules);
   oldEntry->~RuleHashTableEntry();
 }
 
 static bool
 RuleHash_TagTable_MatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   nsIAtom *match_atom = const_cast<nsIAtom*>(static_cast<const nsIAtom*>(key));
@@ -311,17 +311,17 @@ RuleHash_TagTable_ClearEntry(PLDHashTabl
 static void
 RuleHash_TagTable_MoveEntry(PLDHashTable *table, const PLDHashEntryHdr *from,
                             PLDHashEntryHdr *to)
 {
   NS_PRECONDITION(from != to, "This is not going to work!");
   RuleHashTagTableEntry *oldEntry =
     const_cast<RuleHashTagTableEntry*>(
       static_cast<const RuleHashTagTableEntry*>(from));
-  RuleHashTagTableEntry *newEntry = new (KnownNotNull, to) RuleHashTagTableEntry();
+  auto* newEntry = new (KnownNotNull, to) RuleHashTagTableEntry();
   newEntry->mTag.swap(oldEntry->mTag);
   newEntry->mRules.SwapElements(oldEntry->mRules);
   oldEntry->~RuleHashTagTableEntry();
 }
 
 static PLDHashNumber
 RuleHash_NameSpaceTable_HashKey(const void *key)
 {
@@ -801,17 +801,17 @@ AtomSelector_InitEntry(PLDHashEntryHdr *
 
 static void
 AtomSelector_MoveEntry(PLDHashTable *table, const PLDHashEntryHdr *from,
                        PLDHashEntryHdr *to)
 {
   NS_PRECONDITION(from != to, "This is not going to work!");
   AtomSelectorEntry *oldEntry =
     const_cast<AtomSelectorEntry*>(static_cast<const AtomSelectorEntry*>(from));
-  AtomSelectorEntry *newEntry = new (KnownNotNull, to) AtomSelectorEntry();
+  auto* newEntry = new (KnownNotNull, to) AtomSelectorEntry();
   newEntry->mAtom = oldEntry->mAtom;
   newEntry->mSelectors.SwapElements(oldEntry->mSelectors);
   oldEntry->~AtomSelectorEntry();
 }
 
 static bool
 AtomSelector_CIMatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
@@ -3601,17 +3601,17 @@ CascadeRuleEnumFunc(css::Rule* aRule, vo
       int32_t weight = sel->mWeight;
       auto entry = static_cast<RuleByWeightEntry*>
         (data->mRulesByWeight.Add(NS_INT32_TO_PTR(weight), fallible));
       if (!entry)
         return false;
       entry->data.mWeight = weight;
       // entry->data.mRuleSelectorPairs should be linked in forward order;
       // entry->data.mTail is the slot to write to.
-      PerWeightDataListItem *newItem =
+      auto* newItem =
         new (data->mArena) PerWeightDataListItem(styleRule, sel->mSelectors);
       if (newItem) {
         *(entry->data.mTail) = newItem;
         entry->data.mTail = &newItem->mNext;
       }
     }
   }
   else if (css::Rule::MEDIA_RULE == type ||