Bug 1046841 - Fix more style violations in previously touched .h files in xpcom/. r=froydnj
authorBirunthan Mohanathas <birunthan@mohanathas.com>
Mon, 25 Aug 2014 12:17:24 -0700
changeset 223095 fe4f8a3cdb1991c1e6fba042dcab1fd345ad4357
parent 223094 db05fccb028c0c46217203d2d8e9fa8020b727d5
child 223096 7afb7c612b5af06164e8495b12fa126b071c2a0e
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)
reviewersfroydnj
bugs1046841
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 1046841 - Fix more style violations in previously touched .h files in xpcom/. r=froydnj
xpcom/base/CodeAddressService.h
xpcom/base/CycleCollectedJSRuntime.h
xpcom/base/StaticPtr.h
xpcom/base/nsConsoleService.h
xpcom/base/nsSetDllDirectory.h
xpcom/ds/nsExpirationTracker.h
xpcom/ds/nsProperties.h
xpcom/glue/DeadlockDetector.h
xpcom/glue/nsBaseHashtable.h
xpcom/glue/nsComponentManagerUtils.h
xpcom/glue/nsProxyRelease.h
xpcom/glue/nsTArray.h
xpcom/glue/nsThreadUtils.h
xpcom/glue/nsVersionComparator.h
xpcom/glue/standalone/nsXPCOMGlue.h
xpcom/io/FileUtilsWin.h
xpcom/io/nsDirectoryService.h
xpcom/io/nsDirectoryServiceUtils.h
xpcom/string/nsStringIterator.h
xpcom/string/nsTSubstring.h
xpcom/threads/HangMonitor.h
xpcom/threads/nsTimerImpl.h
--- a/xpcom/base/CodeAddressService.h
+++ b/xpcom/base/CodeAddressService.h
@@ -149,17 +149,18 @@ public:
       nsCodeAddressDetails details;
       {
         DescribeCodeAddressLock::Unlock();
         (void)NS_DescribeCodeAddress(const_cast<void*>(aPc), &details);
         DescribeCodeAddressLock::Lock();
       }
 
       const char* library = mLibraryStrings.Intern(details.library);
-      entry.Replace(aPc, details.function, library, details.loffset, details.filename, details.lineno);
+      entry.Replace(aPc, details.function, library, details.loffset,
+                    details.filename, details.lineno);
 
     } else {
       mNumCacheHits++;
     }
 
     MOZ_ASSERT(entry.mPc == aPc);
 
     uintptr_t entryPc = (uintptr_t)(entry.mPc);
--- a/xpcom/base/CycleCollectedJSRuntime.h
+++ b/xpcom/base/CycleCollectedJSRuntime.h
@@ -116,32 +116,23 @@ protected:
   CycleCollectedJSRuntime(JSRuntime* aParentRuntime,
                           uint32_t aMaxBytes,
                           uint32_t aMaxNurseryBytes);
   virtual ~CycleCollectedJSRuntime();
 
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
   void UnmarkSkippableJSHolders();
 
-  virtual void TraverseAdditionalNativeRoots(nsCycleCollectionNoteRootCallback& aCb)
-  {
-  }
-  virtual void TraceAdditionalNativeGrayRoots(JSTracer* aTracer)
-  {
-  }
+  virtual void
+  TraverseAdditionalNativeRoots(nsCycleCollectionNoteRootCallback& aCb) {}
+  virtual void TraceAdditionalNativeGrayRoots(JSTracer* aTracer) {}
 
-  virtual void CustomGCCallback(JSGCStatus aStatus)
-  {
-  }
-  virtual void CustomOutOfMemoryCallback()
-  {
-  }
-  virtual void CustomLargeAllocationFailureCallback()
-  {
-  }
+  virtual void CustomGCCallback(JSGCStatus aStatus) {}
+  virtual void CustomOutOfMemoryCallback() {}
+  virtual void CustomLargeAllocationFailureCallback() {}
   virtual bool CustomContextCallback(JSContext* aCx, unsigned aOperation)
   {
     return true; // Don't block context creation.
   }
 
 private:
 
   void
@@ -186,18 +177,18 @@ private:
   static void
   TraverseObjectShim(void* aData, void* aThing);
 
   void TraverseNativeRoots(nsCycleCollectionNoteRootCallback& aCb);
 
   static void TraceBlackJS(JSTracer* aTracer, void* aData);
   static void TraceGrayJS(JSTracer* aTracer, void* aData);
   static void GCCallback(JSRuntime* aRuntime, JSGCStatus aStatus, void* aData);
-  static void OutOfMemoryCallback(JSContext *aContext, void *aData);
-  static void LargeAllocationFailureCallback(void *aData);
+  static void OutOfMemoryCallback(JSContext* aContext, void* aData);
+  static void LargeAllocationFailureCallback(void* aData);
   static bool ContextCallback(JSContext* aCx, unsigned aOperation,
                               void* aData);
 
   virtual void TraceNativeBlackRoots(JSTracer* aTracer) { };
   void TraceNativeGrayRoots(JSTracer* aTracer);
 
   enum DeferredFinalizeType {
     FinalizeIncrementally,
@@ -235,17 +226,17 @@ public:
     // The condition has happened, but a GC cycle ended since then.
     //
     // GC is taken as a proxy for "we've been banging on the heap a good bit
     // now and haven't crashed; the OOM was probably handled correctly".
     Recovered
   MOZ_END_NESTED_ENUM_CLASS(OOMState)
 
 private:
-  void AnnotateAndSetOutOfMemory(OOMState *aStatePtr, OOMState aNewState);
+  void AnnotateAndSetOutOfMemory(OOMState* aStatePtr, OOMState aNewState);
   void OnGC(JSGCStatus aStatus);
   void OnOutOfMemory();
   void OnLargeAllocationFailure();
 
 public:
   void AddJSHolder(void* aHolder, nsScriptObjectTracer* aTracer);
   void RemoveJSHolder(void* aHolder);
 #ifdef DEBUG
--- a/xpcom/base/StaticPtr.h
+++ b/xpcom/base/StaticPtr.h
@@ -49,36 +49,27 @@ public:
 #endif
 
   StaticAutoPtr<T>& operator=(T* aRhs)
   {
     Assign(aRhs);
     return *this;
   }
 
-  T* get() const
-  {
-    return mRawPtr;
-  }
+  T* get() const { return mRawPtr; }
 
-  operator T*() const
-  {
-    return get();
-  }
+  operator T*() const { return get(); }
 
   T* operator->() const
   {
     MOZ_ASSERT(mRawPtr);
     return get();
   }
 
-  T& operator*() const
-  {
-    return *get();
-  }
+  T& operator*() const { return *get(); }
 
 private:
   // Disallow copy constructor, but only in debug mode.  We only define
   // a default constructor in debug mode (see above); if we declared
   // this constructor always, the compiler wouldn't generate a trivial
   // default constructor for us in non-debug mode.
 #ifdef DEBUG
   StaticAutoPtr(StaticAutoPtr<T>& aOther);
@@ -115,36 +106,27 @@ public:
     return *this;
   }
 
   StaticRefPtr<T>& operator=(const StaticRefPtr<T>& aRhs)
   {
     return (this = aRhs.mRawPtr);
   }
 
-  T* get() const
-  {
-    return mRawPtr;
-  }
+  T* get() const { return mRawPtr; }
 
-  operator T*() const
-  {
-    return get();
-  }
+  operator T*() const { return get(); }
 
   T* operator->() const
   {
     MOZ_ASSERT(mRawPtr);
     return get();
   }
 
-  T& operator*() const
-  {
-    return *get();
-  }
+  T& operator*() const { return *get(); }
 
 private:
   void AssignWithAddref(T* aNewPtr)
   {
     if (aNewPtr) {
       aNewPtr->AddRef();
     }
     AssignAssumingAddRef(aNewPtr);
--- a/xpcom/base/nsConsoleService.h
+++ b/xpcom/base/nsConsoleService.h
@@ -48,18 +48,20 @@ public:
 
   enum OutputMode {
     SuppressLog,
     OutputToLog
   };
   virtual nsresult LogMessageWithMode(nsIConsoleMessage* aMessage,
                                       OutputMode aOutputMode);
 
-  typedef nsInterfaceHashtable<nsISupportsHashKey, nsIConsoleListener> ListenerHash;
-  void EnumerateListeners(ListenerHash::EnumReadFunction aFunction, void* aClosure);
+  typedef nsInterfaceHashtable<nsISupportsHashKey,
+                               nsIConsoleListener> ListenerHash;
+  void EnumerateListeners(ListenerHash::EnumReadFunction aFunction,
+                          void* aClosure);
 
 private:
   ~nsConsoleService();
 
   // Circular buffer of saved messages
   nsIConsoleMessage** mMessages;
 
   // How big?
--- a/xpcom/base/nsSetDllDirectory.h
+++ b/xpcom/base/nsSetDllDirectory.h
@@ -18,17 +18,18 @@
 namespace mozilla {
 
 static void
 SanitizeEnvironmentVariables()
 {
   DWORD bufferSize = GetEnvironmentVariableW(L"PATH", nullptr, 0);
   if (bufferSize) {
     wchar_t* originalPath = new wchar_t[bufferSize];
-    if (bufferSize - 1 == GetEnvironmentVariableW(L"PATH", originalPath, bufferSize)) {
+    if (bufferSize - 1 == GetEnvironmentVariableW(L"PATH", originalPath,
+                                                  bufferSize)) {
       bufferSize = ExpandEnvironmentStringsW(originalPath, nullptr, 0);
       if (bufferSize) {
         wchar_t* newPath = new wchar_t[bufferSize];
         if (ExpandEnvironmentStringsW(originalPath,
                                       newPath,
                                       bufferSize)) {
           SetEnvironmentVariableW(L"PATH", newPath);
         }
--- a/xpcom/ds/nsExpirationTracker.h
+++ b/xpcom/ds/nsExpirationTracker.h
@@ -104,17 +104,18 @@ public:
   /**
    * Add an object to be tracked. It must not already be tracked. It will
    * be added to the newest generation, i.e., as if it was just used.
    * @return an error on out-of-memory
    */
   nsresult AddObject(T* aObj)
   {
     nsExpirationState* state = aObj->GetExpirationState();
-    NS_ASSERTION(!state->IsTracked(), "Tried to add an object that's already tracked");
+    NS_ASSERTION(!state->IsTracked(),
+                 "Tried to add an object that's already tracked");
     nsTArray<T*>& generation = mGenerations[mNewestGeneration];
     uint32_t index = generation.Length();
     if (index > nsExpirationState::MAX_INDEX_IN_GENERATION) {
       NS_WARNING("More than 256M elements tracked, this is probably a problem");
       return NS_ERROR_OUT_OF_MEMORY;
     }
     if (index == 0) {
       // We might need to start the timer
--- a/xpcom/ds/nsProperties.h
+++ b/xpcom/ds/nsProperties.h
@@ -15,18 +15,18 @@
 #define NS_PROPERTIES_CID                            \
 { /* 4de2bc90-b1bf-11d3-93b6-00104ba0fd40 */         \
     0x4de2bc90,                                      \
     0xb1bf,                                          \
     0x11d3,                                          \
     {0x93, 0xb6, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
 }
 
-typedef nsInterfaceHashtable<nsCharPtrHashKey, nsISupports>
-        nsProperties_HashBase;
+typedef nsInterfaceHashtable<nsCharPtrHashKey,
+                             nsISupports> nsProperties_HashBase;
 
 class nsProperties MOZ_FINAL
   : public nsIProperties
   , public nsProperties_HashBase
 {
 public:
   NS_DECL_AGGREGATED
   NS_DECL_NSIPROPERTIES
--- a/xpcom/glue/DeadlockDetector.h
+++ b/xpcom/glue/DeadlockDetector.h
@@ -291,17 +291,17 @@ public:
     //     a 9% improvement in scalability tests on some systems.
     static nsDefaultComparator<const OrderingEntry*, const OrderingEntry*> comp;
     if (aStart->mOrderedLT.BinaryIndexOf(aTarget, comp) != NoIndex) {
       return true;
     }
 
     index_type i = 0;
     size_type len = aStart->mOrderedLT.Length();
-    for (const OrderingEntry* const* it = aStart->mOrderedLT.Elements(); i < len; ++i, ++it) {
+    for (auto it = aStart->mOrderedLT.Elements(); i < len; ++i, ++it) {
       if (InTransitiveClosure(*it, aTarget)) {
         return true;
       }
     }
     return false;
   }
 
   /**
@@ -342,17 +342,17 @@ public:
   {
     if (aStart->mOrderedLT.BinaryIndexOf(aTarget) != NoIndex) {
       aChain->AppendElement(aTarget->mResource);
       return true;
     }
 
     index_type i = 0;
     size_type len = aStart->mOrderedLT.Length();
-    for (const OrderingEntry* const* it = aStart->mOrderedLT.Elements(); i < len; ++i, ++it) {
+    for (auto it = aStart->mOrderedLT.Elements(); i < len; ++i, ++it) {
       aChain->AppendElement((*it)->mResource);
       if (GetDeductionChain_Helper(*it, aTarget, aChain)) {
         return true;
       }
       aChain->RemoveElementAt(aChain->Length() - 1);
     }
     return false;
   }
--- a/xpcom/glue/nsBaseHashtable.h
+++ b/xpcom/glue/nsBaseHashtable.h
@@ -124,17 +124,18 @@ public:
   void Put(KeyType aKey, const UserDataType& aData)
   {
     if (!Put(aKey, aData, fallible_t())) {
       NS_ABORT_OOM(this->mTable.entrySize * this->mTable.entryCount);
     }
   }
 
   NS_WARN_UNUSED_RESULT bool Put(KeyType aKey, const UserDataType& aData,
-                                 const fallible_t&) {
+                                 const fallible_t&)
+  {
     EntryType* ent = this->PutEntry(aKey);
     if (!ent) {
       return false;
     }
 
     ent->mData = aData;
 
     return true;
@@ -218,17 +219,17 @@ public:
    * @param     aKey the key being enumerated
    * @param     aData Reference to data being enumerated.
    * @param     aMallocSizeOf the function used to measure heap-allocated blocks
    * @param     aUserArg passed unchanged from SizeOf{In,Ex}cludingThis
    * @return    summed size of the things pointed to by the entries
    */
   typedef size_t
     (*SizeOfEntryExcludingThisFun)(KeyType aKey,
-                                   const DataType &aData,
+                                   const DataType& aData,
                                    mozilla::MallocSizeOf aMallocSizeOf,
                                    void* aUserArg);
 
   /**
    * Measure the size of the table's entry storage and the table itself.
    * If |aSizeOfEntryExcludingThis| is non-nullptr, measure the size of things
    * pointed to by entries.
    *
--- a/xpcom/glue/nsComponentManagerUtils.h
+++ b/xpcom/glue/nsComponentManagerUtils.h
@@ -26,17 +26,18 @@ NS_COM_GLUE nsresult CallGetClassObject(
 
 NS_COM_GLUE nsresult CallGetClassObject(const char* aContractID,
                                         const nsIID& aIID, void** aResult);
 
 
 class NS_COM_GLUE nsCreateInstanceByCID : public nsCOMPtr_helper
 {
 public:
-  nsCreateInstanceByCID(const nsCID& aCID, nsISupports* aOuter, nsresult* aErrorPtr)
+  nsCreateInstanceByCID(const nsCID& aCID, nsISupports* aOuter,
+                        nsresult* aErrorPtr)
     : mCID(aCID)
     , mOuter(aOuter)
     , mErrorPtr(aErrorPtr)
   {
   }
 
   virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
 
--- a/xpcom/glue/nsProxyRelease.h
+++ b/xpcom/glue/nsProxyRelease.h
@@ -172,17 +172,20 @@ private:
 
 template<class T>
 class nsMainThreadPtrHandle
 {
   nsRefPtr<nsMainThreadPtrHolder<T>> mPtr;
 
 public:
   nsMainThreadPtrHandle() : mPtr(nullptr) {}
-  explicit nsMainThreadPtrHandle(nsMainThreadPtrHolder<T>* aHolder) : mPtr(aHolder) {}
+  explicit nsMainThreadPtrHandle(nsMainThreadPtrHolder<T>* aHolder)
+    : mPtr(aHolder)
+  {
+  }
   nsMainThreadPtrHandle(const nsMainThreadPtrHandle& aOther)
     : mPtr(aOther.mPtr)
   {
   }
   nsMainThreadPtrHandle& operator=(const nsMainThreadPtrHandle& aOther)
   {
     mPtr = aOther.mPtr;
     return *this;
--- a/xpcom/glue/nsTArray.h
+++ b/xpcom/glue/nsTArray.h
@@ -468,17 +468,17 @@ public:
     // which zeroes out POD ("plain old data") types such as regular
     // ints.  We don't want that because it can be a performance issue
     // and people don't expect it; nsTArray should work like a regular
     // C/C++ array in this respect.
     new (static_cast<void*>(aE)) E;
   }
   // Invoke the copy-constructor in place.
   template<class A>
-  static inline void Construct(E* aE, A &&aArg)
+  static inline void Construct(E* aE, A&& aArg)
   {
     typedef typename mozilla::RemoveCV<E>::Type E_NoCV;
     typedef typename mozilla::RemoveCV<A>::Type A_NoCV;
     static_assert(!mozilla::IsSame<E_NoCV*, A_NoCV>::value,
                   "For safety, we disallow constructing nsTArray<E> elements "
                   "from E* pointers. See bug 960591.");
     new (static_cast<void*>(aE)) E(mozilla::Forward<A>(aArg));
   }
@@ -1098,18 +1098,19 @@ public:
   // @return          A pointer to the new elements in the array, or null if
   //                  the operation failed due to insufficient memory.
   template<class Item>
   elem_type* ReplaceElementsAt(index_type aStart, size_type aCount,
                                const Item* aArray, size_type aArrayLen)
   {
     // Adjust memory allocation up-front to catch errors.
     if (!Alloc::Successful(this->EnsureCapacity(Length() + aArrayLen - aCount,
-                                                sizeof(elem_type))))
+                                                sizeof(elem_type)))) {
       return nullptr;
+    }
     DestructRange(aStart, aCount);
     this->ShiftData(aStart, aCount, aArrayLen,
                     sizeof(elem_type), MOZ_ALIGNOF(elem_type));
     AssignRange(aStart, aArrayLen, aArray);
     return Elements() + aStart;
   }
 
   // A variation on the ReplaceElementsAt method defined above.
@@ -1159,34 +1160,37 @@ public:
   }
 
   // Insert a new element without copy-constructing. This is useful to avoid
   // temporaries.
   // @return A pointer to the newly inserted element, or null on OOM.
   elem_type* InsertElementAt(index_type aIndex)
   {
     if (!Alloc::Successful(this->EnsureCapacity(Length() + 1,
-                                                sizeof(elem_type))))
+                                                sizeof(elem_type)))) {
       return nullptr;
+    }
     this->ShiftData(aIndex, 0, 1, sizeof(elem_type), MOZ_ALIGNOF(elem_type));
     elem_type* elem = Elements() + aIndex;
     elem_traits::Construct(elem);
     return elem;
   }
 
   // Insert an element by move constructing aItem.
   // @return a pointer to the inserted element or NULL on oom.
   elem_type* InsertElementAt(index_type aIndex, elem_type&& aItem)
   {
     if (!Alloc::Successful(this->EnsureCapacity(Length() + 1,
-                                                sizeof(elem_type))))
+                                                sizeof(elem_type)))) {
       return nullptr;
+    }
     this->ShiftData(aIndex, 0, 1, sizeof(elem_type), MOZ_ALIGNOF(elem_type));
     elem_type* elem = Elements() + aIndex;
-    nsTArrayElementTraits<elem_type>::Construct(elem, mozilla::Forward<elem_type>(aItem));
+    nsTArrayElementTraits<elem_type>::Construct(elem,
+                                                mozilla::Forward<elem_type>(aItem));
     return elem;
   }
 
   // This method searches for the smallest index of an element that is strictly
   // greater than |aItem|. If |aItem| is inserted at this index, the array will
   // remain sorted and |aItem| would come after all elements that are equal to
   // it. If |aItem| is greater than or equal to all elements in the array, the
   // array length is returned.
@@ -1252,18 +1256,19 @@ public:
   // @param aArray    The elements to append to this array.
   // @param aArrayLen The number of elements to append to this array.
   // @return          A pointer to the new elements in the array, or null if
   //                  the operation failed due to insufficient memory.
   template<class Item>
   elem_type* AppendElements(const Item* aArray, size_type aArrayLen)
   {
     if (!Alloc::Successful(this->EnsureCapacity(Length() + aArrayLen,
-                                                sizeof(elem_type))))
+                                                sizeof(elem_type)))) {
       return nullptr;
+    }
     index_type len = Length();
     AssignRange(len, aArrayLen, aArray);
     this->IncrementLength(aArrayLen);
     return Elements() + len;
   }
 
   // A variation on the AppendElements method defined above.
   template<class Item, class Allocator>
@@ -1278,34 +1283,37 @@ public:
   {
     return AppendElements(&aItem, 1);
   }
 
   // A variation of AppendElement that takes an r-value reference
   elem_type* AppendElement(elem_type&& aItem)
   {
     if (!Alloc::Successful(this->EnsureCapacity(Length() + 1,
-                                                sizeof(elem_type))))
+                                                sizeof(elem_type)))) {
       return nullptr;
+    }
     index_type len = Length();
     elem_type* iter = Elements() + len;
-    nsTArrayElementTraits<elem_type>::Construct(iter, mozilla::Forward<elem_type>(aItem));
+    nsTArrayElementTraits<elem_type>::Construct(iter,
+                                                mozilla::Forward<elem_type>(aItem));
     this->IncrementLength(1);
     return iter;
   }
 
 
   // Append new elements without copy-constructing. This is useful to avoid
   // temporaries.
   // @return A pointer to the newly appended elements, or null on OOM.
   elem_type* AppendElements(size_type aCount)
   {
     if (!Alloc::Successful(this->EnsureCapacity(Length() + aCount,
-                                                sizeof(elem_type))))
+                                                sizeof(elem_type)))) {
       return nullptr;
+    }
     elem_type* elems = Elements() + Length();
     size_type i;
     for (i = 0; i < aCount; ++i) {
       elem_traits::Construct(elems + i);
     }
     this->IncrementLength(aCount);
     return elems;
   }
@@ -1320,18 +1328,19 @@ public:
   // @return A pointer to the newly appended elements, or null on OOM.
   template<class Item, class Allocator>
   elem_type* MoveElementsFrom(nsTArray_Impl<Item, Allocator>& aArray)
   {
     MOZ_ASSERT(&aArray != this, "argument must be different aArray");
     index_type len = Length();
     index_type otherLen = aArray.Length();
     if (!Alloc::Successful(this->EnsureCapacity(len + otherLen,
-                                                sizeof(elem_type))))
+                                                sizeof(elem_type)))) {
       return nullptr;
+    }
     copy_type::CopyElements(Elements() + len, aArray.Elements(), otherLen,
                             sizeof(elem_type));
     this->IncrementLength(otherLen);
     aArray.ShiftData(0, otherLen, 0, sizeof(elem_type), MOZ_ALIGNOF(elem_type));
     return Elements() + len;
   }
 
   // This method removes a range of elements from this array.
@@ -1428,17 +1437,17 @@ public:
   }
 
   // This method modifies the length of the array.  If the new length is
   // larger than the existing length of the array, then new elements will be
   // constructed using elem_type's default constructor.  Otherwise, this call
   // removes elements from the array (see also RemoveElementsAt).
   // @param aNewLen The desired length of this array.
   // @return True if the operation succeeded; false otherwise.
-  // See also TruncateLength if the new length is guaranteed to be smaller than 
+  // See also TruncateLength if the new length is guaranteed to be smaller than
   // the old.
   typename Alloc::ResultType SetLength(size_type aNewLen)
   {
     size_type oldLen = Length();
     if (aNewLen > oldLen) {
       return Alloc::ConvertBoolToResultType(
         InsertElementsAt(oldLen, aNewLen - oldLen) != nullptr);
     }
--- a/xpcom/glue/nsThreadUtils.h
+++ b/xpcom/glue/nsThreadUtils.h
@@ -289,17 +289,21 @@ struct nsRunnableMethodReceiver
   ~nsRunnableMethodReceiver() { Revoke(); }
   void Revoke() { NS_IF_RELEASE(mObj); }
 };
 
 template<class ClassType, bool Owning>
 struct nsRunnableMethodReceiver<ClassType, void, Owning>
 {
   ClassType* mObj;
-  explicit nsRunnableMethodReceiver(ClassType* aObj) : mObj(aObj) { NS_IF_ADDREF(mObj); }
+  explicit nsRunnableMethodReceiver(ClassType* aObj)
+    : mObj(aObj)
+  {
+    NS_IF_ADDREF(mObj);
+  }
   ~nsRunnableMethodReceiver() { Revoke(); }
   void Revoke() { NS_IF_RELEASE(mObj); }
 };
 
 template<class ClassType>
 struct nsRunnableMethodReceiver<ClassType, void, false>
 {
   ClassType* mObj;
--- a/xpcom/glue/nsVersionComparator.h
+++ b/xpcom/glue/nsVersionComparator.h
@@ -41,17 +41,18 @@
  * as Version.
  */
 
 namespace mozilla {
 
 int32_t NS_COM_GLUE CompareVersions(const char* aStrA, const char* aStrB);
 
 #ifdef XP_WIN
-int32_t NS_COM_GLUE CompareVersions(const char16_t* aStrA, const char16_t* aStrB);
+int32_t NS_COM_GLUE CompareVersions(const char16_t* aStrA,
+                                    const char16_t* aStrB);
 #endif
 
 struct NS_COM_GLUE Version
 {
   explicit Version(const char* aVersionString)
   {
     versionContent = strdup(aVersionString);
   }
--- a/xpcom/glue/standalone/nsXPCOMGlue.h
+++ b/xpcom/glue/standalone/nsXPCOMGlue.h
@@ -13,39 +13,37 @@
 
 /**
  * The following functions are only available in the standalone glue.
  */
 
 /**
  * Enabled preloading of dynamically loaded libraries
  */
-extern "C" NS_HIDDEN_(void)
-XPCOMGlueEnablePreload();
+extern "C" NS_HIDDEN_(void) XPCOMGlueEnablePreload();
 
 /**
  * Initialize the XPCOM glue by dynamically linking against the XPCOM
  * shared library indicated by xpcomFile.
  */
-extern "C" NS_HIDDEN_(nsresult)
-XPCOMGlueStartup(const char* xpcomFile);
+extern "C" NS_HIDDEN_(nsresult) XPCOMGlueStartup(const char* xpcomFile);
 
 typedef void (*NSFuncPtr)();
 
 struct nsDynamicFunctionLoad
 {
-    const char *functionName;
-    NSFuncPtr  *function;
+  const char* functionName;
+  NSFuncPtr* function;
 };
 
 /**
  * Dynamically load functions from libxul.
  *
  * @throws NS_ERROR_NOT_INITIALIZED if XPCOMGlueStartup() was not called or
  *         if the libxul DLL was not found.
  * @throws NS_ERROR_LOSS_OF_SIGNIFICANT_DATA if only some of the required
  *         functions were found.
  */
 extern "C" NS_HIDDEN_(nsresult)
-XPCOMGlueLoadXULFunctions(const nsDynamicFunctionLoad *symbols);
+XPCOMGlueLoadXULFunctions(const nsDynamicFunctionLoad* symbols);
 
 #endif // XPCOM_GLUE
 #endif // nsXPCOMGlue_h__
--- a/xpcom/io/FileUtilsWin.h
+++ b/xpcom/io/FileUtilsWin.h
@@ -30,17 +30,18 @@ NtPathToDosPath(const nsAString& aNtPath
     // Symbolic link for DOS device. Just strip off the prefix.
     aDosPath = aNtPath;
     aDosPath.Cut(0, 4);
     return true;
   }
   nsAutoString logicalDrives;
   DWORD len = 0;
   while (true) {
-    len = GetLogicalDriveStringsW(len, reinterpret_cast<wchar_t*>(logicalDrives.BeginWriting()));
+    len = GetLogicalDriveStringsW(
+      len, reinterpret_cast<wchar_t*>(logicalDrives.BeginWriting()));
     if (!len) {
       return false;
     } else if (len > logicalDrives.Length()) {
       logicalDrives.SetLength(len);
     } else {
       break;
     }
   }
--- a/xpcom/io/nsDirectoryService.h
+++ b/xpcom/io/nsDirectoryService.h
@@ -19,18 +19,16 @@
 #define NS_DIRECTORY_SERVICE_CID  {0xf00152d0,0xb40b,0x11d3,{0x8c, 0x9c, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74}}
 
 class nsDirectoryService MOZ_FINAL
   : public nsIDirectoryService
   , public nsIProperties
   , public nsIDirectoryServiceProvider2
 {
 public:
-
-  // nsISupports interface
   NS_DECL_THREADSAFE_ISUPPORTS
 
   NS_DECL_NSIPROPERTIES
 
   NS_DECL_NSIDIRECTORYSERVICE
 
   NS_DECL_NSIDIRECTORYSERVICEPROVIDER
 
--- a/xpcom/io/nsDirectoryServiceUtils.h
+++ b/xpcom/io/nsDirectoryServiceUtils.h
@@ -13,17 +13,18 @@
 #include "nsCOMPtr.h"
 #include "nsXPCOMCID.h"
 #include "nsIFile.h"
 
 inline nsresult
 NS_GetSpecialDirectory(const char* aSpecialDirName, nsIFile** aResult)
 {
   nsresult rv;
-  nsCOMPtr<nsIProperties> serv(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
+  nsCOMPtr<nsIProperties> serv(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID,
+                                             &rv));
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   return serv->Get(aSpecialDirName, NS_GET_IID(nsIFile),
                    reinterpret_cast<void**>(aResult));
 }
 
--- a/xpcom/string/nsStringIterator.h
+++ b/xpcom/string/nsStringIterator.h
@@ -117,23 +117,25 @@ public:
     return mPosition - mStart;
   }
 
   self_type& advance(difference_type aN)
   {
     if (aN > 0) {
       difference_type step = XPCOM_MIN(aN, size_forward());
 
-      NS_ASSERTION(step > 0, "can't advance a reading iterator beyond the end of a string");
+      NS_ASSERTION(step > 0,
+                   "can't advance a reading iterator beyond the end of a string");
 
       mPosition += step;
     } else if (aN < 0) {
       difference_type step = XPCOM_MAX(aN, -size_backward());
 
-      NS_ASSERTION(step < 0, "can't advance (backward) a reading iterator beyond the end of a string");
+      NS_ASSERTION(step < 0,
+                   "can't advance (backward) a reading iterator beyond the end of a string");
 
       mPosition += step;
     }
     return *this;
   }
 };
 
 /**
@@ -243,32 +245,35 @@ public:
     return mPosition - mStart;
   }
 
   self_type& advance(difference_type aN)
   {
     if (aN > 0) {
       difference_type step = XPCOM_MIN(aN, size_forward());
 
-      NS_ASSERTION(step > 0, "can't advance a writing iterator beyond the end of a string");
+      NS_ASSERTION(step > 0,
+                   "can't advance a writing iterator beyond the end of a string");
 
       mPosition += step;
     } else if (aN < 0) {
       difference_type step = XPCOM_MAX(aN, -size_backward());
 
-      NS_ASSERTION(step < 0, "can't advance (backward) a writing iterator beyond the end of a string");
+      NS_ASSERTION(step < 0,
+                   "can't advance (backward) a writing iterator beyond the end of a string");
 
       mPosition += step;
     }
     return *this;
   }
 
   void write(const value_type* aS, uint32_t aN)
   {
-    NS_ASSERTION(size_forward() > 0, "You can't |write| into an |nsWritingIterator| with no space!");
+    NS_ASSERTION(size_forward() > 0,
+                 "You can't |write| into an |nsWritingIterator| with no space!");
 
     nsCharTraits<value_type>::move(mPosition, aS, aN);
     advance(difference_type(aN));
   }
 };
 
 template <class CharT>
 inline bool
--- a/xpcom/string/nsTSubstring.h
+++ b/xpcom/string/nsTSubstring.h
@@ -763,17 +763,18 @@ public:
 #if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
   size_type GetMutableData(wchar_t** aData, size_type aNewLen = size_type(-1))
   {
     return GetMutableData(reinterpret_cast<char16_t**>(aData), aNewLen);
   }
 
   size_type GetMutableData(wchar_t** aData, size_type aNewLen, const fallible_t&)
   {
-    return GetMutableData(reinterpret_cast<char16_t**>(aData), aNewLen, fallible_t());
+    return GetMutableData(reinterpret_cast<char16_t**>(aData), aNewLen,
+                          fallible_t());
   }
 #endif
 
 
   /**
    * string data is never null, but can be marked void.  if true, the
    * string will be truncated.  @see nsTSubstring::IsVoid
    */
@@ -953,18 +954,17 @@ protected:
    * memory.
    */
   NS_WARN_UNUSED_RESULT bool ReplacePrep(index_type aCutStart,
                                          size_type aCutLength,
                                          size_type aNewLength)
   {
     aCutLength = XPCOM_MIN(aCutLength, mLength - aCutStart);
     uint32_t newTotalLen = mLength - aCutLength + aNewLength;
-    if (aCutStart == mLength && Capacity() > newTotalLen)
-    {
+    if (aCutStart == mLength && Capacity() > newTotalLen) {
       mFlags &= ~F_VOIDED;
       mData[newTotalLen] = char_type(0);
       mLength = newTotalLen;
       return true;
     }
     return ReplacePrepInternal(aCutStart, aCutLength, aNewLength, newTotalLen);
   }
 
--- a/xpcom/threads/HangMonitor.h
+++ b/xpcom/threads/HangMonitor.h
@@ -35,17 +35,17 @@ void Startup();
 
 /**
  * Stop monitoring hangs and join the thread.
  */
 void Shutdown();
 
 /**
  * Notify the hang monitor of activity which will reset its internal timer.
- * 
+ *
  * @param activityType The type of activity being reported.
  * @see ActivityType
  */
 void NotifyActivity(ActivityType activityType = kGeneralActivity);
 
 /*
  * Notify the hang monitor that the browser is now idle and no detection should
  * be done.
--- a/xpcom/threads/nsTimerImpl.h
+++ b/xpcom/threads/nsTimerImpl.h
@@ -57,17 +57,17 @@ public:
   static void Shutdown();
 
   friend class TimerThread;
   friend struct TimerAdditionComparator;
 
   void Fire();
   // If a failure is encountered, the reference is returned to the caller
   static already_AddRefed<nsTimerImpl> PostTimerEvent(
-      already_AddRefed<nsTimerImpl> aTimerRef);
+    already_AddRefed<nsTimerImpl> aTimerRef);
   void SetDelayInternal(uint32_t aDelay);
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITIMER
 
   int32_t GetGeneration()
   {
     return mGeneration;