Bug 1061009 - Fix more bad implicit constructors in a11y; r=tbsaunde
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 02 Sep 2014 12:19:58 -0400
changeset 226308 1116b6fce5f523ba4a02fb8a4381e6bcacef48a1
parent 226307 99663b08ee351dcc3e3f52ab77cfa2eb153d79a9
child 226309 2c760e1690b51802dca2c574fd304653d35f4007
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs1061009
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1061009 - Fix more bad implicit constructors in a11y; r=tbsaunde
accessible/base/ARIAMap.h
accessible/base/AccCollector.h
accessible/base/AccIterator.h
accessible/base/EventQueue.h
accessible/base/NotificationController.h
accessible/base/Relation.h
accessible/base/TextAttrs.h
accessible/base/nsAccessiblePivot.cpp
accessible/base/nsAccessiblePivot.h
accessible/xpcom/xpcAccessibleTable.h
accessible/xpcom/xpcAccessibleTableCell.h
accessible/xpcom/xpcAccessibleTextRange.h
--- a/accessible/base/ARIAMap.h
+++ b/accessible/base/ARIAMap.h
@@ -229,17 +229,17 @@ uint8_t AttrCharacteristicsFor(nsIAtom* 
 
  /**
   * Represents a simple enumerator for iterating through ARIA attributes 
   * exposed as object attributes on a given accessible. 
   */
 class AttrIterator
 {
 public:
-  AttrIterator(nsIContent* aContent) : 
+  explicit AttrIterator(nsIContent* aContent) : 
     mContent(aContent), mAttrIdx(0) 
   { 
     mAttrCount = mContent->GetAttrCount();
   }
 
   bool Next(nsAString& aAttrName, nsAString& aAttrValue);
 
 private:
--- a/accessible/base/AccCollector.h
+++ b/accessible/base/AccCollector.h
@@ -76,17 +76,17 @@ class EmbeddedObjCollector MOZ_FINAL : p
 public:
   virtual ~EmbeddedObjCollector() { }
 
 public:
   virtual int32_t GetIndexAt(Accessible* aAccessible);
 
 protected:
   // Make sure it's used by Accessible class only.
-  EmbeddedObjCollector(Accessible* aRoot) :
+  explicit EmbeddedObjCollector(Accessible* aRoot) :
     AccCollector(aRoot, filters::GetEmbeddedObject) { }
 
   virtual void AppendObject(Accessible* aAccessible);
 
   friend class Accessible;
 };
 
 } // namespace a11y
--- a/accessible/base/AccIterator.h
+++ b/accessible/base/AccIterator.h
@@ -47,17 +47,17 @@ public:
 
 private:
   AccIterator();
   AccIterator(const AccIterator&);
   AccIterator& operator =(const AccIterator&);
 
   struct IteratorState
   {
-    IteratorState(Accessible* aParent, IteratorState* mParentState = nullptr);
+    explicit IteratorState(Accessible* aParent, IteratorState* mParentState = nullptr);
 
     Accessible* mParent;
     int32_t mIndex;
     IteratorState* mParentState;
   };
 
   filters::FilterFuncPtr mFilterFunc;
   IteratorState* mState;
@@ -249,17 +249,17 @@ private:
 
 /**
  * Iterator that points to a single accessible returning it on the first call
  * to Next().
  */
 class SingleAccIterator : public AccIterable
 {
 public:
-  SingleAccIterator(Accessible* aTarget): mAcc(aTarget) { }
+  explicit SingleAccIterator(Accessible* aTarget): mAcc(aTarget) { }
   virtual ~SingleAccIterator() { }
 
   virtual Accessible* Next();
 
 private:
   SingleAccIterator();
   SingleAccIterator(const SingleAccIterator&);
   SingleAccIterator& operator = (const SingleAccIterator&);
@@ -269,17 +269,17 @@ private:
 
 
 /**
  * Used to iterate items of the given item container.
  */
 class ItemIterator : public AccIterable
 {
 public:
-  ItemIterator(Accessible* aItemContainer) :
+  explicit ItemIterator(Accessible* aItemContainer) :
     mContainer(aItemContainer), mAnchor(nullptr) { }
   virtual ~ItemIterator() { }
 
   virtual Accessible* Next();
 
 private:
   ItemIterator() MOZ_DELETE;
   ItemIterator(const ItemIterator&) MOZ_DELETE;
--- a/accessible/base/EventQueue.h
+++ b/accessible/base/EventQueue.h
@@ -14,17 +14,17 @@ namespace a11y {
 class DocAccessible;
 
 /**
  * Used to organize and coalesce pending events.
  */
 class EventQueue
 {
 protected:
-  EventQueue(DocAccessible* aDocument) : mDocument(aDocument) { }
+  explicit EventQueue(DocAccessible* aDocument) : mDocument(aDocument) { }
 
   /**
    * Put an accessible event into the queue to process it later.
    */
   bool PushEvent(AccEvent* aEvent);
 
   /**
    * Process events from the queue and fires events.
--- a/accessible/base/NotificationController.h
+++ b/accessible/base/NotificationController.h
@@ -270,18 +270,18 @@ private:
 
   template<class T>
   class nsCOMPtrHashKey : public PLDHashEntryHdr
   {
   public:
     typedef T* KeyType;
     typedef const T* KeyTypePointer;
 
-    nsCOMPtrHashKey(const T* aKey) : mKey(const_cast<T*>(aKey)) {}
-    nsCOMPtrHashKey(const nsPtrHashKey<T> &aToCopy) : mKey(aToCopy.mKey) {}
+    explicit nsCOMPtrHashKey(const T* aKey) : mKey(const_cast<T*>(aKey)) {}
+    explicit nsCOMPtrHashKey(const nsPtrHashKey<T> &aToCopy) : mKey(aToCopy.mKey) {}
     ~nsCOMPtrHashKey() { }
 
     KeyType GetKey() const { return mKey; }
     bool KeyEquals(KeyTypePointer aKey) const { return aKey == mKey; }
 
     static KeyTypePointer KeyToPointer(KeyType aKey) { return aKey; }
     static PLDHashNumber HashKey(KeyTypePointer aKey)
       { return NS_PTR_TO_INT32(aKey) >> 2; }
--- a/accessible/base/Relation.h
+++ b/accessible/base/Relation.h
@@ -18,20 +18,20 @@ namespace a11y {
  * A collection of relation targets of a certain type.  Targets are computed
  * lazily while enumerating.
  */
 class Relation
 {
 public:
   Relation() : mFirstIter(nullptr), mLastIter(nullptr) { }
 
-  Relation(AccIterable* aIter) :
+  explicit Relation(AccIterable* aIter) :
     mFirstIter(aIter), mLastIter(aIter) { }
 
-  Relation(Accessible* aAcc) :
+  explicit Relation(Accessible* aAcc) :
     mFirstIter(nullptr), mLastIter(nullptr)
     { AppendTarget(aAcc); }
 
   Relation(DocAccessible* aDocument, nsIContent* aContent) :
     mFirstIter(nullptr), mLastIter(nullptr)
     { AppendTarget(aDocument, aContent); }
 
   Relation(Relation&& aOther) :
--- a/accessible/base/TextAttrs.h
+++ b/accessible/base/TextAttrs.h
@@ -29,17 +29,17 @@ class HyperTextAccessible;
  *       HyperTextAccessible class.
  */
 class TextAttrsMgr
 {
 public:
   /**
    * Constructor. Used to expose default text attributes.
    */
-  TextAttrsMgr(HyperTextAccessible* aHyperTextAcc) :
+  explicit TextAttrsMgr(HyperTextAccessible* aHyperTextAcc) :
     mOffsetAcc(nullptr),  mHyperTextAcc(aHyperTextAcc),
     mOffsetAccIdx(-1), mIncludeDefAttrs(true) { }
 
   /**
    * Constructor. Used to expose text attributes at the given offset.
    *
    * @param aHyperTextAcc    [in] hyper text accessible text attributes are
    *                          calculated for
@@ -121,17 +121,17 @@ protected:
 
   /**
    * Base class to work with text attributes. See derived classes below.
    */
   template<class T>
   class TTextAttr : public TextAttr
   {
   public:
-    TTextAttr(bool aGetRootValue) : mGetRootValue(aGetRootValue) {}
+    explicit TTextAttr(bool aGetRootValue) : mGetRootValue(aGetRootValue) {}
 
     // TextAttr
     virtual void Expose(nsIPersistentProperties* aAttributes,
                         bool aIncludeDefAttrValue)
     {
       if (mGetRootValue) {
         if (mIsRootDefined)
           ExposeValue(aAttributes, mRootNativeValue);
@@ -388,17 +388,17 @@ protected:
    * "text-line-through-style", "text-line-through-color",
    * "text-underline-style" and "text-underline-color" text attributes.
    */
 
   class TextDecorValue
   {
   public:
     TextDecorValue() { }
-    TextDecorValue(nsIFrame* aFrame);
+    explicit TextDecorValue(nsIFrame* aFrame);
 
     nscolor Color() const { return mColor; }
     uint8_t Style() const { return mStyle; }
 
     bool IsDefined() const
       { return IsUnderline() || IsLineThrough(); }
     bool IsUnderline() const
       { return mLine & NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE; }
--- a/accessible/base/nsAccessiblePivot.cpp
+++ b/accessible/base/nsAccessiblePivot.cpp
@@ -14,18 +14,18 @@ using namespace mozilla::a11y;
 
 
 /**
  * An object that stores a given traversal rule during the pivot movement.
  */
 class RuleCache
 {
 public:
-  RuleCache(nsIAccessibleTraversalRule* aRule) : mRule(aRule),
-                                                 mAcceptRoles(nullptr) { }
+  explicit RuleCache(nsIAccessibleTraversalRule* aRule) : mRule(aRule),
+                                                          mAcceptRoles(nullptr) { }
   ~RuleCache () {
     if (mAcceptRoles)
       nsMemory::Free(mAcceptRoles);
   }
 
   nsresult ApplyFilter(Accessible* aAccessible, uint16_t* aResult);
 
 private:
--- a/accessible/base/nsAccessiblePivot.h
+++ b/accessible/base/nsAccessiblePivot.h
@@ -20,17 +20,17 @@ class RuleCache;
 /**
  * Class represents an accessible pivot.
  */
 class nsAccessiblePivot MOZ_FINAL : public nsIAccessiblePivot
 {
 public:
   typedef mozilla::a11y::Accessible Accessible;
 
-  nsAccessiblePivot(Accessible* aRoot);
+  explicit nsAccessiblePivot(Accessible* aRoot);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsAccessiblePivot, nsIAccessiblePivot)
 
   NS_DECL_NSIACCESSIBLEPIVOT
 
   /*
    * A simple getter for the pivot's position.
--- a/accessible/xpcom/xpcAccessibleTable.h
+++ b/accessible/xpcom/xpcAccessibleTable.h
@@ -16,17 +16,17 @@ class nsIArray;
 namespace mozilla {
 namespace a11y {
 
 class TableAccessible;
 
 class xpcAccessibleTable
 {
 public:
-  xpcAccessibleTable(mozilla::a11y::TableAccessible* aTable) : mTable(aTable) { }
+  explicit xpcAccessibleTable(mozilla::a11y::TableAccessible* aTable) : mTable(aTable) { }
 
   nsresult GetCaption(nsIAccessible** aCaption);
   nsresult GetSummary(nsAString& aSummary);
   nsresult GetColumnCount(int32_t* aColumnCount);
   nsresult GetRowCount(int32_t* aRowCount);
   nsresult GetCellAt(int32_t aRowIndex, int32_t aColumnIndex,
                      nsIAccessible** aCell);
   nsresult GetCellIndexAt(int32_t aRowIndex, int32_t aColumnIndex,
--- a/accessible/xpcom/xpcAccessibleTableCell.h
+++ b/accessible/xpcom/xpcAccessibleTableCell.h
@@ -20,17 +20,17 @@ class TableCellAccessible;
 
 /**
  * This class provides an implementation of the nsIAccessibleTableCell
  * interface's methods.
  */
 class xpcAccessibleTableCell
 {
 public:
-  xpcAccessibleTableCell(mozilla::a11y::TableCellAccessible* aTableCell) :
+  explicit xpcAccessibleTableCell(mozilla::a11y::TableCellAccessible* aTableCell) :
     mTableCell(aTableCell) { }
 
   nsresult GetTable(nsIAccessibleTable** aTable);
   nsresult GetColumnIndex(int32_t* aColIdx);
   nsresult GetRowIndex(int32_t* aRowIdx);
   nsresult GetColumnExtent(int32_t* aExtent);
   nsresult GetRowExtent(int32_t* aExtent);
   nsresult GetColumnHeaderCells(nsIArray** aHeaderCells);
--- a/accessible/xpcom/xpcAccessibleTextRange.h
+++ b/accessible/xpcom/xpcAccessibleTextRange.h
@@ -56,17 +56,17 @@ public:
   NS_IMETHOD AddToSelection() MOZ_FINAL MOZ_OVERRIDE;
   NS_IMETHOD RemoveFromSelection() MOZ_FINAL MOZ_OVERRIDE;
   NS_IMETHOD Select() MOZ_FINAL MOZ_OVERRIDE;
   NS_IMETHOD ScrollIntoView(uint32_t aHow) MOZ_FINAL MOZ_OVERRIDE;
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ACCESSIBLETEXTRANGE_IMPL_IID)
 
 private:
-  xpcAccessibleTextRange(TextRange&& aRange) :
+  explicit xpcAccessibleTextRange(TextRange&& aRange) :
     mRange(Forward<TextRange>(aRange)) {}
   xpcAccessibleTextRange() {}
 
   ~xpcAccessibleTextRange() {}
 
   friend class xpcAccessibleHyperText;
 
   xpcAccessibleTextRange(const xpcAccessibleTextRange&) MOZ_DELETE;