Bug 1188721 - Part 18: Remove unused ns{Inherited,Reset}StyleData::ClearStyleData. r?dbaron draft
authorCameron McCormack <cam@mcc.id.au>
Wed, 23 Mar 2016 17:36:00 +1100
changeset 343768 9209a7d7ddce3c20e3eabbfc4961a4f09ae6c19f
parent 343767 200210f1b5893cb08dba7ae490bb501c9d7454b3
child 343769 7230684111ca3c939b3d22c0ed1f134600a52c1d
push id13680
push usercmccormack@mozilla.com
push dateWed, 23 Mar 2016 06:36:18 +0000
reviewersdbaron
bugs1188721
milestone48.0a1
Bug 1188721 - Part 18: Remove unused ns{Inherited,Reset}StyleData::ClearStyleData. r?dbaron MozReview-Commit-ID: 5U5HxaFiWu
layout/style/nsRuleNode.h
--- a/layout/style/nsRuleNode.h
+++ b/layout/style/nsRuleNode.h
@@ -39,22 +39,16 @@ public:
   void SetStyleData(nsStyleStructID aSID, nsStyleStruct* aStyleStruct) {
     MOZ_ASSERT(aStyleStruct);
     if (mStyleStructs[aSID] != aStyleStruct) {
       NS_ASSERTION(!mStyleStructs[aSID], "Going to leak style data");
       aStyleStruct->AddRef();
       mStyleStructs[aSID] = aStyleStruct;
     }
   }
-  bool ClearStyleData(nsStyleStructID aSID) {
-    bool shouldDelete = mStyleStructs[aSID] &&
-                        mStyleStructs[aSID]->ReleaseWithoutDestroying() == 0;
-    mStyleStructs[aSID] = nullptr;
-    return shouldDelete;
-  }
   bool ReplaceStyleData(nsStyleStructID aSID, nsStyleStruct* aStyleStruct) {
     MOZ_ASSERT(aStyleStruct);
     nsStyleStruct* old = mStyleStructs[aSID];
     aStyleStruct->AddRef();
     mStyleStructs[aSID] = aStyleStruct;
     return old && old->ReleaseWithoutDestroying() == 0;
   }
 
@@ -106,22 +100,16 @@ public:
   void SetStyleData(nsStyleStructID aSID, nsStyleStruct* aStyleStruct) {
     MOZ_ASSERT(aStyleStruct);
     if (mStyleStructs[aSID] != aStyleStruct) {
       NS_ASSERTION(!mStyleStructs[aSID], "Going to leak style data");
       aStyleStruct->AddRef();
       mStyleStructs[aSID] = aStyleStruct;
     }
   }
-  bool ClearStyleData(nsStyleStructID aSID) {
-    bool shouldDelete = mStyleStructs[aSID] &&
-                        mStyleStructs[aSID]->ReleaseWithoutDestroying() == 0;
-    mStyleStructs[aSID] = nullptr;
-    return shouldDelete;
-  }
   bool ReplaceStyleData(nsStyleStructID aSID, nsStyleStruct* aStyleStruct) {
     MOZ_ASSERT(aStyleStruct);
     nsStyleStruct* old = mStyleStructs[aSID];
     aStyleStruct->AddRef();
     mStyleStructs[aSID] = aStyleStruct;
     return old && old->ReleaseWithoutDestroying() == 0;
   }