Bug 1079324 - Fix some more bad implicit constructors in layout; r=dholbert
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 24 Sep 2014 09:16:53 -0400
changeset 209238 997b35db31217e513cb2d47ea556bd94a0de91a9
parent 209237 38653b50f507926a1a2d8b9f51971e8e9aa8c285
child 209239 ab8c808c0ccb4466e852d034aed8679144a177bb
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersdholbert
bugs1079324
milestone35.0a1
Bug 1079324 - Fix some more bad implicit constructors in layout; r=dholbert
layout/generic/MathMLTextRunFactory.cpp
layout/generic/nsTextFrame.cpp
layout/style/CounterStyleManager.h
layout/style/FontFace.cpp
layout/style/FontFaceSet.h
layout/style/nsStyleStruct.h
--- a/layout/generic/MathMLTextRunFactory.cpp
+++ b/layout/generic/MathMLTextRunFactory.cpp
@@ -190,17 +190,17 @@ static const MathVarMapping gLatinExcept
   { 0x1D551, 0x2124 }
 };
 
 namespace {
 
 struct MathVarMappingWrapper
 {
   const MathVarMapping* const mTable;
-  MathVarMappingWrapper(const MathVarMapping* aTable) : mTable(aTable) {}
+  explicit MathVarMappingWrapper(const MathVarMapping* aTable) : mTable(aTable) {}
   uint32_t operator[](size_t index) const {
     return mTable[index].mKey;
   }
 };
 
 } // namespace
 
 // Finds a MathVarMapping struct with the specified key (aKey) within aTable.
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -121,17 +121,17 @@ struct TabWidthStore {
   nsTArray<TabWidth> mWidths;
 };
 
 namespace {
 
 struct TabwidthAdaptor
 {
   const nsTArray<TabWidth>& mWidths;
-  TabwidthAdaptor(const nsTArray<TabWidth>& aWidths)
+  explicit TabwidthAdaptor(const nsTArray<TabWidth>& aWidths)
     : mWidths(aWidths) {}
   uint32_t operator[](size_t aIdx) const {
     return mWidths[aIdx].mOffset;
   }
 };
 
 } // namespace
 
--- a/layout/style/CounterStyleManager.h
+++ b/layout/style/CounterStyleManager.h
@@ -102,17 +102,17 @@ public:
 
 protected:
   int32_t mStyle;
 };
 
 class AnonymousCounterStyle MOZ_FINAL : public CounterStyle
 {
 public:
-  AnonymousCounterStyle(const nsCSSValue::Array* aValue);
+  explicit AnonymousCounterStyle(const nsCSSValue::Array* aValue);
 
   virtual void GetPrefix(nsAString& aResult) MOZ_OVERRIDE;
   virtual void GetSuffix(nsAString& aResult) MOZ_OVERRIDE;
   virtual bool IsBullet() MOZ_OVERRIDE;
 
   virtual void GetNegative(NegativeType& aResult) MOZ_OVERRIDE;
   virtual bool IsOrdinalInRange(CounterValue aOrdinal) MOZ_OVERRIDE;
   virtual bool IsOrdinalInAutoRange(CounterValue aOrdinal) MOZ_OVERRIDE;
--- a/layout/style/FontFace.cpp
+++ b/layout/style/FontFace.cpp
@@ -23,17 +23,17 @@ namespace dom {
 
 /**
  * An object that wraps a FontFace object and exposes its ArrayBuffer
  * or ArrayBufferView data in a form the user font set can consume.
  */
 class FontFaceBufferSource : public gfxFontFaceBufferSource
 {
 public:
-  FontFaceBufferSource(FontFace* aFontFace)
+  explicit FontFaceBufferSource(FontFace* aFontFace)
     : mFontFace(aFontFace) {}
   virtual void TakeBuffer(uint8_t*& aBuffer, uint32_t& aLength);
 
 private:
   nsRefPtr<FontFace> mFontFace;
 };
 
 void
@@ -66,17 +66,17 @@ GetDataFrom(const T& aObject, uint8_t*& 
  * FontFace object with the source information that was passed to the JS
  * constructor.
  */
 class FontFaceInitializer : public nsIRunnable
 {
 public:
   NS_DECL_ISUPPORTS
 
-  FontFaceInitializer(FontFace* aFontFace)
+  explicit FontFaceInitializer(FontFace* aFontFace)
     : mFontFace(aFontFace)
     , mSourceBuffer(nullptr)
     , mSourceBufferLength(0) {}
 
   void SetSource(const nsAString& aString);
   void SetSource(const ArrayBuffer& aArrayBuffer);
   void SetSource(const ArrayBufferView& aArrayBufferView);
 
--- a/layout/style/FontFaceSet.h
+++ b/layout/style/FontFaceSet.h
@@ -47,17 +47,17 @@ public:
    * collector).  So UserFontSet exists just to override the needed virtual
    * methods from gfxUserFontSet and to forward them on FontFaceSet.
    */
   class UserFontSet MOZ_FINAL : public gfxUserFontSet
   {
     friend class FontFaceSet;
 
   public:
-    UserFontSet(FontFaceSet* aFontFaceSet)
+    explicit UserFontSet(FontFaceSet* aFontFaceSet)
       : mFontFaceSet(aFontFaceSet)
     {
     }
 
     FontFaceSet* GetFontFaceSet() { return mFontFaceSet; }
 
     virtual nsresult CheckFontLoad(const gfxFontFaceSrc* aFontFaceSrc,
                                    nsIPrincipal** aPrincipal,
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -2831,17 +2831,17 @@ class nsStyleBasicShape MOZ_FINAL {
 public:
   enum Type {
     // eInset,
     // eCircle,
     // eEllipse,
     ePolygon
   };
 
-  nsStyleBasicShape(Type type)
+  explicit nsStyleBasicShape(Type type)
     : mType(type)
   {
   }
 
   Type GetShapeType() const { return mType; }
 
   int32_t GetFillRule() const { return mFillRule; }
   void SetFillRule(int32_t aFillRule)