Bug 1189369, part 8 - Clean up some minor style issues in nsMaybeWeakPtr.h. r=mak
authorAndrew McCreight <continuation@gmail.com>
Tue, 04 Aug 2015 13:55:01 -0700
changeset 287861 775e5c9e09ad47f0b9779d713735ccbd8cd29fe6
parent 287860 2385743dfb09891a5f7ade1092fab45f12a183cf
child 287862 c4dc03f004d602576c19243cb1963130e6e5a9a4
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1189369
milestone42.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 1189369, part 8 - Clean up some minor style issues in nsMaybeWeakPtr.h. r=mak
toolkit/components/places/nsMaybeWeakPtr.h
--- a/toolkit/components/places/nsMaybeWeakPtr.h
+++ b/toolkit/components/places/nsMaybeWeakPtr.h
@@ -14,19 +14,19 @@
 
 // nsMaybeWeakPtr is a helper object to hold a strong-or-weak reference
 // to the template class.  It's pretty minimal, but sufficient.
 
 template<class T>
 class nsMaybeWeakPtr
 {
 public:
-  MOZ_IMPLICIT nsMaybeWeakPtr(nsISupports *ref) { mPtr = ref; }
-  MOZ_IMPLICIT nsMaybeWeakPtr(const nsCOMPtr<nsIWeakReference> &ref) { mPtr = ref; }
-  MOZ_IMPLICIT nsMaybeWeakPtr(const nsCOMPtr<T> &ref) { mPtr = ref; }
+  MOZ_IMPLICIT nsMaybeWeakPtr(nsISupports* aRef) : mPtr(aRef) {}
+  MOZ_IMPLICIT nsMaybeWeakPtr(const nsCOMPtr<nsIWeakReference>& aRef) : mPtr(aRef) {}
+  MOZ_IMPLICIT nsMaybeWeakPtr(const nsCOMPtr<T>& aRef) : mPtr(aRef) {}
 
   bool operator==(const nsMaybeWeakPtr<T> &other) const {
     return mPtr == other.mPtr;
   }
 
   nsISupports* GetRawValue() const { return mPtr.get(); }
 
   const nsCOMPtr<T> GetValue() const;
@@ -35,22 +35,22 @@ private:
   nsCOMPtr<nsISupports> mPtr;
 };
 
 // nsMaybeWeakPtrArray is an array of MaybeWeakPtr objects, that knows how to
 // grab a weak reference to a given object if requested.  It only allows a
 // given object to appear in the array once.
 
 template<class T>
-class nsMaybeWeakPtrArray : public nsTArray< nsMaybeWeakPtr<T> >
+class nsMaybeWeakPtrArray : public nsTArray<nsMaybeWeakPtr<T>>
 {
   typedef nsTArray<nsMaybeWeakPtr<T>> MaybeWeakArray;
 
 public:
-  nsresult AppendWeakElement(T *aElement, bool aOwnsWeak)
+  nsresult AppendWeakElement(T* aElement, bool aOwnsWeak)
   {
     nsCOMPtr<nsISupports> ref;
     if (aOwnsWeak) {
       ref = do_GetWeakReference(aElement);
     } else {
       ref = aElement;
     }
 
@@ -58,17 +58,17 @@ public:
       return NS_ERROR_INVALID_ARG;
     }
     if (!MaybeWeakArray::AppendElement(ref)) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
     return NS_OK;
   }
 
-  nsresult RemoveWeakElement(T *aElement)
+  nsresult RemoveWeakElement(T* aElement)
   {
     if (MaybeWeakArray::RemoveElement(aElement)) {
       return NS_OK;
     }
 
     // Don't use do_GetWeakReference; it should only be called if we know
     // the object supports weak references.
     nsCOMPtr<nsISupportsWeakReference> supWeakRef = do_QueryInterface(aElement);