Bug 1060982 - Fix more bad implicit constructors in the HTML parser; r=hsivonen
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 01 Sep 2014 18:04:20 -0400
changeset 202855 4165ed00dc3b0b73dbb846a2f13f693cca043ca7
parent 202854 06ce78192092fa5a7e8c8f445e76375cd7f6f00d
child 202856 118399d457685f5368da09f20cf647308a869175
push id48516
push usereakhgari@mozilla.com
push dateTue, 02 Sep 2014 01:09:25 +0000
treeherdermozilla-inbound@118399d45768 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsivonen
bugs1060982
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 1060982 - Fix more bad implicit constructors in the HTML parser; r=hsivonen
parser/html/jArray.h
parser/html/nsHtml5AtomTable.h
parser/html/nsHtml5DocumentBuilder.h
parser/html/nsHtml5OwningUTF16Buffer.h
parser/html/nsHtml5RefPtr.h
parser/html/nsHtml5StreamListener.h
--- a/parser/html/jArray.h
+++ b/parser/html/jArray.h
@@ -18,16 +18,17 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
 
 #ifndef jArray_h
 #define jArray_h
 
+#include "mozilla/Attributes.h"
 #include "mozilla/NullPtr.h"
 #include "nsDebug.h"
 
 template<class T, class L>
 struct staticJArray {
   const T* arr;
   const L length;
   operator T*() { return arr; }
@@ -72,17 +73,17 @@ class autoJArray {
     T* arr;
   public:
     L length;
     autoJArray()
      : arr(0)
      , length(0)
     {
     }
-    autoJArray(const jArray<T,L>& other)
+    MOZ_IMPLICIT autoJArray(const jArray<T,L>& other)
      : arr(other.arr)
      , length(other.length)
     {
     }
     ~autoJArray()
     {
       delete[] arr;
     }
--- a/parser/html/nsHtml5AtomTable.h
+++ b/parser/html/nsHtml5AtomTable.h
@@ -11,17 +11,17 @@
 #include "nsIAtom.h"
 #include "nsIThread.h"
 
 class nsHtml5Atom;
 
 class nsHtml5AtomEntry : public nsStringHashKey
 {
   public:
-    nsHtml5AtomEntry(KeyTypePointer aStr);
+    explicit nsHtml5AtomEntry(KeyTypePointer aStr);
     nsHtml5AtomEntry(const nsHtml5AtomEntry& aOther);
     ~nsHtml5AtomEntry();
     inline nsHtml5Atom* GetAtom()
     {
       return mAtom;
     }
   private:
     nsAutoPtr<nsHtml5Atom> mAtom;
--- a/parser/html/nsHtml5DocumentBuilder.h
+++ b/parser/html/nsHtml5DocumentBuilder.h
@@ -102,17 +102,17 @@ public:
   }
 
   // nsContentSink methods
   virtual void UpdateChildCounts();
   virtual nsresult FlushTags();
 
 protected:
 
-  nsHtml5DocumentBuilder(bool aRunsToCompletion);
+  explicit nsHtml5DocumentBuilder(bool aRunsToCompletion);
   virtual ~nsHtml5DocumentBuilder();
 
 protected:
   nsAutoTArray<nsCOMPtr<nsIContent>, 32> mOwnedElements;
   /**
    * Non-NS_OK if this parser should refuse to process any more input.
    * For example, the parser needs to be marked as broken if it drops some
    * input due to a memory allocation failure. In such a case, the whole
--- a/parser/html/nsHtml5OwningUTF16Buffer.h
+++ b/parser/html/nsHtml5OwningUTF16Buffer.h
@@ -9,25 +9,25 @@
 
 class nsHtml5OwningUTF16Buffer : public nsHtml5UTF16Buffer
 {
   private:
 
     /**
      * Passes a buffer and its length to the superclass constructor.
      */
-    nsHtml5OwningUTF16Buffer(char16_t* aBuffer);
+    explicit nsHtml5OwningUTF16Buffer(char16_t* aBuffer);
 
   public:
 
     /**
      * Constructor for a parser key placeholder. (No actual buffer.)
      * @param aKey a parser key
      */
-    nsHtml5OwningUTF16Buffer(void* aKey);
+    explicit nsHtml5OwningUTF16Buffer(void* aKey);
 
 protected:
     /**
      * Takes care of releasing the owned buffer.
      */
     ~nsHtml5OwningUTF16Buffer();
 
 public:
--- a/parser/html/nsHtml5RefPtr.h
+++ b/parser/html/nsHtml5RefPtr.h
@@ -9,17 +9,17 @@
 #include "nsThreadUtils.h"
 
 template <class T>
 class nsHtml5RefPtrReleaser : public nsRunnable
   {
     private:
       T* mPtr;
     public:
-      nsHtml5RefPtrReleaser(T* aPtr)
+      explicit nsHtml5RefPtrReleaser(T* aPtr)
           : mPtr(aPtr)
         {}
       NS_IMETHODIMP Run()
         {
           mPtr->Release();
           return NS_OK;
         }
   };
@@ -92,25 +92,25 @@ class nsHtml5RefPtr
       nsHtml5RefPtr( const nsHtml5RefPtr<T>& aSmartPtr )
             : mRawPtr(aSmartPtr.mRawPtr)
           // copy-constructor
         {
           if ( mRawPtr )
             mRawPtr->AddRef();
         }
 
-      nsHtml5RefPtr( T* aRawPtr )
+      explicit nsHtml5RefPtr( T* aRawPtr )
             : mRawPtr(aRawPtr)
           // construct from a raw pointer (of the right type)
         {
           if ( mRawPtr )
             mRawPtr->AddRef();
         }
 
-      nsHtml5RefPtr( const already_AddRefed<T>& aSmartPtr )
+      explicit nsHtml5RefPtr( const already_AddRefed<T>& aSmartPtr )
             : mRawPtr(aSmartPtr.mRawPtr)
           // construct from |dont_AddRef(expr)|
         {
         }
 
         // Assignment operators
 
       nsHtml5RefPtr<T>&
--- a/parser/html/nsHtml5StreamListener.h
+++ b/parser/html/nsHtml5StreamListener.h
@@ -27,17 +27,17 @@
  * takes care of the destructor not running concurrently from different
  * threads, so there is no need to have a mutex around nsHtml5RefPtr to
  * prevent it from double-releasing nsHtml5StreamParser.
  */
 class nsHtml5StreamListener : public nsIStreamListener,
                               public nsIThreadRetargetableStreamListener
 {
 public:
-  nsHtml5StreamListener(nsHtml5StreamParser* aDelegate);
+  explicit nsHtml5StreamListener(nsHtml5StreamParser* aDelegate);
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
 
   inline nsHtml5StreamParser* GetDelegate()
   {