Bug 1079317 - Fix some more bad implicit constructors in DOM; r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 24 Sep 2014 09:16:53 -0400
changeset 209241 24045f0d8b0d680d634f1b1ee151c3c44b08ebde
parent 209240 1a77a251ab44c32a73946e4bd954574da58384c4
child 209242 f992171f26cd520d7700665c6097a7ed8661d6e4
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbaku
bugs1079317
milestone35.0a1
Bug 1079317 - Fix some more bad implicit constructors in DOM; r=baku
content/base/src/ImportManager.h
content/base/src/nsDocument.cpp
content/base/src/nsPlainTextSerializer.cpp
content/html/content/src/HTMLFormElement.cpp
dom/canvas/WebGLContext.h
dom/cellbroadcast/CellBroadcast.cpp
dom/fetch/Response.h
dom/ipc/Blob.cpp
dom/voicemail/Voicemail.cpp
dom/voicemail/ipc/VoicemailIPCService.cpp
--- a/content/base/src/ImportManager.h
+++ b/content/base/src/ImportManager.h
@@ -65,17 +65,17 @@ class ImportLoader MOZ_FINAL : public ns
                              , public nsIDOMEventListener
 {
 
   // A helper inner class to decouple the logic of updating the import graph
   // after a new import link has been found by one of the parsers.
   class Updater {
 
   public:
-    Updater(ImportLoader* aLoader) : mLoader(aLoader)
+    explicit Updater(ImportLoader* aLoader) : mLoader(aLoader)
     {}
 
     // After a new link is added that refers to this import, we
     // have to update the spanning tree, since given this new link the
     // priority of this import might be higher in the scripts
     // execution order than before. It updates mMainReferrer, mImportParent,
     // the corresponding pending ScriptRunners, etc.
     // It also handles updating additional dependant loaders via the
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -550,17 +550,17 @@ nsIdentifierMapEntry::FireChangeCallback
   mChangeCallbacks->EnumerateEntries(FireChangeEnumerator, &args);
 }
 
 namespace {
 
 struct PositionComparator
 {
   Element* const mElement;
-  PositionComparator(Element* const aElement) : mElement(aElement) {}
+  explicit PositionComparator(Element* const aElement) : mElement(aElement) {}
 
   int operator()(void* aElement) const {
     Element* curElement = static_cast<Element*>(aElement);
     if (mElement == curElement) {
       return 0;
     }
     if (nsContentUtils::PositionIsBefore(mElement, curElement)) {
       return -1;
--- a/content/base/src/nsPlainTextSerializer.cpp
+++ b/content/base/src/nsPlainTextSerializer.cpp
@@ -1868,17 +1868,17 @@ struct interval
 {
   uint16_t first;
   uint16_t last;
 };
 
 struct CombiningComparator
 {
   const char16_t mUcs;
-  CombiningComparator(char16_t ucs) : mUcs(ucs) {}
+  explicit CombiningComparator(char16_t aUcs) : mUcs(aUcs) {}
   int operator()(const interval& combining) const {
     if (mUcs > combining.last)
       return 1;
     if (mUcs < combining.first)
       return -1;
 
     MOZ_ASSERT(combining.first <= mUcs);
     MOZ_ASSERT(mUcs <= combining.last);
--- a/content/html/content/src/HTMLFormElement.cpp
+++ b/content/html/content/src/HTMLFormElement.cpp
@@ -2239,33 +2239,33 @@ HTMLFormElement::Clear()
   mPastNameLookupTable.Clear();
 }
 
 namespace {
 
 struct PositionComparator
 {
   nsIContent* const mElement;
-  PositionComparator(nsIContent* const element) : mElement(element) {}
+  explicit PositionComparator(nsIContent* const aElement) : mElement(aElement) {}
 
   int operator()(nsIContent* aElement) const {
     if (mElement == aElement) {
       return 0;
     }
     if (nsContentUtils::PositionIsBefore(mElement, aElement)) {
       return -1;
     }
     return 1;
   }
 };
 
 struct NodeListAdaptor
 {
   nsINodeList* const mList;
-  NodeListAdaptor(nsINodeList* aList) : mList(aList) {}
+  explicit NodeListAdaptor(nsINodeList* aList) : mList(aList) {}
   nsIContent* operator[](size_t aIdx) const {
     return mList->Item(aIdx);
   }
 };
 
 } // namespace
 
 nsresult
--- a/dom/canvas/WebGLContext.h
+++ b/dom/canvas/WebGLContext.h
@@ -1358,17 +1358,17 @@ protected:
         WebGLContext& mWebGL;
         const bool mNeedsChange;
 
         static bool NeedsChange(WebGLContext& webgl) {
             return webgl.mNeedsFakeNoAlpha &&
                    webgl.mColorWriteMask[3] != false;
         }
 
-        ScopedMaskWorkaround(WebGLContext& webgl);
+        explicit ScopedMaskWorkaround(WebGLContext& aWebgl);
 
         ~ScopedMaskWorkaround();
     };
 
     void LoseOldestWebGLContextIfLimitExceeded();
     void UpdateLastUseIndex();
 
     template <typename WebGLObjectType>
--- a/dom/cellbroadcast/CellBroadcast.cpp
+++ b/dom/cellbroadcast/CellBroadcast.cpp
@@ -27,17 +27,17 @@ class CellBroadcast::Listener MOZ_FINAL 
 {
 private:
   CellBroadcast* mCellBroadcast;
 
 public:
   NS_DECL_ISUPPORTS
   NS_FORWARD_SAFE_NSICELLBROADCASTLISTENER(mCellBroadcast)
 
-  Listener(CellBroadcast* aCellBroadcast)
+  explicit Listener(CellBroadcast* aCellBroadcast)
     : mCellBroadcast(aCellBroadcast)
   {
     MOZ_ASSERT(mCellBroadcast);
   }
 
   void Disconnect()
   {
     MOZ_ASSERT(mCellBroadcast);
--- a/dom/fetch/Response.h
+++ b/dom/fetch/Response.h
@@ -22,17 +22,17 @@ class Promise;
 
 class Response MOZ_FINAL : public nsISupports
                          , public nsWrapperCache
 {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Response)
 
 public:
-  Response(nsISupports* aOwner);
+  explicit Response(nsISupports* aOwner);
 
   JSObject*
   WrapObject(JSContext* aCx)
   {
     return ResponseBinding::Wrap(aCx, this);
   }
 
   ResponseType
--- a/dom/ipc/Blob.cpp
+++ b/dom/ipc/Blob.cpp
@@ -324,17 +324,17 @@ class RemoteInputStream MOZ_FINAL
   nsCOMPtr<nsIInputStream> mStream;
   nsRefPtr<DOMFileImpl> mBlobImpl;
   nsCOMPtr<nsIEventTarget> mEventTarget;
   nsISeekableStream* mWeakSeekableStream;
 
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  RemoteInputStream(DOMFileImpl* aBlobImpl)
+  explicit RemoteInputStream(DOMFileImpl* aBlobImpl)
     : mMonitor("RemoteInputStream.mMonitor")
     , mBlobImpl(aBlobImpl)
     , mWeakSeekableStream(nullptr)
   {
     MOZ_ASSERT(IsOnOwningThread());
     MOZ_ASSERT(aBlobImpl);
 
     if (!NS_IsMainThread()) {
--- a/dom/voicemail/Voicemail.cpp
+++ b/dom/voicemail/Voicemail.cpp
@@ -28,17 +28,17 @@ using mozilla::ErrorResult;
 class Voicemail::Listener MOZ_FINAL : public nsIVoicemailListener
 {
   Voicemail* mVoicemail;
 
 public:
   NS_DECL_ISUPPORTS
   NS_FORWARD_SAFE_NSIVOICEMAILLISTENER(mVoicemail)
 
-  Listener(Voicemail* aVoicemail)
+  explicit Listener(Voicemail* aVoicemail)
     : mVoicemail(aVoicemail)
   {
     MOZ_ASSERT(mVoicemail);
   }
 
   void Disconnect()
   {
     MOZ_ASSERT(mVoicemail);
--- a/dom/voicemail/ipc/VoicemailIPCService.cpp
+++ b/dom/voicemail/ipc/VoicemailIPCService.cpp
@@ -18,17 +18,17 @@ namespace voicemail {
 class VoicemailIPCProvider MOZ_FINAL : public nsIVoicemailProvider
 {
   friend class VoicemailIPCService;
 
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIVOICEMAILPROVIDER
 
-  VoicemailIPCProvider(uint32_t aServiceId);
+  explicit VoicemailIPCProvider(uint32_t aServiceId);
 
 private:
   // MOZ_FINAL suppresses -Werror,-Wdelete-non-virtual-dtor
   ~VoicemailIPCProvider() {}
 
 private:
   uint32_t mServiceId;
   nsString mNumber;