Bug 1060982 - Fix more bad implicit constructors in the HTML parser; r=hsivonen
☠☠ backed out by 912065e39dc3 ☠ ☠
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 01 Sep 2014 18:04:20 -0400
changeset 224526 b5af5cbdac3fdbcebe6df0b8a8c04f5c888aa095
parent 224525 4912d451011aba90f1271f8cb2c72d1777191f0e
child 224527 a8cddc6bdffcc9163d2fa3abf9c0968ec49243cf
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [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()
   {