Bug 1363699 part 2 - Make AnonymousCounterStyle use thread-safe refcount. r?heycam draft
authorXidorn Quan <me@upsuper.org>
Thu, 11 May 2017 15:05:23 +1000
changeset 577606 779d2ca188eec848021a9c2fd28d85f42976e9ad
parent 577605 3fc65aeedfc5f40533e429e1bcec19ecb7e573a6
child 628540 11064b5ff2d8c4802d953f063ecb339e220c51ae
push id58733
push userxquan@mozilla.com
push dateMon, 15 May 2017 03:46:44 +0000
reviewersheycam
bugs1363699
milestone55.0a1
Bug 1363699 part 2 - Make AnonymousCounterStyle use thread-safe refcount. r?heycam Although this is not strictly necessary at the moment, static analysis reports this as a new heap write hazard. Since we would eventually do this change for symbols() support in Stylo, it is easier to just change it here than convincing hazard analysis to believe it is harmless. MozReview-Commit-ID: 7lfyZN6tDnJ
layout/style/CounterStyleManager.h
--- a/layout/style/CounterStyleManager.h
+++ b/layout/style/CounterStyleManager.h
@@ -125,17 +125,17 @@ public:
                                      bool& aIsRTL) override;
 
   virtual AnonymousCounterStyle* AsAnonymous() override { return this; }
 
   bool IsSingleString() const { return mSingleString; }
   uint8_t GetSystem() const { return mSystem; }
   const nsTArray<nsString>& GetSymbols() const { return mSymbols; }
 
-  NS_INLINE_DECL_REFCOUNTING(AnonymousCounterStyle)
+  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AnonymousCounterStyle)
 
 private:
   ~AnonymousCounterStyle() {}
 
   bool mSingleString;
   uint8_t mSystem;
   nsTArray<nsString> mSymbols;
 };