Bug 1508472 - Part 5: Fifth batch of comment fix-ups in preparation for the tree reformat r=sylvestre
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 29 Nov 2018 10:30:46 +0000
changeset 507921 04f0bbf40bf36957dc1f72a8aae9916df0e3222f
parent 507920 3e5ea9da2cbbb0e9ac5d27a277f921ca9d470c85
child 507922 e5dd0884d82f63374310093d48dc12ad7cf726c8
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssylvestre
bugs1508472
milestone65.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 1508472 - Part 5: Fifth batch of comment fix-ups in preparation for the tree reformat r=sylvestre This is a best effort attempt at ensuring that the adverse impact of reformatting the entire tree over the comments would be minimal. I've used a combination of strategies including disabling of formatting, some manual formatting and some changes to formatting to work around some clang-format limitations. Differential Revision: https://phabricator.services.mozilla.com/D13371
modules/libjar/nsZipArchive.h
mozglue/misc/nsWindowsDllInterceptor.h
netwerk/base/EventTokenBucket.h
netwerk/base/nsFileStreams.cpp
netwerk/base/nsFileStreams.h
netwerk/cache/nsCacheEntry.cpp
netwerk/cache/nsCacheService.cpp
netwerk/cache/nsDiskCacheBinding.h
netwerk/cache/nsDiskCacheBlockFile.cpp
netwerk/cache/nsDiskCacheMap.cpp
netwerk/cache/nsDiskCacheMap.h
netwerk/cache2/CacheEntry.cpp
netwerk/cache2/CacheEntry.h
netwerk/cache2/CacheFileIOManager.h
netwerk/cache2/CacheFileOutputStream.cpp
netwerk/cookie/nsCookieService.cpp
netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.h
netwerk/dns/nsHostResolver.h
netwerk/protocol/http/AlternateServices.h
netwerk/protocol/http/TunnelUtils.h
netwerk/protocol/http/nsHttpConnectionMgr.h
netwerk/protocol/http/nsHttpResponseHead.cpp
netwerk/protocol/http/nsServerTiming.cpp
netwerk/sctp/datachannel/DataChannel.cpp
netwerk/sctp/datachannel/DataChannelProtocol.h
netwerk/streamconv/converters/ParseFTPList.cpp
netwerk/streamconv/converters/mozTXTToHTMLConv.h
netwerk/streamconv/converters/nsMultiMixedConv.cpp
netwerk/streamconv/converters/nsMultiMixedConv.h
parser/htmlparser/nsParser.h
parser/htmlparser/nsScannerString.cpp
security/certverifier/ExtendedValidation.cpp
security/certverifier/tests/gtest/TrustOverrideTest.cpp
security/manager/ssl/tests/gtest/DeserializeCertTest.cpp
startupcache/StartupCache.h
startupcache/StartupCacheUtils.h
startupcache/test/TestStartupCache.cpp
toolkit/components/alerts/nsAlertsService.h
toolkit/components/ctypes/ctypes.cpp
toolkit/components/ctypes/ctypes.h
toolkit/components/ctypes/tests/jsctypes-test-errno.cpp
toolkit/components/ctypes/tests/jsctypes-test-errno.h
toolkit/components/ctypes/tests/jsctypes-test.cpp
toolkit/components/ctypes/tests/jsctypes-test.h
toolkit/components/extensions/DocumentObserver.h
toolkit/components/extensions/ExtensionPolicyService.cpp
toolkit/components/extensions/ExtensionPolicyService.h
toolkit/components/extensions/MatchGlob.h
toolkit/components/extensions/MatchPattern.cpp
toolkit/components/extensions/MatchPattern.h
toolkit/components/extensions/WebExtensionContentScript.h
toolkit/components/extensions/WebExtensionPolicy.cpp
toolkit/components/extensions/WebExtensionPolicy.h
toolkit/components/extensions/webrequest/ChannelWrapper.h
toolkit/components/extensions/webrequest/StreamFilter.h
toolkit/components/extensions/webrequest/StreamFilterEvents.cpp
toolkit/components/extensions/webrequest/StreamFilterEvents.h
toolkit/components/filewatcher/NativeFileWatcherWin.cpp
toolkit/components/perf/PerfMeasurement.cpp
toolkit/components/perf/PerfMeasurement.h
toolkit/components/places/nsPlacesTables.h
toolkit/components/reflect/reflect.cpp
toolkit/components/reflect/reflect.h
toolkit/components/resistfingerprinting/KeyCodeConsensus_En_US.h
toolkit/components/resistfingerprinting/nsRFPService.cpp
toolkit/components/resistfingerprinting/nsRFPService.h
toolkit/components/resistfingerprinting/tests/test_reduceprecision.cpp
toolkit/components/telemetry/core/EventInfo.h
toolkit/components/telemetry/core/ScalarInfo.h
toolkit/components/telemetry/core/Stopwatch.h
toolkit/components/telemetry/core/Telemetry.h
toolkit/components/telemetry/core/TelemetryCommon.h
toolkit/components/telemetry/core/TelemetryEvent.h
toolkit/components/telemetry/core/TelemetryHistogram.cpp
toolkit/components/telemetry/core/TelemetryHistogram.h
toolkit/components/telemetry/core/TelemetryScalar.cpp
toolkit/components/telemetry/core/TelemetryScalar.h
toolkit/components/telemetry/core/ipc/TelemetryComms.h
toolkit/components/telemetry/core/ipc/TelemetryIPC.h
toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.h
toolkit/components/telemetry/geckoview/TelemetryGeckoViewPersistence.cpp
toolkit/components/telemetry/other/CombinedStacks.h
toolkit/components/telemetry/other/KeyedStackCapturer.h
toolkit/components/terminator/nsTerminator.cpp
toolkit/crashreporter/LoadLibraryRemote.cpp
toolkit/mozapps/update/common/readstrings.cpp
toolkit/recordreplay/ProcessRedirectDarwin.cpp
toolkit/system/unixproxy/nsLibProxySettings.cpp
toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
toolkit/system/windowsDHCPClient/DHCPUtils.cpp
toolkit/system/windowsDHCPClient/nsWindowsDHCPClient.cpp
toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp
toolkit/xre/glxtest.cpp
tools/profiler/core/ProfileBufferEntry.h
tools/profiler/public/GeckoProfiler.h
tools/profiler/public/ProfilerCounts.h
uriloader/exthandler/HandlerServiceParent.cpp
uriloader/exthandler/mac/nsOSHelperAppService.h
uriloader/exthandler/unix/nsOSHelperAppService.h
view/nsView.h
view/nsViewManager.h
widget/android/AndroidAlerts.cpp
widget/android/AndroidAlerts.h
widget/android/AndroidColors.h
widget/android/nsAppShell.cpp
widget/android/nsAppShell.h
widget/cocoa/SwipeTracker.h
widget/cocoa/nsCursorManager.h
widget/cocoa/nsMacCursor.h
widget/gtk/nsClipboardWayland.cpp
widget/gtk/nsPrintSettingsGTK.h
widget/nsBaseWidget.cpp
widget/nsIWidget.h
widget/windows/GfxInfo.cpp
widget/windows/WinUtils.cpp
widget/windows/nsClipboard.cpp
widget/windows/nsWindow.cpp
widget/x11/keysym2ucs.c
xpcom/base/MemoryMapping.cpp
xpcom/build/MainThreadIOLogger.cpp
xpcom/ds/nsGkAtoms.h
xpcom/ds/nsTArray-inl.h
xpcom/ds/nsTHashtable.h
xpcom/io/nsLinebreakConverter.h
xpcom/io/nsLocalFileCommon.cpp
xpcom/string/nsStringIterator.h
xpcom/string/nsStringObsolete.cpp
xpcom/string/nsTString.h
xpcom/string/nsTSubstring.cpp
xpcom/threads/Queue.h
xpcom/threads/nsThreadUtils.h
--- a/modules/libjar/nsZipArchive.h
+++ b/modules/libjar/nsZipArchive.h
@@ -271,17 +271,18 @@ class nsZipCursor final
 {
 public:
   /**
    * Initializes the cursor
    *
    * @param   aItem       Item of interest
    * @param   aZip        Archive
    * @param   aBuf        Buffer used for decompression.
-   *                      This determines the maximum Read() size in the compressed case.
+   *                      This determines the maximum Read() size in the
+   *                      compressed case.
    * @param   aBufSize    Buffer size
    * @param   doCRC       When set to true Read() will check crc
    */
   nsZipCursor(nsZipItem *aItem, nsZipArchive *aZip, uint8_t* aBuf = nullptr, uint32_t aBufSize = 0, bool doCRC = false);
 
   ~nsZipCursor();
 
   /**
--- a/mozglue/misc/nsWindowsDllInterceptor.h
+++ b/mozglue/misc/nsWindowsDllInterceptor.h
@@ -39,17 +39,18 @@
  * begin with a two-byte nop (mov edi, edi) and are preceeded by five bytes of
  * NOP instructions.
  *
  * When we detect a function with this prelude, we do the following:
  *
  * 1. Write a long jump to our interceptor function into the five bytes of NOPs
  *    before the function.
  *
- * 2. Write a short jump -5 into the two-byte nop at the beginning of the function.
+ * 2. Write a short jump -5 into the two-byte nop at the beginning of the
+ *    function.
  *
  * This mechanism is nice because it's thread-safe.  It's even safe to do if
  * another thread is currently running the function we're modifying!
  *
  * When the WindowsDllNopSpacePatcher is destroyed, we overwrite the short jump
  * but not the long jump, so re-intercepting the same function won't work,
  * because its prelude won't match.
  *
--- a/netwerk/base/EventTokenBucket.h
+++ b/netwerk/base/EventTokenBucket.h
@@ -30,38 +30,41 @@ namespace net {
    The token bucket can be perfectly smooth or allow a configurable amount of
    burstiness. A bursty token bucket allows you to save up unused credits, while
    a perfectly smooth one would not. A smooth "1 per day" cake token bucket
    would require 9 days to eat that cake if you skipped a slice on day 4
    (use the token or lose it), while a token bucket configured with a burst
    of 2 would just let you eat 2 slices on day 5 (the credits for day 4 and day
    5) and finish the cake in the usual 8 days.
 
-   EventTokenBucket(hz=20, burst=5) creates a token bucket with the following properties:
+   EventTokenBucket(hz=20, burst=5) creates a token bucket with the following
+   properties:
 
   + events from an infinite stream will be admitted 20 times per second (i.e.
-    hz=20 means 1 event per 50 ms). Timers will be used to space things evenly down to
-    5ms gaps (i.e. up to 200hz). Token buckets with rates greater than 200hz will admit
-    multiple events with 5ms gaps between them. 10000hz is the maximum rate and 1hz is
-    the minimum rate.
+    hz=20 means 1 event per 50 ms). Timers will be used to space things evenly
+    down to 5ms gaps (i.e. up to 200hz). Token buckets with rates greater than
+    200hz will admit multiple events with 5ms gaps between them. 10000hz is the
+    maximum rate and 1hz is the minimum rate.
 
-  + The burst size controls the limit of 'credits' that a token bucket can accumulate
-    when idle. For our (20,5) example each event requires 50ms of credit (again, 20hz = 50ms
-    per event). a burst size of 5 means that the token bucket can accumulate a
-    maximum of 250ms (5 * 50ms) for this bucket. If no events have been admitted for the
-    last full second the bucket can still only accumulate 250ms of credit - but that credit
-    means that 5 events can be admitted without delay. A burst size of 1 is the minimum.
-    The EventTokenBucket is created with maximum credits already applied, but they
-    can be cleared with the ClearCredits() method. The maximum burst size is
-    15 minutes worth of events.
+  + The burst size controls the limit of 'credits' that a token bucket can
+    accumulate when idle. For our (20,5) example each event requires 50ms of
+    credit (again, 20hz = 50ms per event). a burst size of 5 means that the
+    token bucket can accumulate a maximum of 250ms (5 * 50ms) for this bucket.
+    If no events have been admitted for the last full second the bucket can
+    still only accumulate 250ms of credit - but that credit means that 5 events
+    can be admitted without delay. A burst size of 1 is the minimum.  The
+    EventTokenBucket is created with maximum credits already applied, but they
+    can be cleared with the ClearCredits() method. The maximum burst size is 15
+    minutes worth of events.
 
-  + An event is submitted to the token bucket asynchronously through SubmitEvent().
-    The OnTokenBucketAdmitted() method of the submitted event is used as a callback
-    when the event is ready to run. A cancelable event is returned to the SubmitEvent() caller
-    for use in the case they do not wish to wait for the callback.
+  + An event is submitted to the token bucket asynchronously through
+    SubmitEvent().  The OnTokenBucketAdmitted() method of the submitted event
+    is used as a callback when the event is ready to run. A cancelable event is
+    returned to the SubmitEvent() caller for use in the case they do not wish
+    to wait for the callback.
 */
 
 class EventTokenBucket;
 
 class ATokenBucketEvent
 {
 public:
   virtual void OnTokenBucketAdmitted() = 0;
--- a/netwerk/base/nsFileStreams.cpp
+++ b/netwerk/base/nsFileStreams.cpp
@@ -798,19 +798,21 @@ nsAtomicFileOutputStream::DoOpen()
     }
     nsresult rv = file->Exists(&mTargetFileExists);
     if (NS_FAILED(rv)) {
         NS_ERROR("Can't tell if target file exists");
         mTargetFileExists = true; // Safer to assume it exists - we just do more work.
     }
 
     // follow symlinks, for two reasons:
-    // 1) if a user has deliberately set up a profile file as a symlink, we honor it
-    // 2) to make the MoveToNative() in Finish() an atomic operation (which may not
-    //    be the case if moving across directories on different filesystems).
+    // 1) if a user has deliberately set up a profile file as a symlink, we
+    //    honor it
+    // 2) to make the MoveToNative() in Finish() an atomic operation (which may
+    //    not be the case if moving across directories on different
+    //    filesystems).
     nsCOMPtr<nsIFile> tempResult;
     rv = file->Clone(getter_AddRefs(tempResult));
     if (NS_SUCCEEDED(rv)) {
         tempResult->SetFollowLinks(true);
 
         // XP_UNIX ignores SetFollowLinks(), so we have to normalize.
         if (mTargetFileExists) {
             tempResult->Normalize();
--- a/netwerk/base/nsFileStreams.h
+++ b/netwerk/base/nsFileStreams.h
@@ -1,9 +1,9 @@
-// /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsFileStreams_h__
 #define nsFileStreams_h__
 
 #include "nsAutoPtr.h"
--- a/netwerk/cache/nsCacheEntry.cpp
+++ b/netwerk/cache/nsCacheEntry.cpp
@@ -123,17 +123,18 @@ nsCacheEntry::TouchMetaData()
 }
 
 
 /**
  *  cache entry states
  *      0 descriptors (new entry)
  *      0 descriptors (existing, bound entry)
  *      n descriptors (existing, bound entry) valid
- *      n descriptors (existing, bound entry) not valid (wait until valid or doomed)
+ *      n descriptors (existing, bound entry) not valid (wait until valid or
+ *                    doomed)
  */
 
 nsresult
 nsCacheEntry::RequestAccess(nsCacheRequest * request, nsCacheAccessMode *accessGranted)
 {
     nsresult  rv = NS_OK;
 
     if (IsDoomed()) return NS_ERROR_CACHE_ENTRY_DOOMED;
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -2868,17 +2868,20 @@ nsCacheService::ProcessPendingRequests(n
 
                 if (NS_FAILED(rv)) {
                     // XXX what to do?
                 }
             } else if (entry->IsValid() || newWriter) {
                 rv = entry->RequestAccess(request, &accessGranted);
                 NS_ASSERTION(NS_SUCCEEDED(rv),
                              "if entry is valid, RequestAccess must succeed.");
-                // XXX if (newWriter)  NS_ASSERTION( accessGranted == request->AccessRequested(), "why not?");
+                // XXX if (newWriter) {
+                //       NS_ASSERTION( accessGranted ==
+                //                     request->AccessRequested(), "why not?");
+                //     }
 
                 // entry->CreateDescriptor dequeues request, and queues descriptor
                 nsICacheEntryDescriptor *descriptor = nullptr;
                 rv = entry->CreateDescriptor(request,
                                              accessGranted,
                                              &descriptor);
 
                 // post call to listener to report error or descriptor
--- a/netwerk/cache/nsDiskCacheBinding.h
+++ b/netwerk/cache/nsDiskCacheBinding.h
@@ -68,21 +68,23 @@ nsDiskCacheBinding *   GetCacheEntryBind
 /******************************************************************************
  *  nsDiskCacheBindery
  *
  *  Used to keep track of nsDiskCacheBinding associated with active/bound (and
  *  possibly doomed) entries.  Lookups on 4 byte disk hash to find collisions
  *  (which need to be doomed, instead of just evicted.  Collisions are linked
  *  using a PRCList to keep track of current generation number.
  *
- *  Used to detect hash number collisions, and find available generation numbers.
+ *  Used to detect hash number collisions, and find available generation
+ *  numbers.
  *
  *  Not all nsDiskCacheBinding have a generation number.
  *
- *  Generation numbers may be aquired late, or lost (when data fits in block file)
+ *  Generation numbers may be aquired late, or lost (when data fits in block
+ *  file)
  *
  *  Collisions can occur:
  *      BindEntry()       - hashnumbers collide (possibly different keys)
  *
  *  Generation number required:
  *      DeactivateEntry() - metadata written to disk, may require file
  *      GetFileForEntry() - force data to require file
  *      writing to stream - data size may require file
--- a/netwerk/cache/nsDiskCacheBlockFile.cpp
+++ b/netwerk/cache/nsDiskCacheBlockFile.cpp
@@ -356,17 +356,18 @@ nsDiskCacheBlockFile::CalcBlockFileSize(
     }
 
     return estimatedSize;
 }
 
 /******************************************************************************
  *  Write
  *
- *  Wrapper around PR_Write that grows file in larger chunks to combat fragmentation
+ *  Wrapper around PR_Write that grows file in larger chunks to combat
+ *  fragmentation
  *
  *****************************************************************************/
 bool
 nsDiskCacheBlockFile::Write(int32_t offset, const void *buf, int32_t amount)
 {
     /* Grow the file to 4mb right away, then double it until the file grows to 20mb.
        20mb is a magic threshold because OSX stops autodefragging files bigger than that.
        Beyond 20mb grow in 4mb chunks.
--- a/netwerk/cache/nsDiskCacheMap.cpp
+++ b/netwerk/cache/nsDiskCacheMap.cpp
@@ -621,17 +621,18 @@ nsDiskCacheMap::VisitRecords( nsDiskCach
     }
     return NS_OK;
 }
 
 
 /**
  *  EvictRecords
  *
- *  Just like VisitRecords, but visits the records in order of their eviction rank
+ *  Just like VisitRecords, but visits the records in order of their eviction
+ *  rank
  */
 nsresult
 nsDiskCacheMap::EvictRecords( nsDiskCacheRecordVisitor * visitor)
 {
     uint32_t  tempRank[kBuckets];
     int       bucketIndex = 0;
 
     // copy eviction rank array
--- a/netwerk/cache/nsDiskCacheMap.h
+++ b/netwerk/cache/nsDiskCacheMap.h
@@ -18,16 +18,17 @@
 
 #include "nsDiskCache.h"
 #include "nsDiskCacheBlockFile.h"
 
 
 class nsDiskCacheBinding;
 struct nsDiskCacheEntry;
 
+// clang-format off
 /******************************************************************************
  *  nsDiskCacheRecord
  *
  *   Cache Location Format
  *
  *    1000 0000 0000 0000 0000 0000 0000 0000 : initialized bit
  *
  *    0011 0000 0000 0000 0000 0000 0000 0000 : File Selector (0 = separate file)
@@ -44,16 +45,17 @@ struct nsDiskCacheEntry;
  *      2 = 1k block file
  *      3 = 4k block file
  *
  *  eFileSizeMask note:  Files larger than 65535 KiB have this limit stored in
  *                       the location.  The file itself must be examined to
  *                       determine its actual size if necessary.
  *
  *****************************************************************************/
+// clang-format on
 
 /*
   We have 3 block files with roughly the same max size (32MB)
     1 - block size 256B, number of blocks 131072
     2 - block size  1kB, number of blocks  32768
     3 - block size  4kB, number of blocks   8192
 */
 #define kNumBlockFiles             3
--- a/netwerk/cache2/CacheEntry.cpp
+++ b/netwerk/cache2/CacheEntry.cpp
@@ -385,19 +385,20 @@ bool CacheEntry::Load(bool aTruncate, bo
   nsresult rv;
 
   nsAutoCString fileKey;
   rv = HashingKeyWithStorage(fileKey);
 
   bool reportMiss = false;
 
   // Check the index under two conditions for two states and take appropriate action:
-  // 1. When this is a disk entry and not told to truncate, check there is a disk file.
-  //    If not, set the 'truncate' flag to true so that this entry will open instantly
-  //    as a new one.
+  // 1. When this is a disk entry and not told to truncate, check there is a
+  //    disk file.
+  //    If not, set the 'truncate' flag to true so that this entry will open
+  //    instantly as a new one.
   // 2. When this is a memory-only entry, check there is a disk file.
   //    If there is or could be, doom that file.
   if ((!aTruncate || !mUseDisk) && NS_SUCCEEDED(rv)) {
     // Check the index right now to know we have or have not the entry
     // as soon as possible.
     CacheIndex::EntryStatus status;
     if (NS_SUCCEEDED(CacheIndex::HasEntry(fileKey, &status))) {
       switch (status) {
--- a/netwerk/cache2/CacheEntry.h
+++ b/netwerk/cache2/CacheEntry.h
@@ -348,22 +348,23 @@ private:
   bool mIsDoomed;
 
   // Following flags are all synchronized with the cache entry lock.
 
   // Whether security info has already been looked up in metadata.
   bool mSecurityInfoLoaded : 1;
   // Prevents any callback invocation
   bool mPreventCallbacks : 1;
-  // true: after load and an existing file, or after output stream has been opened.
-  //       note - when opening an input stream, and this flag is false, output stream
-  //       is open along ; this makes input streams on new entries behave correctly
-  //       when EOF is reached (WOULD_BLOCK is returned).
-  // false: after load and a new file, or dropped to back to false when a writer
-  //        fails to open an output stream.
+  // true: after load and an existing file, or after output stream has been
+  //       opened.
+  //       note - when opening an input stream, and this flag is false, output
+  //       stream is open along ; this makes input streams on new entries
+  //       behave correctly when EOF is reached (WOULD_BLOCK is returned).
+  // false: after load and a new file, or dropped to back to false when a
+  //        writer fails to open an output stream.
   bool mHasData : 1;
   // The indication of pinning this entry was open with
   bool mPinned : 1;
   // Whether the pinning state of the entry is known (equals to the actual state
   // of the cache file)
   bool mPinningKnown : 1;
 
   static char const * StateString(uint32_t aState);
--- a/netwerk/cache2/CacheFileIOManager.h
+++ b/netwerk/cache2/CacheFileIOManager.h
@@ -103,17 +103,18 @@ private:
 
   // Both initially false.  Can be raised to true only when this handle is to be doomed
   // during the period when the pinning status is unknown.  After the pinning status
   // determination we check these flags and possibly doom.
   // These flags are only accessed on the IO thread.
   bool                 mDoomWhenFoundPinned : 1;
   bool                 mDoomWhenFoundNonPinned : 1;
   // Set when after shutdown AND:
-  // - when writing: writing data (not metadata) OR the physical file handle is not currently open
+  // - when writing: writing data (not metadata) OR the physical file handle is
+  //   not currently open
   // - when truncating: the physical file handle is not currently open
   // When set it prevents any further writes or truncates on such handles to happen immediately
   // after shutdown and gives a chance to write metadata of already open files quickly as possible
   // (only that renders them actually usable by the cache.)
   bool                 mKilled : 1;
   // For existing files this is always pre-set to UNKNOWN.  The status is udpated accordingly
   // after the matadata has been parsed.
   // For new files the flag is set according to which storage kind is opening
@@ -303,17 +304,18 @@ public:
                        char *aBuf, int32_t aCount,
                        CacheFileIOListener *aCallback);
   static nsresult Write(CacheFileHandle *aHandle, int64_t aOffset,
                         const char *aBuf, int32_t aCount, bool aValidate,
                         bool aTruncate, CacheFileIOListener *aCallback);
   // PinningDoomRestriction:
   // NO_RESTRICTION
   //    no restriction is checked, the file is simply always doomed
-  // DOOM_WHEN_(NON)_PINNED, we branch based on the pinning status of the handle:
+  // DOOM_WHEN_(NON)_PINNED, we branch based on the pinning status of the
+  // handle:
   //   UNKNOWN: the handle is marked to be doomed when later found (non)pinned
   //   PINNED/NON_PINNED: doom only when the restriction matches the pin status
   //      and the handle has not yet been required to doom during the UNKNOWN
   //      period
   enum PinningDoomRestriction {
     NO_RESTRICTION,
     DOOM_WHEN_NON_PINNED,
     DOOM_WHEN_PINNED
--- a/netwerk/cache2/CacheFileOutputStream.cpp
+++ b/netwerk/cache2/CacheFileOutputStream.cpp
@@ -470,17 +470,18 @@ CacheFileOutputStream::NotifyListener()
   asyncCallback->OnOutputStreamReady(this);
 }
 
 // Memory reporting
 
 size_t
 CacheFileOutputStream::SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const
 {
-  // Everything the stream keeps a reference to is already reported somewhere else.
+  // Everything the stream keeps a reference to is already reported somewhere
+  // else.
   // mFile reports itself.
   // mChunk reported as part of CacheFile.
   // mCloseListener is CacheEntry, already reported.
   // mCallback is usually CacheFile or a class that is reported elsewhere.
   return mallocSizeOf(this);
 }
 
 } // namespace net
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -3854,16 +3854,17 @@ nsCookieService::AddInternal(const nsCoo
   NotifyChanged(aCookie, foundCookie ? u"changed" : u"added", oldCookieIsSession, aFromHttp);
 }
 
 /******************************************************************************
  * nsCookieService impl:
  * private cookie header parsing functions
  ******************************************************************************/
 
+// clang-format off
 // The following comment block elucidates the function of ParseAttributes.
 /******************************************************************************
  ** Augmented BNF, modified from RFC2109 Section 4.2.2 and RFC2616 Section 2.1
  ** please note: this BNF deviates from both specifications, and reflects this
  ** implementation. <bnf> indicates a reference to the defined grammar "bnf".
 
  ** Differences from RFC2109/2616 and explanations:
     1. implied *LWS
@@ -3922,16 +3923,17 @@ nsCookieService::AddInternal(const nsCoo
                   | "Expires" "=" value
                   | "Max-Age" "=" value
                   | "Comment" "=" value
                   | "Version" "=" value
                   | "Secure"
                   | "HttpOnly"
 
 ******************************************************************************/
+// clang-format on
 
 // helper functions for GetTokenValue
 static inline bool iswhitespace     (char c) { return c == ' '  || c == '\t'; }
 static inline bool isterminator     (char c) { return c == '\n' || c == '\r'; }
 static inline bool isvalueseparator (char c) { return isterminator(c) || c == ';'; }
 static inline bool istokenseparator (char c) { return isvalueseparator(c) || c == '='; }
 
 // Parse a single token/value pair.
--- a/netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.h
+++ b/netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.h
@@ -21,18 +21,18 @@ class nsDNSServiceDiscovery final : publ
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIDNSSERVICEDISCOVERY
 
   explicit nsDNSServiceDiscovery() = default;
 
   /*
-  ** The mDNS service is started on demand. If no one uses, mDNS service will not
-  ** start. Therefore, all operations before service started will fail
+  ** The mDNS service is started on demand. If no one uses, mDNS service will
+  ** not start. Therefore, all operations before service started will fail
   ** and get error code |kDNSServiceErr_ServiceNotRunning| defined in dns_sd.h.
   **/
   nsresult Init();
 
   nsresult StopDiscovery(nsIDNSServiceDiscoveryListener* aListener);
   nsresult UnregisterService(nsIDNSRegistrationListener* aListener);
 
 private:
--- a/netwerk/dns/nsHostResolver.h
+++ b/netwerk/dns/nsHostResolver.h
@@ -134,20 +134,21 @@ protected:
     // If a record is in its grace period (and not expired), it will be used
     // but a request to refresh it will be made.
     mozilla::TimeStamp mGraceStart;
 
     mozilla::net::ResolverMode mResolverMode;
 
     uint16_t  mResolving;  // counter of outstanding resolving calls
 
-    uint8_t negative : 1;   /* True if this record is a cache of a failed lookup.
-                               Negative cache entries are valid just like any other
-                               (though never for more than 60 seconds), but a use
-                               of that negative entry forces an asynchronous refresh. */
+    uint8_t negative : 1;   /* True if this record is a cache of a failed
+                               lookup.  Negative cache entries are valid just
+                               like any other (though never for more than 60
+                               seconds), but a use of that negative entry
+                               forces an asynchronous refresh. */
     uint8_t mDoomed : 1;    // explicitly expired
 };
 
 // b020e996-f6ab-45e5-9bf5-1da71dd0053a
 #define ADDRHOSTRECORD_IID \
 { 0xb020e996, 0xf6ab, 0x45e5, {0x9b, 0xf5, 0x1d, 0xa7, 0x1d, 0xd0, 0x05, 0x3a }}
 
 class AddrHostRecord final : public nsHostRecord
@@ -225,18 +226,20 @@ private:
     uint8_t   mTRRSuccess; // number of successful TRR responses
     uint8_t   mNativeSuccess; // number of native lookup responses
 
     uint16_t    mNative : 1;     // true if this record is being resolved "natively",
                                  // which means that it is either on the pending queue
                                  // or owned by one of the worker threads. */
     uint16_t    mTRRUsed : 1;    // TRR was used on this record
     uint16_t    mNativeUsed : 1;
-    uint16_t    onQueue : 1;    // true if pending and on the queue (not yet given to getaddrinfo())
-    uint16_t    usingAnyThread : 1; // true if off queue and contributing to mActiveAnyThreadCount
+    uint16_t    onQueue : 1;    // true if pending and on the queue (not yet
+                                // given to getaddrinfo())
+    uint16_t    usingAnyThread : 1; // true if off queue and contributing to
+                                    // mActiveAnyThreadCount
     uint16_t    mDidCallbacks : 1;
     uint16_t    mGetTtl : 1;
 
     // when the results from this resolve is returned, it is not to be
     // trusted, but instead a new resolve must be made!
     uint16_t    mResolveAgain : 1;
 
     enum {
--- a/netwerk/protocol/http/AlternateServices.h
+++ b/netwerk/protocol/http/AlternateServices.h
@@ -9,17 +9,18 @@ Alt-Svc allows separation of transport r
 using a proxy. See https://httpwg.github.io/http-extensions/alt-svc.html and
 https://tools.ietf.org/html/draft-ietf-httpbis-alt-svc-06
 
  Nice To Have Future Enhancements::
  * flush on network change event when we have an indicator
  * use established https channel for http instead separate of conninfo hash
  * pin via http-tls header
  * clear based on origin when a random fail happens not just 421
- * upon establishment of channel, cancel and retry trans that have not yet written anything
+ * upon establishment of channel, cancel and retry trans that have not yet
+     written anything
  * persistent storage (including private browsing filter)
  * memory reporter for cache, but this is rather tiny
 */
 
 #ifndef mozilla_net_AlternateServices_h
 #define mozilla_net_AlternateServices_h
 
 #include "mozilla/DataStorage.h"
--- a/netwerk/protocol/http/TunnelUtils.h
+++ b/netwerk/protocol/http/TunnelUtils.h
@@ -52,31 +52,36 @@ now pop the stack back up to SpdyConnect
 that has been read is stored mInputData
 
   SpdyConnectTransaction.mTunneledConn::OnInputStreamReady(mTunnelStreamIn)
   SpdyConnectTransaction.mTunneledConn::OnSocketReadable()
   TLSFilterTransaction::WriteSegment()
   nsHttpTransaction::WriteSegment(real http transaction)
   TLSFilterTransaction::OnWriteSegment() removes tls on way back up stack
   SpdyConnectTransaction.mTunneledConn::OnWriteSegment()
-  SpdyConnectTransaction.mTunneledConn.mTunnelStreamIn->Read() // gets data from mInputData
+  // gets data from mInputData
+  SpdyConnectTransaction.mTunneledConn.mTunnelStreamIn->Read()
 
 The output path works similarly:
   nsHttpConnection::OnOutputStreamReady (real socket)
   nsHttpConnection::OnSocketWritable()
   SpdySession::ReadSegments (locates tunnel)
   SpdyStream::ReadSegments (tunnel stream)
   SpdyConnectTransaction::ReadSegments()
   SpdyConnectTransaction.mTunneledConn::OnOutputStreamReady (tunnel connection)
   SpdyConnectTransaction.mTunneledConn::OnSocketWritable (tunnel connection)
   TLSFilterTransaction::ReadSegment()
-  nsHttpTransaction::ReadSegment (real http transaction generates plaintext on way down)
-  TLSFilterTransaction::OnReadSegment (BUF and LEN gets encrypted here on way down)
-  SpdyConnectTransaction.mTunneledConn::OnReadSegment (BUF and LEN) (tunnel connection)
-  SpdyConnectTransaction.mTunneledConn.mTunnelStreamOut->Write(BUF, LEN) .. get stored in mOutputData
+  nsHttpTransaction::ReadSegment (real http transaction generates plaintext on
+                                  way down)
+  TLSFilterTransaction::OnReadSegment (BUF and LEN gets encrypted here on way
+                                       down)
+  SpdyConnectTransaction.mTunneledConn::OnReadSegment (BUF and LEN)
+                                                      (tunnel connection)
+  SpdyConnectTransaction.mTunneledConn.mTunnelStreamOut->Write(BUF, LEN) ..
+                                                     get stored in mOutputData
 
 Now pop the stack back up to SpdyConnectTransaction::ReadSegment(), where it has
 the encrypted text available in mOutputData
 
   SpdyStream->OnReadSegment(BUF,LEN) from mOutputData. Tunnel stream
   SpdySession->OnReadSegment() // encrypted data gets put in a data frame
   nsHttpConnection->OnReadSegment()
   realSocketOut->write() writes data to network
--- a/netwerk/protocol/http/nsHttpConnectionMgr.h
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.h
@@ -579,20 +579,20 @@ private:
     MOZ_MUST_USE bool ProcessPendingQForEntry(nsConnectionEntry *,
                                               bool considerAll);
     bool DispatchPendingQ(nsTArray<RefPtr<PendingTransactionInfo>> &pendingQ,
                           nsConnectionEntry *ent,
                           bool considerAll);
 
     // This function selects transactions from mPendingTransactionTable to dispatch
     // according to the following conditions:
-    // 1. When ActiveTabPriority() is false, only get transactions from the queue
-    //    whose window id is 0.
-    // 2. If |considerAll| is false, either get transactions from the focused window
-    //    queue or non-focused ones.
+    // 1. When ActiveTabPriority() is false, only get transactions from the
+    //    queue whose window id is 0.
+    // 2. If |considerAll| is false, either get transactions from the focused
+    //    window queue or non-focused ones.
     // 3. If |considerAll| is true, fill the |pendingQ| with the transactions from
     //    both focused window and non-focused window queues.
     void PreparePendingQForDispatching(nsConnectionEntry *ent,
                                        nsTArray<RefPtr<PendingTransactionInfo>> &pendingQ,
                                        bool considerAll);
 
     // Return total active connection count, which is the sum of
     // active connections and unconnected half open connections.
--- a/netwerk/protocol/http/nsHttpResponseHead.cpp
+++ b/netwerk/protocol/http/nsHttpResponseHead.cpp
@@ -693,17 +693,18 @@ nsHttpResponseHead::ComputeCurrentAge(ui
 
 // From section 13.2.4 of RFC2616, we compute the freshness lifetime of a cached
 // response as follows:
 //
 //     freshnessLifetime = max_age_value
 // <or>
 //     freshnessLifetime = expires_value - date_value
 // <or>
-//     freshnessLifetime = min(one-week,(date_value - last_modified_value) * 0.10)
+//     freshnessLifetime = min(one-week,
+//                             (date_value - last_modified_value) * 0.10)
 // <or>
 //     freshnessLifetime = 0
 //
 nsresult
 nsHttpResponseHead::ComputeFreshnessLifetime(uint32_t *result)
 {
     RecursiveMutexAutoLock monitor(mRecursiveMutex);
     *result = 0;
--- a/netwerk/protocol/http/nsServerTiming.cpp
+++ b/netwerk/protocol/http/nsServerTiming.cpp
@@ -42,17 +42,18 @@ ParseDouble(const nsACString& aString)
 
 void
 ServerTimingParser::Parse()
 {
   // https://w3c.github.io/server-timing/#the-server-timing-header-field
   // Server-Timing             = #server-timing-metric
   // server-timing-metric      = metric-name *( OWS ";" OWS server-timing-param )
   // metric-name               = token
-  // server-timing-param       = server-timing-param-name OWS "=" OWS server-timing-param-value
+  // server-timing-param       = server-timing-param-name OWS "=" OWS
+  //                             server-timing-param-value
   // server-timing-param-name  = token
   // server-timing-param-value = token / quoted-string
 
   ParsedHeaderValueListList parsedHeader(mValue, false);
   for (uint32_t index = 0; index < parsedHeader.mValues.Length(); ++index) {
     if (parsedHeader.mValues[index].mValues.IsEmpty()) {
       continue;
     }
--- a/netwerk/sctp/datachannel/DataChannel.cpp
+++ b/netwerk/sctp/datachannel/DataChannel.cpp
@@ -1298,19 +1298,20 @@ DataChannelConnection::SendDeferredMessa
       continue;
     }
 
     size_t bufferedAmount = channel->GetBufferedAmountLocked();
     size_t threshold = channel->mBufferedThreshold;
     bool wasOverThreshold = bufferedAmount >= threshold;
 
     // Send buffered data messages
-    // Warning: This will fail in case ndata is inactive and a previously deallocated data channel
-    //          has not been closed properly. If you ever see that no messages can be sent on any
-    //          channel, this is likely the cause (an explicit EOR message partially sent whose
+    // Warning: This will fail in case ndata is inactive and a previously
+    //          deallocated data channel has not been closed properly. If you
+    //          ever see that no messages can be sent on any channel, this is
+    //          likely the cause (an explicit EOR message partially sent whose
     //          remaining chunks are still being waited for).
     blocked = SendBufferedMessages(channel->mBufferedData);
     bufferedAmount = channel->GetBufferedAmountLocked();
 
     // can never fire with default threshold of 0
     if (wasOverThreshold && bufferedAmount < threshold) {
       LOG(("%s: sending BUFFER_LOW_THRESHOLD for %s/%s: %u", __FUNCTION__,
            channel->mLabel.get(), channel->mProtocol.get(), channel->mStream));
@@ -1325,18 +1326,19 @@ DataChannelConnection::SendDeferredMessa
       LOG(("%s: sending NO_LONGER_BUFFERED for %s/%s: %u", __FUNCTION__,
            channel->mLabel.get(), channel->mProtocol.get(), channel->mStream));
       Dispatch(do_AddRef(new DataChannelOnMessageAvailable(
                  DataChannelOnMessageAvailable::NO_LONGER_BUFFERED,
                  this, channel)));
     }
 
     // Update current stream index
-    // Note: If ndata is not active, the outstanding data messages on this stream need to be sent
-    //       first before other streams can be used for sending.
+    // Note: If ndata is not active, the outstanding data messages on this
+    //       stream need to be sent first before other streams can be used for
+    //       sending.
     if (mSendInterleaved || !blocked) {
       i = UpdateCurrentStreamIndex();
     }
   } while (!blocked && i != end);
 
   if (!blocked) {
     mPendingType = mBufferedControl.IsEmpty() ? PENDING_NONE : PENDING_DCEP;
   }
@@ -1547,18 +1549,18 @@ DataChannelConnection::BufferMessage(nsA
 
     // Return directly if nothing has been buffered
     if (recvBuffer.IsEmpty()) {
       return bufferFlags;
     }
   }
 
   // Ensure it doesn't blow up our buffer
-  // TODO: Change 'WEBRTC_DATACHANNEL_MAX_MESSAGE_SIZE_LOCAL' to whatever the new buffer is capable
-  //       of holding.
+  // TODO: Change 'WEBRTC_DATACHANNEL_MAX_MESSAGE_SIZE_LOCAL' to whatever the
+  //       new buffer is capable of holding.
   if (((uint64_t) recvBuffer.Length()) + ((uint64_t) length) > WEBRTC_DATACHANNEL_MAX_MESSAGE_SIZE_LOCAL) {
     bufferFlags |= DATA_CHANNEL_BUFFER_MESSAGE_FLAGS_TOO_LARGE;
     return bufferFlags;
   }
 
   // Copy & add to receive buffer
   recvBuffer.Append(buffer, length);
   bufferFlags |= DATA_CHANNEL_BUFFER_MESSAGE_FLAGS_BUFFERED;
@@ -1877,18 +1879,18 @@ DataChannelConnection::HandleAssociation
           LOG(("Supports: MULTIBUF"));
           break;
         case SCTP_ASSOC_SUPPORTS_RE_CONFIG:
           LOG(("Supports: RE-CONFIG"));
           break;
 #if defined(SCTP_ASSOC_SUPPORTS_INTERLEAVING)
         case SCTP_ASSOC_SUPPORTS_INTERLEAVING:
           LOG(("Supports: NDATA"));
-          // TODO: This should probably be set earlier above in 'case SCTP_COMM_UP' but we also
-          //       need this for 'SCTP_RESTART'.
+          // TODO: This should probably be set earlier above in 'case
+          //       SCTP_COMM_UP' but we also need this for 'SCTP_RESTART'.
           mSendInterleaved = true;
           break;
 #endif
         default:
           LOG(("Supports: UNKNOWN(0x%02x)", sac->sac_info[i]));
           break;
         }
       }
@@ -2779,34 +2781,35 @@ DataChannelConnection::SendDataMsgIntern
 int
 DataChannelConnection::SendDataMsg(DataChannel &channel, const uint8_t *data, size_t len,
                                    uint32_t ppidPartial, uint32_t ppidFinal)
 {
   // We *really* don't want to do this from main thread! - and
   // SendDataMsgInternalOrBuffer avoids blocking.
 
   if (mPpidFragmentation) {
-    // TODO: Bug 1381136, remove this block and all other code that uses PPIDs for fragmentation
-    //       and reassembly once older Firefoxes without EOR are no longer supported as target
-    //       clients.
+    // TODO: Bug 1381136, remove this block and all other code that uses PPIDs
+    //       for fragmentation and reassembly once older Firefoxes without EOR
+    //       are no longer supported as target clients.
 
     // Use the deprecated PPID-level fragmentation if enabled. Should be enabled
     // in case we can be certain that the other peer is an older Firefox browser
     // that does support PPID-level fragmentation/reassembly.
 
     // PPID-level fragmentation can only be applied on reliable data channels.
     if (len > DATA_CHANNEL_MAX_BINARY_FRAGMENT &&
         channel.mPrPolicy == DATA_CHANNEL_RELIABLE &&
         !(channel.mFlags & DATA_CHANNEL_FLAGS_OUT_OF_ORDER_ALLOWED)) {
       LOG(("Sending data message (total=%zu) using deprecated PPID-based chunks", len));
 
       size_t left = len;
       while (left > 0) {
-        // Note: For correctness, chunkLen should also consider mMaxMessageSize as minimum but as
-        //       this block is going to be removed soon, I see no need for it.
+        // Note: For correctness, chunkLen should also consider mMaxMessageSize
+        //       as minimum but as this block is going to be removed soon, I
+        //       see no need for it.
         size_t chunkLen = std::min<size_t>(left, DATA_CHANNEL_MAX_BINARY_FRAGMENT);
         left -= chunkLen;
         uint32_t ppid = left > 0 ? ppidPartial : ppidFinal;
 
         // Send the chunk
         // Note that these might end up being deferred and queued.
         LOG(("Send chunk (len=%zu, left=%zu, total=%zu, ppid %u",
              chunkLen, left, len, ppid));
--- a/netwerk/sctp/datachannel/DataChannelProtocol.h
+++ b/netwerk/sctp/datachannel/DataChannelProtocol.h
@@ -19,18 +19,18 @@
 #define WEBRTC_DATACHANNEL_STREAMS_DEFAULT                 256
 // Do not change this value!
 #define WEBRTC_DATACHANNEL_STREAMS_OLDER_FIREFOX           256
 #define WEBRTC_DATACHANNEL_PORT_DEFAULT                    5000
 // TODO: Bug 1381146, change once we resolve the nsCString limitation
 #define WEBRTC_DATACHANNEL_MAX_MESSAGE_SIZE_LOCAL          1073741823
 #define WEBRTC_DATACHANNEL_MAX_MESSAGE_SIZE_REMOTE_DEFAULT 65536
 // TODO: Bug 1382779, once resolved, can be increased to min(Uint8ArrayMaxSize, UINT32_MAX)
-// TODO: Bug 1381146, once resolved, can be increased to whatever we support then (hopefully
-//       SIZE_MAX) or be removed
+// TODO: Bug 1381146, once resolved, can be increased to whatever we support
+//       then (hopefully SIZE_MAX) or be removed
 #define WEBRTC_DATACHANNEL_MAX_MESSAGE_SIZE_REMOTE         2147483637
 
 #define DATA_CHANNEL_PPID_CONTROL           50
 #define DATA_CHANNEL_PPID_BINARY_PARTIAL    52
 #define DATA_CHANNEL_PPID_BINARY            53
 #define DATA_CHANNEL_PPID_DOMSTRING_PARTIAL 54
 #define DATA_CHANNEL_PPID_DOMSTRING         51
 
--- a/netwerk/streamconv/converters/ParseFTPList.cpp
+++ b/netwerk/streamconv/converters/ParseFTPList.cpp
@@ -319,16 +319,17 @@ int ParseFTPList(const char *line, struc
                                     IsAsciiDigit(*tokens[2]) && /* date */
                                     IsAsciiDigit(*tokens[3])    /* time */
                 )
         {
           lstyle = 'V';
         }
         if (lstyle == 'V')
         {
+          // clang-format off
           /*
           * MultiNet FTP:
           *   LOGIN.COM;2                 1   4-NOV-1994 04:09 [ANONYMOUS] (RWE,RWE,,)
           *   PUB.DIR;1                   1  27-JAN-1994 14:46 [ANONYMOUS] (RWE,RWE,RE,RWE)
           *   README.FTP;1        %RMS-E-PRV, insufficient privilege or file protection violation
           *   ROUSSOS.DIR;1               1  27-JAN-1994 14:48 [CS,ROUSSOS] (RWE,RWE,RE,R)
           *   S67-50903.JPG;1           328  22-SEP-1998 16:19 [ANONYMOUS] (RWED,RWED,,)
           * UCX FTP:
@@ -336,16 +337,17 @@ int ParseFTPList(const char *line, struc
           * CMU/VMS-IP FTP
           *   [VMSSERV.FILES]ALARM.DIR;1 1/3 5-MAR-1993 18:09
           * TCPware FTP
           *   FOO.BAR;1 4 5-MAR-1993 18:09:01.12
           * Long filename example:
           *   THIS-IS-A-LONG-VMS-FILENAME.AND-THIS-IS-A-LONG-VMS-FILETYPE\r\n
           *                    213[/nnn]  29-JAN-1996 03:33[:nn]  [ANONYMOU,ANONYMOUS] (RWED,RWED,,)
           */
+          // clang-format on
           tokmarker = 0;
           p = tokens[0];
           pos = 0;
           if (*p == '[' && toklen[0] >= 4) /* CMU style */
           {
             if (p[1] != ']')
             {
               p++;
@@ -709,29 +711,31 @@ int ParseFTPList(const char *line, struc
     } /* VM/CMS */
 #endif
 
     /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
 
 #if defined(SUPPORT_DOS) /* WinNT DOS dirstyle */
     if (!lstyle && (!state->lstyle || state->lstyle == 'W'))
     {
+      // clang-format off
       /*
        * "10-23-00  01:27PM       <DIR>          veronist"
        * "06-15-00  07:37AM       <DIR>          zoe"
        * "07-14-00  01:35PM              2094926 canprankdesk.tif"
        * "07-21-00  01:19PM                95077 Jon Kauffman Enjoys the Good Life.jpg"
        * "07-21-00  01:19PM                52275 Name Plate.jpg"
        * "07-14-00  01:38PM              2250540 Valentineoffprank-HiRes.jpg"
       */
       // Microsoft FTP server with FtpDirBrowseShowLongDate set returns year
       // in 4-digit format:
       // "10-10-2014  10:10AM       <DIR>        FTP"
       // Windows CE FTP server returns time in 24-hour format:
       // "05-03-13  22:01       <DIR>          APPS"
+      // clang-format on
       if ((numtoks >= 4) && (toklen[0] == 8 || toklen[0] == 10) &&
           (toklen[1] == 5 || toklen[1] == 7) &&
           (*tokens[2] == '<' || IsAsciiDigit(*tokens[2])) )
       {
         p = tokens[0];
         if ( IsAsciiDigit(p[0]) && IsAsciiDigit(p[1]) && p[2]=='-' &&
              IsAsciiDigit(p[3]) && IsAsciiDigit(p[4]) && p[5]=='-' &&
              IsAsciiDigit(p[6]) && IsAsciiDigit(p[7]) )
--- a/netwerk/streamconv/converters/mozTXTToHTMLConv.h
+++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.h
@@ -247,17 +247,18 @@ private:
      const char16_t* tagTXT,
      int32_t aTagTxtLen,
      const char* tagHTML, const char* attributeHTML,
      nsString& aOutputString, uint32_t& openTags);
 
 /**
   @param text (in), col0 (in): see GlyphHit
   @param tagTXT (in): Smily, see also StructPhraseHit
-  @param imageName (in): the basename of the file that contains the image for this smilie
+  @param imageName (in): the basename of the file that contains the image for
+                         this smilie
   @param outputHTML (out): new string containing the html for the smily
   @param glyphTextLen (out): see GlyphHit
 */
   bool
          SmilyHit(const char16_t * aInString, int32_t aLength, bool col0,
          const char* tagTXT, const char* imageName,
          nsString& outputHTML, int32_t& glyphTextLen);
 
--- a/netwerk/streamconv/converters/nsMultiMixedConv.cpp
+++ b/netwerk/streamconv/converters/nsMultiMixedConv.cpp
@@ -450,19 +450,19 @@ nsMultiMixedConv::Convert(nsIInputStream
 NS_IMETHODIMP
 nsMultiMixedConv::AsyncConvertData(const char *aFromType, const char *aToType,
                                    nsIStreamListener *aListener, nsISupports *aCtxt) {
     NS_ASSERTION(aListener && aFromType && aToType, "null pointer passed into multi mixed converter");
 
     // hook up our final listener. this guy gets the various On*() calls we want to throw
     // at him.
     //
-    // WARNING: this listener must be able to handle multiple OnStartRequest, OnDataAvail()
-    //  and OnStopRequest() call combinations. We call of series of these for each sub-part
-    //  in the raw stream.
+    // WARNING: this listener must be able to handle multiple OnStartRequest,
+    // OnDataAvail() and OnStopRequest() call combinations. We call of series
+    // of these for each sub-part in the raw stream.
     mFinalListener = aListener;
 
     return NS_OK;
 }
 
 // nsIRequestObserver implementation
 NS_IMETHODIMP
 nsMultiMixedConv::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
--- a/netwerk/streamconv/converters/nsMultiMixedConv.h
+++ b/netwerk/streamconv/converters/nsMultiMixedConv.h
@@ -92,26 +92,28 @@ protected:
 // prompts various viewer related actions rather than stream conversion. There simply needs
 // to be a piece in place that can strip out the multiple parts of a stream of this type, and
 // "display" them accordingly.
 //
 // With that said, this "stream converter" spends more time packaging up the sub parts of the
 // main stream and sending them off the destination stream listener, than doing any real
 // stream parsing/converting.
 //
-// WARNING: This converter requires that it's destination stream listener be able to handle
-//   multiple OnStartRequest(), OnDataAvailable(), and OnStopRequest() call combinations.
-//   Each series represents the beginning, data production, and ending phase of each sub-
-//   part of the original stream.
+// WARNING: This converter requires that it's destination stream listener be
+//   able to handle multiple OnStartRequest(), OnDataAvailable(), and
+//   OnStopRequest() call combinations.  Each series represents the beginning,
+//   data production, and ending phase of each sub- part of the original
+//   stream.
 //
 // NOTE: this MIME-type is used by HTTP, *not* SMTP, or IMAP.
 //
-// NOTE: For reference, a general description of how this MIME type should be handled via
-//   HTTP, see http://home.netscape.com/assist/net_sites/pushpull.html . Note that
-//   real world server content deviates considerably from this overview.
+// NOTE: For reference, a general description of how this MIME type should be
+//   handled via HTTP, see
+//   http://home.netscape.com/assist/net_sites/pushpull.html . Note that real
+//   world server content deviates considerably from this overview.
 //
 // Implementation assumptions:
 //  Assumed structue:
 //  --BoundaryToken[\r]\n
 //  content-type: foo/bar[\r]\n
 //  ... (other headers if any)
 //  [\r]\n (second line feed to delimit end of headers)
 //  data
--- a/parser/htmlparser/nsParser.h
+++ b/parser/htmlparser/nsParser.h
@@ -273,17 +273,18 @@ class nsParser final : public nsIParser,
 
     /**
      * Always false.
      */
     virtual bool IsScriptCreated() override;
 
     /**  
      *  Set to parser state to indicate whether parsing tokens can be interrupted
-     *  @param aCanInterrupt true if parser can be interrupted, false if it can not be interrupted.
+     *  @param aCanInterrupt true if parser can be interrupted, false if it can
+     *                       not be interrupted.
      *  @update  kmcclusk 5/18/98
      */
     void SetCanInterrupt(bool aCanInterrupt);
 
     /**
      * This is called when the final chunk has been
      * passed to the parser and the content sink has
      * interrupted token processing. It schedules
--- a/parser/htmlparser/nsScannerString.cpp
+++ b/parser/htmlparser/nsScannerString.cpp
@@ -339,34 +339,37 @@ nsScannerString::DiscardPrefix( const ns
     mBufferList->DiscardUnreferencedPrefix(old_start.mBuffer);
 
     mIsDirty = true;
   }
 
 void
 nsScannerString::UngetReadable( const nsAString& aReadable, const nsScannerIterator& aInsertPoint )
     /*
-     * Warning: this routine manipulates the shared buffer list in an unexpected way.
-     *  The original design did not really allow for insertions, but this call promises
-     *  that if called for a point after the end of all extant token strings, that no token string
-     *  or the work string will be invalidated.
+     * Warning: this routine manipulates the shared buffer list in an
+     * unexpected way.  The original design did not really allow for
+     * insertions, but this call promises that if called for a point after the
+     * end of all extant token strings, that no token string or the work string
+     * will be invalidated.
      *
-     *  This routine is protected because it is the responsibility of the derived class to keep those promises.
+     * This routine is protected because it is the responsibility of the
+     * derived class to keep those promises.
      */
   {
     Position insertPos(aInsertPoint);
 
     mBufferList->SplitBuffer(insertPos);
-      // splitting to the right keeps the work string and any extant token pointing to and
-      //  holding a reference count on the same buffer
+      // splitting to the right keeps the work string and any extant token
+      // pointing to and holding a reference count on the same buffer
 
     Buffer* new_buffer = AllocBufferFromString(aReadable);
       // make a new buffer with all the data to insert...
-      //  BULLSHIT ALERT: we may have empty space to re-use in the split buffer, measure the cost
-      //  of this and decide if we should do the work to fill it
+      // BULLSHIT ALERT: we may have empty space to re-use in the split buffer,
+      // measure the cost of this and decide if we should do the work to fill
+      // it
 
     Buffer* buffer_to_split = insertPos.mBuffer;
     mBufferList->InsertAfter(new_buffer, buffer_to_split);
     mLength += aReadable.Length();
 
     mEnd.mBuffer = mBufferList->Tail();
     mEnd.mPosition = mEnd.mBuffer->DataEnd();
 
--- a/security/certverifier/ExtendedValidation.cpp
+++ b/security/certverifier/ExtendedValidation.cpp
@@ -82,25 +82,26 @@ struct EVInfo
 // OCSP signing certificate, or OCSP for the intermediate certificates
 // isn't working, or OCSP isn't working at all.
 
 #ifdef DEBUG
 static const size_t NUM_TEST_EV_ROOTS = 2;
 #endif
 
 static const struct EVInfo kEVInfos[] = {
+  // clang-format off
   // IMPORTANT! When extending this list, if you add another entry that uses
   // the same dottedOid as an existing entry, use the same oidName.
 #ifdef DEBUG
   // Debug EV certificates should all use the following OID:
   // 1.3.6.1.4.1.13769.666.666.666.1.500.9.1.
   // (multiple entries with the same OID is ok)
   // If you add or remove debug EV certs you must also modify NUM_TEST_EV_ROOTS
-  // so that the correct number of certs are skipped as these debug EV certs are
-  // NOT part of the default trust store.
+  // so that the correct number of certs are skipped as these debug EV certs
+  // are NOT part of the default trust store.
   {
     // This is the PSM xpcshell testing EV certificate. It can be generated
     // using pycert.py and the following specification:
     //
     // issuer:evroot
     // subject:evroot
     // subjectKey:ev
     // issuerKey:ev
@@ -887,16 +888,17 @@ static const struct EVInfo kEVInfos[] = 
     { 0x2E, 0x7B, 0xF1, 0x6C, 0xC2, 0x24, 0x85, 0xA7, 0xBB, 0xE2, 0xAA,
       0x86, 0x96, 0x75, 0x07, 0x61, 0xB0, 0xAE, 0x39, 0xBE, 0x3B, 0x2F,
       0xE9, 0xD0, 0xCC, 0x6D, 0x4E, 0xF7, 0x34, 0x91, 0x42, 0x5C },
     "MIGCMQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0"
     "b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjE3MDUGA1UEAwwuU1NMLmNvbSBF"
     "ViBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFJTQSBSMg==",
     "VrYpzTS8ePY=",
   },
+  // clang-format on
 };
 
 static SECOidTag sEVInfoOIDTags[ArrayLength(kEVInfos)];
 
 static_assert(SEC_OID_UNKNOWN == 0,
   "We depend on zero-initialized globals being interpreted as SEC_OID_UNKNOWN.");
 static_assert(ArrayLength(sEVInfoOIDTags) == ArrayLength(kEVInfos),
   "These arrays are used in parallel and must have the same length.");
--- a/security/certverifier/tests/gtest/TrustOverrideTest.cpp
+++ b/security/certverifier/tests/gtest/TrustOverrideTest.cpp
@@ -57,27 +57,30 @@ const char* kOverrideCaIntermediatePem =
 "lJNniSZbH7lHr08bWhWFXVK8aD2VGUeT/FswTlx3XGYVFrbXQ8WDEe0VkA+4aN33\n" \
 "+mbXPBnW8ao=\n" \
 "-----END CERTIFICATE-----";
 
 // /CN=ca
 // SHA256 Fingerprint: A3:05:0C:44:CD:6D:1E:BE:A2:18:80:09:93:69:90:7F
 //                     8C:E3:9F:A4:33:CB:E3:E9:3C:D1:8E:8C:89:23:1B:4A
 
+// clang-format off
 // Invocation: security/manager/tools/crtshToIdentifyingStruct/crtshToIdentifyingStruct.py -listname OverrideCaDNs -dn /tmp/overrideCa.pem
 static const uint8_t CAcaDN[15] = {
   0x30, 0x0D, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x02,
   0x63, 0x61,
 };
+// clang-format on
 
 static const DataAndLength OverrideCaDNs[]= {
   { CAcaDN,
     sizeof(CAcaDN) },
 };
 
+// clang-format off
 // Invocation: security/manager/tools/crtshToIdentifyingStruct/crtshToIdentifyingStruct.py -listname OverrideCaSPKIs -spki /tmp/overrideCa.pem
 static const uint8_t CAcaSPKI[294] = {
   0x30, 0x82, 0x01, 0x22, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7,
   0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0F, 0x00, 0x30, 0x82,
   0x01, 0x0A, 0x02, 0x82, 0x01, 0x01, 0x00, 0xBA, 0x88, 0x51, 0xA8, 0x44, 0x8E,
   0x16, 0xD6, 0x41, 0xFD, 0x6E, 0xB6, 0x88, 0x06, 0x36, 0x10, 0x3D, 0x3C, 0x13,
   0xD9, 0xEA, 0xE4, 0x35, 0x4A, 0xB4, 0xEC, 0xF5, 0x68, 0x57, 0x6C, 0x24, 0x7B,
   0xC1, 0xC7, 0x25, 0xA8, 0xE0, 0xD8, 0x1F, 0xBD, 0xB1, 0x9C, 0x06, 0x9B, 0x6E,
@@ -94,16 +97,17 @@ static const uint8_t CAcaSPKI[294] = {
   0x96, 0x12, 0xC0, 0x75, 0x31, 0xA3, 0x0C, 0x91, 0xDD, 0xB4, 0xCA, 0xF7, 0xFC,
   0xAD, 0x1D, 0x25, 0xD3, 0x09, 0xEF, 0xB9, 0x17, 0x0E, 0xA7, 0x68, 0xE1, 0xB3,
   0x7B, 0x2F, 0x22, 0x6F, 0x69, 0xE3, 0xB4, 0x8A, 0x95, 0x61, 0x1D, 0xEE, 0x26,
   0xD6, 0x25, 0x9D, 0xAB, 0x91, 0x08, 0x4E, 0x36, 0xCB, 0x1C, 0x24, 0x04, 0x2C,
   0xBF, 0x16, 0x8B, 0x2F, 0xE5, 0xF1, 0x8F, 0x99, 0x17, 0x31, 0xB8, 0xB3, 0xFE,
   0x49, 0x23, 0xFA, 0x72, 0x51, 0xC4, 0x31, 0xD5, 0x03, 0xAC, 0xDA, 0x18, 0x0A,
   0x35, 0xED, 0x8D, 0x02, 0x03, 0x01, 0x00, 0x01,
 };
+// clang-format on
 
 static const DataAndLength OverrideCaSPKIs[]= {
   { CAcaSPKI, sizeof(CAcaSPKI) },
 };
 
 static mozilla::UniqueCERTCertificate
 CertFromString(const char* aPem)
 {
@@ -154,9 +158,9 @@ TEST_F(psm_TrustOverrideTest, CheckCertS
   ASSERT_TRUE(caObj != nullptr) << "Should have parsed";
   mozilla::UniqueCERTCertificate intObj = CertFromString(kOverrideCaIntermediatePem);
   ASSERT_TRUE(intObj != nullptr) << "Should have parsed";
 
   EXPECT_TRUE(CertSPKIIsInList(caObj.get(), OverrideCaSPKIs))
     << "CA should be in the SPKI list";
   EXPECT_FALSE(CertSPKIIsInList(intObj.get(), OverrideCaSPKIs))
     << "Int should not be in the SPKI list";
-}
\ No newline at end of file
+}
--- a/security/manager/ssl/tests/gtest/DeserializeCertTest.cpp
+++ b/security/manager/ssl/tests/gtest/DeserializeCertTest.cpp
@@ -72,16 +72,17 @@ deserializeAndVerify(const nsCString &se
     ASSERT_EQ(failedCertChainLength, actualFailedCertChainLength);
   } else {
     ASSERT_FALSE(failedChain);
   }
 }
 
 TEST(psm_DeserializeCert, gecko33)
 {
+  // clang-format off
   // Gecko 33+ vintage Security info serialized with UUIDs:
   //  - nsISupports  00000000-0000-0000-c000-000000000046
   //  - nsISSLStatus fa9ba95b-ca3b-498a-b889-7c79cf28fee8
   //  - nsIX509Cert  f8ed8364-ced9-4c6e-86ba-48af53c393e6
   nsCString base64Serialization(
   "FnhllAKWRHGAlo+ESXykKAAAAAAAAAAAwAAAAAAAAEaphjojH6pBabDSgSnsfLHeAAQAAgAAAAAAAAAAAAAAAAAAAAA"
   "B4vFIJp5wRkeyPxAQ9RJGKPqbqVvKO0mKuIl8ec8o/uhmCjImkVxP+7sgiYWmMt8F+O2DZM7ZTG6GukivU8OT5gAAAAIAAAWpMII"
   "FpTCCBI2gAwIBAgIQD4svsaKEC+QtqtsU2TF8ITANBgkqhkiG9w0BAQsFADBwMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUN"
@@ -99,22 +100,24 @@ TEST(psm_DeserializeCert, gecko33)
   "sMDSgMqAwhi5odHRwOi8vY3JsNC5kaWdpY2VydC5jb20vc2hhMi1oYS1zZXJ2ZXItZzMuY3JsMEIGA1UdIAQ7MDkwNwYJYIZIAYb"
   "9bAEBMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vd3d3LmRpZ2ljZXJ0LmNvbS9DUFMwgYMGCCsGAQUFBwEBBHcwdTAkBggrBgEFBQc"
   "wAYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29tME0GCCsGAQUFBzAChkFodHRwOi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRGlnaUN"
   "lcnRTSEEySGlnaEFzc3VyYW5jZVNlcnZlckNBLmNydDAMBgNVHRMBAf8EAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQAc4dbVmuKvyI7"
   "KZ4Txk+ZqcAYToJGKUIVaPL94e5SZGweUisjaCbplAOihnf6Mxt8n6vnuH2IsCaz2NRHqhdcosjT3CwAiJpJNkXPKWVL/txgdSTV"
   "2cqB1GG4esFOalvI52dzn+J4fTIYZvNF+AtGyHSLm2XRXYZCw455laUKf6Sk9RDShDgUvzhOKL4GXfTwKXv12MyMknJybH8UCpjC"
   "HZmFBVHMcUN/87HsQo20PdOekeEvkjrrMIxW+gxw22Yb67yF/qKgwrWr+43bLN709iyw+LWiU7sQcHL2xk9SYiWQDj2tYz2soObV"
   "QYTJm0VUZMEVFhtALq46cx92Zu4vFwC8AAwAAAAABAQAA");
+  // clang-format on
 
   deserializeAndVerify(base64Serialization, false);
 }
 
 TEST(psm_DeserializeCert, gecko46)
 {
+  // clang-format off
   // Gecko 46+ vintage Security info serialized with UUIDs:
   //  - nsISupports  00000000-0000-0000-c000-000000000046
   //  - nsISSLStatus fa9ba95b-ca3b-498a-b889-7c79cf28fee8
   //  - nsIX509Cert  bdc3979a-5422-4cd5-8589-696b6e96ea83
   nsCString base64Serialization(
   "FnhllAKWRHGAlo+ESXykKAAAAAAAAAAAwAAAAAAAAEaphjojH6pBabDSgSnsfLHeAAQAAgAAAAAAAAAAAAAAAAAAAAA"
   "B4vFIJp5wRkeyPxAQ9RJGKPqbqVvKO0mKuIl8ec8o/uhmCjImkVxP+7sgiYWmMt8FvcOXmlQiTNWFiWlrbpbqgwAAAAIAAAWzMII"
   "FrzCCBJegAwIBAgIQB3pdwzYjAfmJ/lT3+G8+ZDANBgkqhkiG9w0BAQsFADBwMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUN"
@@ -132,22 +135,24 @@ TEST(psm_DeserializeCert, gecko46)
   "sMDSgMqAwhi5odHRwOi8vY3JsNC5kaWdpY2VydC5jb20vc2hhMi1oYS1zZXJ2ZXItZzUuY3JsMEwGA1UdIARFMEMwNwYJYIZIAYb"
   "9bAEBMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vd3d3LmRpZ2ljZXJ0LmNvbS9DUFMwCAYGZ4EMAQICMIGDBggrBgEFBQcBAQR3MHU"
   "wJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBNBggrBgEFBQcwAoZBaHR0cDovL2NhY2VydHMuZGlnaWNlcnQ"
   "uY29tL0RpZ2lDZXJ0U0hBMkhpZ2hBc3N1cmFuY2VTZXJ2ZXJDQS5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAQE"
   "ATxbRdPg+o49+96/P+rbdp4ie+CGtfCgUubT/Z9C54k+BfQO0nbxVgCSM5WZQuLgo2Q+0lcxisod8zxZeU0j5wviQINwOln/iN89"
   "Bx3VmDRynTe4CqhsAwOoO1ERmCAmsAJBwY/rNr4mK22p8erBrqMW0nYXYU5NFynI+pNTjojhKD4II8PNV8G2yMWwYOb/u4+WPzUA"
   "HC9DpZdrWTEH/W69Cr/KxRqGsWPwpgMv2Wqav8jaT35JxqTXjOlhQqzo6fNn3eYOeCf4PkCxZKwckWjy10qDaRbjhwAMHAGj2TPr"
   "idlvOj/7QyyX5m8up/1US8z1fRW4yoCSOt6V2bwuH6cAvAAMAAAAAAQEAAA==");
+  // clang-format on
 
   deserializeAndVerify(base64Serialization, false);
 }
 
 TEST(psm_DeserializeCert, preSSLStatusConsolidation)
 {
+  // clang-format off
   // Generated using serialized output of test "good.include-subdomains.pinning.example.com"
   // in security/manager/ssl/tests/unit/test_cert_chains.js
   nsCString base64Serialization(
   "FnhllAKWRHGAlo+ESXykKAAAAAAAAAAAwAAAAAAAAEaphjojH6pBabDSgSnsfLHeAAgAAgAAAAAAAAAAAAAAAAAAAAAB4vFIJp5w"
   "RkeyPxAQ9RJGKPqbqVvKO0mKuIl8ec8o/uhmCjImkVxP+7sgiYWmMt8FvcOXmlQiTNWFiWlrbpbqgwAAAAAAAAONMIIDiTCCAnGg"
   "AwIBAgIUWbWLTwLBvfwcoiU7I8lDz9snfUgwDQYJKoZIhvcNAQELBQAwEjEQMA4GA1UEAwwHVGVzdCBDQTAiGA8yMDE2MTEyNzAw"
   "MDAwMFoYDzIwMTkwMjA1MDAwMDAwWjAaMRgwFgYDVQQDDA9UZXN0IEVuZC1lbnRpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw"
   "ggEKAoIBAQC6iFGoRI4W1kH9braIBjYQPTwT2erkNUq07PVoV2wke8HHJajg2B+9sZwGm24ahvJr4q9adWtqZHEIeqVap0WH9xzV"
@@ -179,22 +184,24 @@ TEST(psm_DeserializeCert, preSSLStatusCo
   "CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6iFGoRI4W1kH9braIBjYQPTwT2erkNUq07PVoV2wke8HHJajg2B+9sZwGm24ahvJr"
   "4q9adWtqZHEIeqVap0WH9xzVJJwCfs1D/B5p0DggKZOrIMNJ5Nu5TMJrbA7tFYIP8X6taRqx0wI6iypB7qdw4A8Njf1mCyuwJJKk"
   "fbmIYXmQsVeQPdI7xeC4SB+oN9OIQ+8nFthVt2Zaqn4CkC86exCABiTMHGyXrZZhW7filhLAdTGjDJHdtMr3/K0dJdMJ77kXDqdo"
   "4bN7LyJvaeO0ipVhHe4m1iWdq5EITjbLHCQELL8Wiy/l8Y+ZFzG4s/5JI/pyUcQx1QOs2hgKNe2NAgMBAAGjHTAbMAwGA1UdEwQF"
   "MAMBAf8wCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBCwUAA4IBAQCDjewR53YLc3HzZKugRDbQVxjJNILW6fSIyW9dSglYcWh6aiOK"
   "9cZFVtzRWYEYkIlicAyTiPw34bXzxU1cK6sCSmBR+UTXbRPGb4OOy3MRaoF1m3jxwnPkQwxezDiqJTydCbYcBu0sKwURAZOd5QK9"
   "22MsOsnrLjNlpRDmuH0VFhb5uN2I5mM3NvMnP2Or19O1Bk//iGD6AyJfiZFcii+FsDrJhbzw6lakEV7O/EnD0kk2l7I0VMtg1xZB"
   "bEw7P6+V9zz5cAzaaq7EB0mCE+jJckSzSETBN+7lyVD8gwmHYxxZfPnUM/yvPbMU9L3xWD/z6HHwO6r+9m7BT+2pHjBCAAA=");
+  // clang-format on
 
   deserializeAndVerify(base64Serialization, false);
 }
 
 TEST(psm_DeserializeCert, preSSLStatusConsolidationFailedCertChain)
 {
+  // clang-format off
   // Generated using serialized output of test "expired.example.com"
   // in security/manager/ssl/tests/unit/test_cert_chains.js
   nsCString base64Serialization(
   "FnhllAKWRHGAlo+ESXykKAAAAAAAAAAAwAAAAAAAAEaphjojH6pBabDSgSnsfLHeAAAABAAAAAAAAAAA///gCwAAAAAB4vFIJp5w"
   "RkeyPxAQ9RJGKPqbqVvKO0mKuIl8ec8o/uhmCjImkVxP+7sgiYWmMt8FvcOXmlQiTNWFiWlrbpbqgwAAAAAAAAMgMIIDHDCCAgSg"
   "AwIBAgIUY9ERAIKj0js/YbhJoMrcLnj++uowDQYJKoZIhvcNAQELBQAwEjEQMA4GA1UEAwwHVGVzdCBDQTAiGA8yMDEzMDEwMTAw"
   "MDAwMFoYDzIwMTQwMTAxMDAwMDAwWjAiMSAwHgYDVQQDDBdFeHBpcmVkIFRlc3QgRW5kLWVudGl0eTCCASIwDQYJKoZIhvcNAQEB"
   "BQADggEPADCCAQoCggEBALqIUahEjhbWQf1utogGNhA9PBPZ6uQ1SrTs9WhXbCR7wcclqODYH72xnAabbhqG8mvir1p1a2pkcQh6"
@@ -245,12 +252,13 @@ TEST(psm_DeserializeCert, preSSLStatusCo
   "ggEKAoIBAQC6iFGoRI4W1kH9braIBjYQPTwT2erkNUq07PVoV2wke8HHJajg2B+9sZwGm24ahvJr4q9adWtqZHEIeqVap0WH9xzV"
   "JJwCfs1D/B5p0DggKZOrIMNJ5Nu5TMJrbA7tFYIP8X6taRqx0wI6iypB7qdw4A8Njf1mCyuwJJKkfbmIYXmQsVeQPdI7xeC4SB+o"
   "N9OIQ+8nFthVt2Zaqn4CkC86exCABiTMHGyXrZZhW7filhLAdTGjDJHdtMr3/K0dJdMJ77kXDqdo4bN7LyJvaeO0ipVhHe4m1iWd"
   "q5EITjbLHCQELL8Wiy/l8Y+ZFzG4s/5JI/pyUcQx1QOs2hgKNe2NAgMBAAGjHTAbMAwGA1UdEwQFMAMBAf8wCwYDVR0PBAQDAgEG"
   "MA0GCSqGSIb3DQEBCwUAA4IBAQCDjewR53YLc3HzZKugRDbQVxjJNILW6fSIyW9dSglYcWh6aiOK9cZFVtzRWYEYkIlicAyTiPw3"
   "4bXzxU1cK6sCSmBR+UTXbRPGb4OOy3MRaoF1m3jxwnPkQwxezDiqJTydCbYcBu0sKwURAZOd5QK922MsOsnrLjNlpRDmuH0VFhb5"
   "uN2I5mM3NvMnP2Or19O1Bk//iGD6AyJfiZFcii+FsDrJhbzw6lakEV7O/EnD0kk2l7I0VMtg1xZBbEw7P6+V9zz5cAzaaq7EB0mC"
   "E+jJckSzSETBN+7lyVD8gwmHYxxZfPnUM/yvPbMU9L3xWD/z6HHwO6r+9m7BT+2pHjBC");
+  // clang-format on
 
   deserializeAndVerify(base64Serialization, true, 2);
 }
 
--- a/startupcache/StartupCache.h
+++ b/startupcache/StartupCache.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef StartupCache_h_
 #define StartupCache_h_
 
 #include "nsClassHashtable.h"
--- a/startupcache/StartupCacheUtils.h
+++ b/startupcache/StartupCacheUtils.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsStartupCacheUtils_h_
 #define nsStartupCacheUtils_h_
 
 #include "nsString.h"
 #include "nsIStorageStream.h"
--- a/startupcache/test/TestStartupCache.cpp
+++ b/startupcache/test/TestStartupCache.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "gtest/gtest.h"
 
 #include "mozilla/scache/StartupCache.h"
 #include "mozilla/scache/StartupCacheUtils.h"
--- a/toolkit/components/alerts/nsAlertsService.h
+++ b/toolkit/components/alerts/nsAlertsService.h
@@ -1,9 +1,9 @@
-// /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsAlertsService_h__
 #define nsAlertsService_h__
 
 #include "nsIAlertsService.h"
--- a/toolkit/components/ctypes/ctypes.cpp
+++ b/toolkit/components/ctypes/ctypes.cpp
@@ -1,10 +1,10 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ctypes.h"
 #include "jsapi.h"
 #include "js/MemoryFunctions.h"
 #include "mozilla/ModuleUtils.h"
 #include "nsMemory.h"
--- a/toolkit/components/ctypes/ctypes.h
+++ b/toolkit/components/ctypes/ctypes.h
@@ -1,10 +1,10 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef COMPONENTS_CTYPES_H
 #define COMPONENTS_CTYPES_H
 
 #include "nsIXPCScriptable.h"
 #include "mozilla/Attributes.h"
--- a/toolkit/components/ctypes/tests/jsctypes-test-errno.cpp
+++ b/toolkit/components/ctypes/tests/jsctypes-test-errno.cpp
@@ -1,10 +1,10 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <stdio.h>
 #include <errno.h>
 #if defined(XP_WIN)
 #include <windows.h>
 #endif // defined(XP_WIN)
--- a/toolkit/components/ctypes/tests/jsctypes-test-errno.h
+++ b/toolkit/components/ctypes/tests/jsctypes-test-errno.h
@@ -1,10 +1,10 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Attributes.h"
 #include "mozilla/Types.h"
 
 #define EXPORT_CDECL(type)   MOZ_EXPORT type
 
--- a/toolkit/components/ctypes/tests/jsctypes-test.cpp
+++ b/toolkit/components/ctypes/tests/jsctypes-test.cpp
@@ -1,10 +1,10 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "jsctypes-test.h"
 #include <math.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include "typedefs.h"
--- a/toolkit/components/ctypes/tests/jsctypes-test.h
+++ b/toolkit/components/ctypes/tests/jsctypes-test.h
@@ -1,10 +1,10 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef jsctypes_test_h
 #define jsctypes_test_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/Types.h"
--- a/toolkit/components/extensions/DocumentObserver.h
+++ b/toolkit/components/extensions/DocumentObserver.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_extensions_DocumentObserver_h
 #define mozilla_extensions_DocumentObserver_h
 
 #include "mozilla/dom/BindingDeclarations.h"
--- a/toolkit/components/extensions/ExtensionPolicyService.cpp
+++ b/toolkit/components/extensions/ExtensionPolicyService.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ExtensionPolicyService.h"
 #include "mozilla/extensions/DocumentObserver.h"
 #include "mozilla/extensions/WebExtensionContentScript.h"
 #include "mozilla/extensions/WebExtensionPolicy.h"
--- a/toolkit/components/extensions/ExtensionPolicyService.h
+++ b/toolkit/components/extensions/ExtensionPolicyService.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_ExtensionPolicyService_h
 #define mozilla_ExtensionPolicyService_h
 
 #include "mozilla/MemoryReporting.h"
--- a/toolkit/components/extensions/MatchGlob.h
+++ b/toolkit/components/extensions/MatchGlob.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_extensions_MatchGlob_h
 #define mozilla_extensions_MatchGlob_h
 
 #include "mozilla/dom/BindingDeclarations.h"
--- a/toolkit/components/extensions/MatchPattern.cpp
+++ b/toolkit/components/extensions/MatchPattern.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/extensions/MatchPattern.h"
 #include "mozilla/extensions/MatchGlob.h"
 
 #include "mozilla/dom/ScriptSettings.h"
--- a/toolkit/components/extensions/MatchPattern.h
+++ b/toolkit/components/extensions/MatchPattern.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_extensions_MatchPattern_h
 #define mozilla_extensions_MatchPattern_h
 
 #include "mozilla/dom/BindingDeclarations.h"
--- a/toolkit/components/extensions/WebExtensionContentScript.h
+++ b/toolkit/components/extensions/WebExtensionContentScript.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_extensions_WebExtensionContentScript_h
 #define mozilla_extensions_WebExtensionContentScript_h
 
 #include "mozilla/dom/BindingDeclarations.h"
--- a/toolkit/components/extensions/WebExtensionPolicy.cpp
+++ b/toolkit/components/extensions/WebExtensionPolicy.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ExtensionPolicyService.h"
 #include "mozilla/extensions/DocumentObserver.h"
 #include "mozilla/extensions/WebExtensionContentScript.h"
 #include "mozilla/extensions/WebExtensionPolicy.h"
--- a/toolkit/components/extensions/WebExtensionPolicy.h
+++ b/toolkit/components/extensions/WebExtensionPolicy.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_extensions_WebExtensionPolicy_h
 #define mozilla_extensions_WebExtensionPolicy_h
 
 #include "mozilla/dom/BindingDeclarations.h"
--- a/toolkit/components/extensions/webrequest/ChannelWrapper.h
+++ b/toolkit/components/extensions/webrequest/ChannelWrapper.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_extensions_ChannelWrapper_h
 #define mozilla_extensions_ChannelWrapper_h
 
--- a/toolkit/components/extensions/webrequest/StreamFilter.h
+++ b/toolkit/components/extensions/webrequest/StreamFilter.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_extensions_StreamFilter_h
 #define mozilla_extensions_StreamFilter_h
 
--- a/toolkit/components/extensions/webrequest/StreamFilterEvents.cpp
+++ b/toolkit/components/extensions/webrequest/StreamFilterEvents.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/extensions/StreamFilterEvents.h"
 
 namespace mozilla {
--- a/toolkit/components/extensions/webrequest/StreamFilterEvents.h
+++ b/toolkit/components/extensions/webrequest/StreamFilterEvents.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_extensions_StreamFilterEvents_h
 #define mozilla_extensions_StreamFilterEvents_h
 
--- a/toolkit/components/filewatcher/NativeFileWatcherWin.cpp
+++ b/toolkit/components/filewatcher/NativeFileWatcherWin.cpp
@@ -884,23 +884,24 @@ NativeFileWatcherIOTask::DeactivateRunna
   // Now we just need to reschedule a final call to Shutdown() back to the main thread.
   RefPtr<NativeWatcherIOShutdownTask> shutdownRunnable =
     new NativeWatcherIOShutdownTask();
 
   return NS_DispatchToMainThread(shutdownRunnable);
 }
 
 /**
- * Helper function to dispatch a change notification to all the registered callbacks.
+ * Helper function to dispatch a change notification to all the registered
+ * callbacks.
  * @param aResourceDescriptor
  *        The resource descriptor.
  * @param aChangedResource
  *        The path of the changed resource.
- * @return NS_OK if all the callbacks are dispatched correctly, a |nsresult| error code
- *         otherwise.
+ * @return NS_OK if all the callbacks are dispatched correctly, a |nsresult|
+ *         error code otherwise.
  */
 nsresult
 NativeFileWatcherIOTask::DispatchChangeCallbacks(
   WatchedResourceDescriptor* aResourceDescriptor,
   const nsAString& aChangedResource)
 {
   MOZ_ASSERT(aResourceDescriptor);
 
@@ -1020,22 +1021,24 @@ NativeFileWatcherIOTask::ReportSuccess(
   return NS_DispatchToMainThread(successRunnable);
 }
 
 
 /**
  * Instructs the OS to report the changes concerning the directory of interest.
  *
  * @param aDirectoryDescriptor
- *        A |WatchedResourceDescriptor| instance describing the directory to watch.
+ *        A |WatchedResourceDescriptor| instance describing the directory to
+ *        watch.
  * @param aDispatchErrorCode
- *        If |ReadDirectoryChangesW| fails and dispatching an error callback to the
- *        main thread fails as well, the error code is stored here. If the OS API call
- *        does not fail, it gets set to NS_OK.
- * @return |true| if |ReadDirectoryChangesW| returned no error, |false| otherwise.
+ *        If |ReadDirectoryChangesW| fails and dispatching an error callback to
+ *        the main thread fails as well, the error code is stored here. If the
+ *        OS API call does not fail, it gets set to NS_OK.
+ * @return |true| if |ReadDirectoryChangesW| returned no error, |false|
+ *         otherwise.
  */
 nsresult
 NativeFileWatcherIOTask::AddDirectoryToWatchList(
   WatchedResourceDescriptor* aDirectoryDescriptor)
 {
   MOZ_ASSERT(!mShuttingDown);
 
   DWORD dwPlaceholder;
@@ -1356,18 +1359,19 @@ NativeFileWatcherService::AddPath(const 
  * @param aOnChange
  *        The callback to invoke when a change is detected.
  * @param aOnError
  *        The optionally registered callback invoked when there's an error.
  * @param aOnSuccess
  *        The optional callback to invoke when the file watcher stops
  *        watching the resource for changes.
  *
- * @return NS_OK or NS_ERROR_NOT_INITIALIZED if the instance was not initialized.
- *         Other errors are reported by the error callback function.
+ * @return NS_OK or NS_ERROR_NOT_INITIALIZED if the instance was not
+ *         initialized.  Other errors are reported by the error callback
+ *         function.
  */
 NS_IMETHODIMP
 NativeFileWatcherService::RemovePath(const nsAString& aPathToRemove,
                                      nsINativeFileWatcherCallback* aOnChange,
                                      nsINativeFileWatcherErrorCallback* aOnError,
                                      nsINativeFileWatcherSuccessCallback* aOnSuccess)
 {
   // Make sure the instance was initialized.
--- a/toolkit/components/perf/PerfMeasurement.cpp
+++ b/toolkit/components/perf/PerfMeasurement.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "PerfMeasurement.h"
 #include "jsperf.h"
 #include "mozilla/ModuleUtils.h"
 #include "nsMemory.h"
--- a/toolkit/components/perf/PerfMeasurement.h
+++ b/toolkit/components/perf/PerfMeasurement.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef COMPONENTS_PERFMEASUREMENT_H
 #define COMPONENTS_PERFMEASUREMENT_H
 
 #include "nsIXPCScriptable.h"
--- a/toolkit/components/places/nsPlacesTables.h
+++ b/toolkit/components/places/nsPlacesTables.h
@@ -98,17 +98,18 @@
     ", lastModified INTEGER" \
     ", guid TEXT" \
     /* The sync status is determined from the change source. We set this to
        SYNC_STATUS_NEW = 1 for new local bookmarks, and SYNC_STATUS_NORMAL = 2
        for bookmarks from other devices. Uploading a local bookmark for the
        first time changes its status to SYNC_STATUS_NORMAL. For bookmarks
        restored from a backup, we set SYNC_STATUS_UNKNOWN = 0, indicating that
        Sync should reconcile them with bookmarks on the server. If Sync is
-       disconnected or never set up, all bookmarks will stay in SYNC_STATUS_NEW.
+       disconnected or never set up, all bookmarks will stay in
+       SYNC_STATUS_NEW.
     */ \
     ", syncStatus INTEGER NOT NULL DEFAULT 0" \
     /* This field is incremented for every bookmark change that should trigger
        a sync. It's a counter instead of a Boolean so that we can track changes
        made during a sync, and queue them for the next sync. Changes made by
        Sync don't bump the counter, to avoid sync loops. If Sync is
        disconnected, we'll reset the counter to 1 for all bookmarks.
     */ \
--- a/toolkit/components/reflect/reflect.cpp
+++ b/toolkit/components/reflect/reflect.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "reflect.h"
 #include "jsapi.h"
 #include "mozilla/ModuleUtils.h"
 #include "nsMemory.h"
--- a/toolkit/components/reflect/reflect.h
+++ b/toolkit/components/reflect/reflect.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef COMPONENTS_REFLECT_H
 #define COMPONENTS_REFLECT_H
 
 #include "nsIXPCScriptable.h"
--- a/toolkit/components/resistfingerprinting/KeyCodeConsensus_En_US.h
+++ b/toolkit/components/resistfingerprinting/KeyCodeConsensus_En_US.h
@@ -28,25 +28,26 @@
  *   @param modifiers     The spoofing modifier states for this key.
  *                        See BasicEvents.h for details.
  */
 
 /**
  * Spoofed keycodes for English content (US English keyboard layout).
  */
 
+// clang-format off
 CONTROL(Alt,         AltLeft,     dom::KeyboardEvent_Binding::DOM_VK_ALT)
 CONTROL(ArrowDown,   ArrowDown,   dom::KeyboardEvent_Binding::DOM_VK_DOWN)
 CONTROL(ArrowLeft,   ArrowLeft,   dom::KeyboardEvent_Binding::DOM_VK_LEFT)
 CONTROL(ArrowRight,  ArrowRight,  dom::KeyboardEvent_Binding::DOM_VK_RIGHT)
 CONTROL(ArrowUp,     ArrowUp,     dom::KeyboardEvent_Binding::DOM_VK_UP)
 CONTROL(Backspace,   Backspace,   dom::KeyboardEvent_Binding::DOM_VK_BACK_SPACE)
 CONTROL(CapsLock,    CapsLock,    dom::KeyboardEvent_Binding::DOM_VK_CAPS_LOCK)
-// Leaving "ContextMenu" key unimplemented; not every english keyboard has this.
-// For example, MACOS doesn't have this.
+// Leaving "ContextMenu" key unimplemented; not every english keyboard has
+// this.  For example, MACOS doesn't have this.
 CONTROL(Control,     ControlLeft, dom::KeyboardEvent_Binding::DOM_VK_CONTROL)
 CONTROL(Delete,      Delete,      dom::KeyboardEvent_Binding::DOM_VK_DELETE)
 CONTROL(End,         End,         dom::KeyboardEvent_Binding::DOM_VK_END)
 CONTROL(Enter,       Enter,       dom::KeyboardEvent_Binding::DOM_VK_RETURN)
 CONTROL(Escape,      Escape,      dom::KeyboardEvent_Binding::DOM_VK_ESCAPE)
 // Leaving "Help" key unimplemented; it only appears in some keyboard in Linux.
 CONTROL(Home,        Home,        dom::KeyboardEvent_Binding::DOM_VK_HOME)
 CONTROL(Insert,      Insert,      dom::KeyboardEvent_Binding::DOM_VK_INSERT)
@@ -65,21 +66,21 @@ CONTROL(F4,          F4,          dom::K
 CONTROL(F5,          F5,          dom::KeyboardEvent_Binding::DOM_VK_F5)
 CONTROL(F6,          F6,          dom::KeyboardEvent_Binding::DOM_VK_F6)
 CONTROL(F7,          F7,          dom::KeyboardEvent_Binding::DOM_VK_F7)
 CONTROL(F8,          F8,          dom::KeyboardEvent_Binding::DOM_VK_F8)
 CONTROL(F9,          F9,          dom::KeyboardEvent_Binding::DOM_VK_F9)
 CONTROL(F10,         F10,         dom::KeyboardEvent_Binding::DOM_VK_F10)
 CONTROL(F11,         F11,         dom::KeyboardEvent_Binding::DOM_VK_F11)
 CONTROL(F12,         F12,         dom::KeyboardEvent_Binding::DOM_VK_F12)
-// Leaving "F13" to "F35" key unimplemented; they are some how platform dependent.
-// "F13" to "F19" are on MAC's full keyboard but may not exist on usual keyboard.
-// "F20" to "F24" are only available on Windows and Linux.
-// "F25" to "F35" are Linux only.
-// Leaving "Clear" key unimplemented; it's inconsistent between platforms.
+// Leaving "F13" to "F35" key unimplemented; they are some how platform
+// dependent.  "F13" to "F19" are on MAC's full keyboard but may not exist on
+// usual keyboard.  "F20" to "F24" are only available on Windows and Linux.
+// "F25" to "F35" are Linux only.  Leaving "Clear" key unimplemented; it's
+// inconsistent between platforms.
 KEY(" ",  Space,        dom::KeyboardEvent_Binding::DOM_VK_SPACE,  MODIFIER_NONE)
 KEY(",",  Comma,        dom::KeyboardEvent_Binding::DOM_VK_COMMA, MODIFIER_NONE)
 KEY("<",  Comma,        dom::KeyboardEvent_Binding::DOM_VK_COMMA, MODIFIER_SHIFT)
 KEY(".",  Period,       dom::KeyboardEvent_Binding::DOM_VK_PERIOD, MODIFIER_NONE)
 KEY(">",  Period,       dom::KeyboardEvent_Binding::DOM_VK_PERIOD, MODIFIER_SHIFT)
 KEY("/",  Slash,        dom::KeyboardEvent_Binding::DOM_VK_SLASH, MODIFIER_NONE)
 KEY("?",  Slash,        dom::KeyboardEvent_Binding::DOM_VK_SLASH, MODIFIER_SHIFT)
 KEY(";",  Semicolon,    dom::KeyboardEvent_Binding::DOM_VK_SEMICOLON,  MODIFIER_NONE)
@@ -165,8 +166,9 @@ KEY("!",  Digit1,       dom::KeyboardEve
 KEY("@",  Digit2,       dom::KeyboardEvent_Binding::DOM_VK_2, MODIFIER_SHIFT)
 KEY("#",  Digit3,       dom::KeyboardEvent_Binding::DOM_VK_3, MODIFIER_SHIFT)
 KEY("$",  Digit4,       dom::KeyboardEvent_Binding::DOM_VK_4, MODIFIER_SHIFT)
 KEY("%",  Digit5,       dom::KeyboardEvent_Binding::DOM_VK_5, MODIFIER_SHIFT)
 KEY("^",  Digit6,       dom::KeyboardEvent_Binding::DOM_VK_6, MODIFIER_SHIFT)
 KEY("&",  Digit7,       dom::KeyboardEvent_Binding::DOM_VK_7, MODIFIER_SHIFT)
 KEY("*",  Digit8,       dom::KeyboardEvent_Binding::DOM_VK_8, MODIFIER_SHIFT)
 KEY("(",  Digit9,       dom::KeyboardEvent_Binding::DOM_VK_9, MODIFIER_SHIFT)
+// clang-format on
--- a/toolkit/components/resistfingerprinting/nsRFPService.cpp
+++ b/toolkit/components/resistfingerprinting/nsRFPService.cpp
@@ -265,32 +265,33 @@ static StaticRefPtr<LRUCache> sCache;
  * round it upwards to the largest clamped value (in this example: 400).
  *
  * The question is: does time go backwards?
  *
  * The midpoint is deterministicly random and generated from three components:
  * a secret seed, a per-timeline (context) 'mix-in', and a clamped time.
  *
  * When comparing times across different seed values: time may go backwards.
- * For a clamped time of 300, one seed may generate a midpoint of 305 and another
- * 395. So comparing an (actual) timestamp of 325 and 351 could see the 325 clamped
- * up to 400 and the 351 clamped down to 300. The seed is per-process, so this case
- * occurs when one can compare timestamps cross-process. This is uncommon (because
- * we don't have site isolation.) The circumstances this could occur are
- * BroadcastChannel, Storage Notification, and in theory (but not yet implemented)
- * SharedWorker. This should be an exhaustive list (at time of comment writing!).
+ * For a clamped time of 300, one seed may generate a midpoint of 305 and
+ * another 395. So comparing an (actual) timestamp of 325 and 351 could see the
+ * 325 clamped up to 400 and the 351 clamped down to 300. The seed is
+ * per-process, so this case occurs when one can compare timestamps
+ * cross-process. This is uncommon (because we don't have site isolation.) The
+ * circumstances this could occur are BroadcastChannel, Storage Notification,
+ * and in theory (but not yet implemented) SharedWorker. This should be an
+ * exhaustive list (at time of comment writing!).
  *
  * Aside from cross-process communication, derived timestamps across different
- * time origins may go backwards. (Specifically, derived means adding two timestamps
- * together to get an (approximate) absolute time.)
- * Assume a page and a worker. If one calls performance.now() in the page and then
- * triggers a call to performance.now() in the worker, the following invariant should
- * hold true:
+ * time origins may go backwards. (Specifically, derived means adding two
+ * timestamps together to get an (approximate) absolute time.)
+ * Assume a page and a worker. If one calls performance.now() in the page and
+ * then triggers a call to performance.now() in the worker, the following
+ * invariant should hold true:
  *             page.performance.timeOrigin + page.performance.now() <
- *                        worker.performance.timeOrigin + worker.performance.now()
+ *                      worker.performance.timeOrigin + worker.performance.now()
  *
  * We break this invariant.
  *
  * The 'Context Mix-in' is a securely generated random seed that is unique for each
  * timeline that starts over at zero. It is needed to ensure that the sequence of
  * midpoints (as calculated by the secret seed and clamped time) does not repeat.
  * In RelativeTimeline.h, we define a 'RelativeTimeline' class that can be inherited by
  * any object that has a relative timeline. The most obvious examples are Documents
@@ -299,24 +300,26 @@ static StaticRefPtr<LRUCache> sCache;
  * zero, and they know (approximately) where the random midpoints are.
  *
  * When the timestamp given is a non-relative timestamp (e.g. it is relative to the
  * unix epoch) it is not possible to replay a sequence of random values. Thus,
  * providing a zero context pointer is an indicator that the timestamp given is
  * absolute and does not need any additional randomness.
  *
  * @param aClampedTimeUSec [in]  The clamped input time in microseconds.
- * @param aResolutionUSec  [in]  The current resolution for clamping in microseconds.
- * @param aMidpointOut     [out] The midpoint, in microseconds, between [0, aResolutionUSec].
- * @param aContextMixin    [in]  An opaque random value for relative timestamps. 0 for
- *                               absolute timestamps
- * @param aSecretSeed      [in]  TESTING ONLY. When provided, the current seed will be
- *                               replaced with this value.
- * @return                 A nsresult indicating success of failure. If the function failed,
- *                         nothing is written to aMidpointOut
+ * @param aResolutionUSec  [in]  The current resolution for clamping in
+ *                               microseconds.
+ * @param aMidpointOut     [out] The midpoint, in microseconds, between [0,
+ *                               aResolutionUSec].
+ * @param aContextMixin    [in]  An opaque random value for relative
+ *                               timestamps. 0 for absolute timestamps
+ * @param aSecretSeed      [in]  TESTING ONLY. When provided, the current seed
+ *                               will be replaced with this value.
+ * @return                 A nsresult indicating success of failure. If the
+ *                         function failed, nothing is written to aMidpointOut
  */
 
 /* static */
 nsresult
 nsRFPService::RandomMidpoint(long long aClampedTimeUSec,
                              long long aResolutionUSec,
                              int64_t aContextMixin,
                              long long* aMidpointOut,
@@ -449,35 +452,38 @@ nsRFPService::RandomMidpoint(long long a
   deterministiclyRandomValue %= aResolutionUSec;
   *aMidpointOut = deterministiclyRandomValue;
 
   return NS_OK;
 }
 
 
 /**
- * Given a precision value, this function will reduce a given input time to the nearest
- * multiple of that precision.
+ * Given a precision value, this function will reduce a given input time to the
+ * nearest multiple of that precision.
  *
- * It will check if it is appropriate to clamp the input time according to the values
- * of the privacy.resistFingerprinting and privacy.reduceTimerPrecision preferences.
- * Note that while it will check these prefs, it will use whatever precision is given to
- * it, so if one desires a minimum precision for Resist Fingerprinting, it is the
- * caller's responsibility to provide the correct value. This means you should pass
- * TimerResolution(), which enforces a minimum vale on the precision based on
- * preferences.
+ * It will check if it is appropriate to clamp the input time according to the
+ * values of the privacy.resistFingerprinting and privacy.reduceTimerPrecision
+ * preferences.  Note that while it will check these prefs, it will use
+ * whatever precision is given to it, so if one desires a minimum precision for
+ * Resist Fingerprinting, it is the caller's responsibility to provide the
+ * correct value. This means you should pass TimerResolution(), which enforces
+ * a minimum vale on the precision based on preferences.
  *
- * It ensures the given precision value is greater than zero, if it is not it returns
- * the input time.
+ * It ensures the given precision value is greater than zero, if it is not it
+ * returns the input time.
  *
  * @param aTime           [in] The input time to be clamped.
- * @param aTimeScale      [in] The units the input time is in (Seconds, Milliseconds, or Microseconds).
+ * @param aTimeScale      [in] The units the input time is in (Seconds,
+ *                             Milliseconds, or Microseconds).
  * @param aResolutionUSec [in] The precision (in microseconds) to clamp to.
- * @param aContextMixin   [in] An opaque random value for relative timestamps. 0 for absolute timestamps
- * @return                 If clamping is appropriate, the clamped value of the input, otherwise the input.
+ * @param aContextMixin   [in] An opaque random value for relative timestamps.
+ *                             0 for absolute timestamps
+ * @return                 If clamping is appropriate, the clamped value of the
+ *                         input, otherwise the input.
  */
 /* static */
 double
 nsRFPService::ReduceTimePrecisionImpl(
   double aTime,
   TimeScale aTimeScale,
   double aResolutionUSec,
   int64_t aContextMixin,
--- a/toolkit/components/resistfingerprinting/nsRFPService.h
+++ b/toolkit/components/resistfingerprinting/nsRFPService.h
@@ -216,46 +216,51 @@ public:
   static uint32_t GetSpoofedPresentedFrames(double aTime, uint32_t aWidth, uint32_t aHeight);
 
   // This method generates the spoofed value of User Agent.
   static nsresult GetSpoofedUserAgent(nsACString &userAgent);
 
   /**
    * This method for getting spoofed modifier states for the given keyboard event.
    *
-   * @param aDoc           [in]  the owner's document for getting content language.
+   * @param aDoc           [in]  the owner's document for getting content
+   *                             language.
    * @param aKeyboardEvent [in]  the keyboard event that needs to be spoofed.
    * @param aModifier      [in]  the modifier that needs to be spoofed.
    * @param aOut           [out] the spoofed state for the given modifier.
    * @return               true if there is a spoofed state for the modifier.
    */
   static bool GetSpoofedModifierStates(const nsIDocument* aDoc,
                                        const WidgetKeyboardEvent* aKeyboardEvent,
                                        const Modifiers aModifier,
                                        bool& aOut);
 
   /**
    * This method for getting spoofed code for the given keyboard event.
    *
-   * @param aDoc           [in]  the owner's document for getting content language.
+   * @param aDoc           [in]  the owner's document for getting content
+   *                             language.
    * @param aKeyboardEvent [in]  the keyboard event that needs to be spoofed.
    * @param aOut           [out] the spoofed code.
-   * @return               true if there is a spoofed code in the fake keyboard layout.
+   * @return               true if there is a spoofed code in the fake keyboard
+   *                       layout.
    */
   static bool GetSpoofedCode(const nsIDocument* aDoc,
                              const WidgetKeyboardEvent* aKeyboardEvent,
                              nsAString& aOut);
 
   /**
    * This method for getting spoofed keyCode for the given keyboard event.
    *
-   * @param aDoc           [in]  the owner's document for getting content language.
+   * @param aDoc           [in]  the owner's document for getting content
+   *                             language.
    * @param aKeyboardEvent [in]  the keyboard event that needs to be spoofed.
    * @param aOut           [out] the spoofed keyCode.
-   * @return               true if there is a spoofed keyCode in the fake keyboard layout.
+   * @return               true if there is a spoofed keyCode in the fake
+   *                       keyboard layout.
    */
   static bool GetSpoofedKeyCode(const nsIDocument* aDoc,
                                 const WidgetKeyboardEvent* aKeyboardEvent,
                                 uint32_t& aOut);
 
 private:
   nsresult Init();
 
--- a/toolkit/components/resistfingerprinting/tests/test_reduceprecision.cpp
+++ b/toolkit/components/resistfingerprinting/tests/test_reduceprecision.cpp
@@ -8,16 +8,17 @@
 
 #include "gtest/gtest.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsRFPService.h"
 
 using namespace mozilla;
 
+// clang-format off
 /*
    Hello! Are you looking at this file because you got an error you don't understand?
    Perhaps something that looks like the following?
 
     toolkit/components/resistfingerprinting/tests/test_reduceprecision.cpp:15: Failure
       Expected: reduced1
         Which is: 2064.83
       To be equal to: reduced2
@@ -38,16 +39,17 @@ using namespace mozilla;
       V/nsResistFingerprinting Given: 2064.83383999999978, Reciprocal Rounding with 50000.00000000000000, Intermediate: 103241691.00000000000000, Got: 2064.83381999999983
 
    Look at the last two values:
       Got: 2064.83383999999978
       Got: 2064.83381999999983
 
    They're supposed to be equal. They're not. But they both round to 2064.83.
 */
+// clang-format on
 
 bool setupJitter(bool enabled) {
   nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
 
   bool jitterEnabled = false;
   if (prefs) {
     prefs->GetBoolPref("privacy.resistFingerprinting.reduceTimerPrecision.jitter", &jitterEnabled);
     prefs->SetBoolPref("privacy.resistFingerprinting.reduceTimerPrecision.jitter", enabled);
@@ -208,16 +210,17 @@ TEST(ResistFingerprinting, ReducePrecisi
   }
   cleanupJitter(jitterEnabled);
 }
 
 
 TEST(ResistFingerprinting, ReducePrecision_JitterTestVectors) {
   bool jitterEnabled = setupJitter(true);
 
+  // clang-format off
   /*
    * Here's our test vector. First we set the secret to the 16 byte value
    * 0x000102030405060708 0x101112131415161718
    *
    * Then we work with a resolution of 500 us which will bucket things as such:
    *  Per-Clamp Buckets: [0, 500], [500, 1000], ...
    *  Per-Hash  Buckets: [0, 4000], [4000, 8000], ...
    *
@@ -236,16 +239,17 @@ TEST(ResistFingerprinting, ReducePrecisi
    *   2500: 06c1c4f2 % 500 = 242
    *   3000: 9f35f28a % 500 = 247
    *   3500: e3afbec0 % 500 = 339
    *   4000: 1571bf19 % 500 = 225
    *   4500: 92a89cd0 % 500 = 198
    *   5000: 829259d5 % 500 = 218
    *   5500: b260a4a6 % 500 = 14
    */
+  // clang-format on
 
   // Set the secret
   long long throwAway;
   uint8_t hardcodedSecret[16] = {
     0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
     0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 };
 
   nsRFPService::RandomMidpoint(0, 500, -1, &throwAway, hardcodedSecret);
--- a/toolkit/components/telemetry/core/EventInfo.h
+++ b/toolkit/components/telemetry/core/EventInfo.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef TelemetryEventInfo_h__
 #define TelemetryEventInfo_h__
 
 #include "TelemetryCommon.h"
--- a/toolkit/components/telemetry/core/ScalarInfo.h
+++ b/toolkit/components/telemetry/core/ScalarInfo.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef TelemetryScalarInfo_h__
 #define TelemetryScalarInfo_h__
 
 #include "TelemetryCommon.h"
--- a/toolkit/components/telemetry/core/Stopwatch.h
+++ b/toolkit/components/telemetry/core/Stopwatch.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef Stopwatch_h__
 #define Stopwatch_h__
 
 #include "mozilla/dom/TelemetryStopwatchBinding.h"
--- a/toolkit/components/telemetry/core/Telemetry.h
+++ b/toolkit/components/telemetry/core/Telemetry.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef Telemetry_h__
 #define Telemetry_h__
 
 #include "mozilla/GuardObjects.h"
@@ -177,17 +177,18 @@ void AccumulateCategoricalKeyed(const ns
 
 /**
  * Adds sample to a categorical histogram defined in TelemetryHistogramEnums.h
  * This string will be matched against the labels defined in Histograms.json.
  * If the string does not match a label defined for the histogram, nothing will
  * be recorded.
  *
  * @param id - The histogram id.
- * @param label - A string label value that is defined in Histograms.json for this histogram.
+ * @param label - A string label value that is defined in Histograms.json for
+ *                this histogram.
  */
 void AccumulateCategorical(HistogramID id, const nsCString& label);
 
 /**
  * Adds an array of samples to a categorical histogram defined in Histograms.json
  *
  * @param id - The histogram id
  * @param labels - The array of labels to accumulate
--- a/toolkit/components/telemetry/core/TelemetryCommon.h
+++ b/toolkit/components/telemetry/core/TelemetryCommon.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef TelemetryCommon_h__
 #define TelemetryCommon_h__
 
 #include "jsapi.h"
@@ -73,17 +73,18 @@ bool CanRecordDataset(uint32_t aDataset,
 bool CanRecordInProcess(RecordedProcessType aProcesses, GeckoProcessType aProcess);
 bool CanRecordInProcess(RecordedProcessType aProcesses, ProcessID aProcess);
 bool CanRecordProduct(SupportedProduct aProducts);
 
 /**
  * Return the number of milliseconds since process start using monotonic
  * timestamps (unaffected by system clock changes).
  *
- * @return NS_OK on success, NS_ERROR_NOT_AVAILABLE if TimeStamp doesn't have the data.
+ * @return NS_OK on success, NS_ERROR_NOT_AVAILABLE if TimeStamp doesn't have
+ *               the data.
  */
 nsresult MsSinceProcessStart(double* aResult);
 
 /**
  * Dumps a log message to the Browser Console using the provided level.
  *
  * @param aLogLevel The level to use when displaying the message in the browser console
  *        (e.g. nsIScriptError::warningFlag, ...).
--- a/toolkit/components/telemetry/core/TelemetryEvent.h
+++ b/toolkit/components/telemetry/core/TelemetryEvent.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef TelemetryEvent_h__
 #define TelemetryEvent_h__
 
 #include <stdint.h>
--- a/toolkit/components/telemetry/core/TelemetryHistogram.cpp
+++ b/toolkit/components/telemetry/core/TelemetryHistogram.cpp
@@ -756,17 +756,18 @@ internal_HistogramAdd(const StaticMutexA
 namespace {
 
 /**
  * Copy histograms and samples to Mozilla-friendly structures.
  * Please note that this version does not make use of JS contexts.
  *
  * @param {StaticMutexAutoLock} the proof we hold the mutex.
  * @param {Histogram} the histogram to reflect.
- * @return {nsresult} NS_ERROR_FAILURE if we fail to allocate memory for the snapshot.
+ * @return {nsresult} NS_ERROR_FAILURE if we fail to allocate memory for the
+ *                    snapshot.
  */
 nsresult
 internal_GetHistogramAndSamples(const StaticMutexAutoLock& aLock,
                                 const base::Histogram *h,
                                 HistogramSnapshotData& aSnapshot)
 {
   MOZ_ASSERT(h);
 
@@ -907,17 +908,18 @@ internal_ShouldReflectHistogram(const St
  * Helper function to get a snapshot of the histograms.
  *
  * @param {aLock} the lock proof.
  * @param {aStore} the name of the store to snapshot.
  * @param {aDataset} the dataset for which the snapshot is being requested.
  * @param {aClearSubsession} whether or not to clear the data after
  *        taking the snapshot.
  * @param {aIncludeGPU} whether or not to include data for the GPU.
- * @param {aOutSnapshot} the container in which the snapshot data will be stored.
+ * @param {aOutSnapshot} the container in which the snapshot data will be
+ *                       stored.
  * @return {nsresult} NS_OK if the snapshot was successfully taken or
  *         NS_ERROR_OUT_OF_MEMORY if it failed to allocate memory.
  */
 nsresult
 internal_GetHistogramsSnapshot(const StaticMutexAutoLock& aLock,
                                const nsACString& aStore,
                                unsigned int aDataset,
                                bool aClearSubsession,
@@ -1466,17 +1468,18 @@ KeyedHistogram::GetSnapshot(const Static
 /**
  * Helper function to get a snapshot of the keyed histograms.
  *
  * @param {aLock} the lock proof.
  * @param {aDataset} the dataset for which the snapshot is being requested.
  * @param {aClearSubsession} whether or not to clear the data after
  *        taking the snapshot.
  * @param {aIncludeGPU} whether or not to include data for the GPU.
- * @param {aOutSnapshot} the container in which the snapshot data will be stored.
+ * @param {aOutSnapshot} the container in which the snapshot data will be
+ *                       stored.
  * @param {aSkipEmpty} whether or not to skip empty keyed histograms from the
  *        snapshot. Can't always assume "true" for consistency with the other
  *        callers.
  * @return {nsresult} NS_OK if the snapshot was successfully taken or
  *         NS_ERROR_OUT_OF_MEMORY if it failed to allocate memory.
  */
 nsresult
 internal_GetKeyedHistogramsSnapshot(const StaticMutexAutoLock& aLock,
--- a/toolkit/components/telemetry/core/TelemetryHistogram.h
+++ b/toolkit/components/telemetry/core/TelemetryHistogram.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef TelemetryHistogram_h__
 #define TelemetryHistogram_h__
 
 #include "mozilla/TelemetryComms.h"
--- a/toolkit/components/telemetry/core/TelemetryScalar.cpp
+++ b/toolkit/components/telemetry/core/TelemetryScalar.cpp
@@ -1374,18 +1374,20 @@ internal_CanRecordForScalarID(const Stat
 }
 
 /**
  * Check if we are allowed to record the provided scalar.
  *
  * @param lock Instance of a lock locking gTelemetryHistogramMutex
  * @param aId The scalar identifier.
  * @param aKeyed Are we attempting to write a keyed scalar?
- * @param aForce Whether to allow recording even if the probe is not allowed on the current process.
- *        This must only be true for GeckoView persistence and recorded actions.
+ * @param aForce Whether to allow recording even if the probe is not allowed on
+ *        the current process.
+ *        This must only be true for GeckoView persistence and recorded
+ *        actions.
  * @return ScalarResult::Ok if we can record, an error code otherwise.
  */
 ScalarResult
 internal_CanRecordScalar(const StaticMutexAutoLock& lock, const ScalarKey& aId,
                          bool aKeyed, bool aForce = false)
 {
   // Make sure that we have a keyed scalar if we are trying to change one.
   if (internal_IsKeyedScalar(lock, aId) != aKeyed) {
@@ -1441,19 +1443,19 @@ internal_GetEnumByScalarName(const Stati
 
 /**
  * Get a scalar object by its enum id. This implicitly allocates the scalar
  * object in the storage if it wasn't previously allocated.
  *
  * @param lock Instance of a lock locking gTelemetryHistogramMutex
  * @param aId The scalar identifier.
  * @param aProcessStorage This drives the selection of the map to use to store
- *        the scalar data coming from child processes. This is only meaningful when
- *        this function is called in parent process. If that's the case, if
- *        this is not |GeckoProcessType_Default|, the process id is used to
+ *        the scalar data coming from child processes. This is only meaningful
+ *        when this function is called in parent process. If that's the case,
+ *        if this is not |GeckoProcessType_Default|, the process id is used to
  *        allocate and store the scalars.
  * @param aRes The output variable that stores scalar object.
  * @return
  *   NS_ERROR_INVALID_ARG if the scalar id is unknown.
  *   NS_ERROR_NOT_AVAILABLE if the scalar is expired.
  *   NS_OK if the scalar was found. If that's the case, aResult contains a
  *   valid pointer to a scalar type.
  */
@@ -1758,24 +1760,24 @@ namespace {
 
 /**
  * Get a keyed scalar object by its enum id. This implicitly allocates the keyed
  * scalar object in the storage if it wasn't previously allocated.
  *
  * @param lock Instance of a lock locking gTelemetryHistogramMutex
  * @param aId The scalar identifier.
  * @param aProcessStorage This drives the selection of the map to use to store
- *        the scalar data coming from child processes. This is only meaningful when
- *        this function is called in parent process. If that's the case, if
- *        this is not |GeckoProcessType_Default|, the process id is used to
+ *        the scalar data coming from child processes. This is only meaningful
+ *        when this function is called in parent process. If that's the case,
+ *        if this is not |GeckoProcessType_Default|, the process id is used to
  *        allocate and store the scalars.
  * @param aRet The output variable that stores scalar object.
  * @return
- *   NS_ERROR_INVALID_ARG if the scalar id is unknown or a this is a keyed string
- *                        scalar.
+ *   NS_ERROR_INVALID_ARG if the scalar id is unknown or a this is a keyed
+ *                        string scalar.
  *   NS_ERROR_NOT_AVAILABLE if the scalar is expired.
  *   NS_OK if the scalar was found. If that's the case, aResult contains a
  *   valid pointer to a scalar type.
  */
 nsresult
 internal_GetKeyedScalarByEnum(const StaticMutexAutoLock& lock,
                               const ScalarKey& aId,
                               ProcessID aProcessStorage,
@@ -2001,17 +2003,18 @@ internal_RegisterScalars(const StaticMut
 }
 
 /**
  * Creates a snapshot of the desired scalar storage.
  * @param {aLock} The proof of lock to access scalar data.
  * @param {aScalarsToReflect} The table that will contain the snapshot.
  * @param {aDataset} The dataset we're asking the snapshot for.
  * @param {aProcessStorage} The scalar storage to take a snapshot of.
- * @param {aIsBuiltinDynamic} Whether or not the storage is for dynamic builtin scalars.
+ * @param {aIsBuiltinDynamic} Whether or not the storage is for dynamic builtin
+ *                            scalars.
  * @return NS_OK or the error code describing the failure reason.
  */
 nsresult
 internal_ScalarSnapshotter(const StaticMutexAutoLock& aLock,
                            ScalarSnapshotTable& aScalarsToReflect,
                            unsigned int aDataset,
                            ProcessesScalarsMapType& aProcessStorage,
                            bool aIsBuiltinDynamic,
@@ -2060,17 +2063,18 @@ internal_ScalarSnapshotter(const StaticM
 }
 
 /**
  * Creates a snapshot of the desired keyed scalar storage.
  * @param {aLock} The proof of lock to access scalar data.
  * @param {aScalarsToReflect} The table that will contain the snapshot.
  * @param {aDataset} The dataset we're asking the snapshot for.
  * @param {aProcessStorage} The scalar storage to take a snapshot of.
- * @param {aIsBuiltinDynamic} Whether or not the storage is for dynamic builtin scalars.
+ * @param {aIsBuiltinDynamic} Whether or not the storage is for dynamic builtin
+ *                            scalars.
  * @return NS_OK or the error code describing the failure reason.
  */
 nsresult
 internal_KeyedScalarSnapshotter(const StaticMutexAutoLock& aLock,
                                 KeyedScalarSnapshotTable& aScalarsToReflect,
                                 unsigned int aDataset,
                                 ProcessesKeyedScalarsMapType& aProcessStorage,
                                 bool aIsBuiltinDynamic,
--- a/toolkit/components/telemetry/core/TelemetryScalar.h
+++ b/toolkit/components/telemetry/core/TelemetryScalar.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef TelemetryScalar_h__
 #define TelemetryScalar_h__
 
 #include <stdint.h>
--- a/toolkit/components/telemetry/core/ipc/TelemetryComms.h
+++ b/toolkit/components/telemetry/core/ipc/TelemetryComms.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  */
 
 #ifndef Telemetry_Comms_h__
 #define Telemetry_Comms_h__
 
 #include "ipc/IPCMessageUtils.h"
--- a/toolkit/components/telemetry/core/ipc/TelemetryIPC.h
+++ b/toolkit/components/telemetry/core/ipc/TelemetryIPC.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef TelemetryIPC_h__
 #define TelemetryIPC_h__
 
 #include <stdint.h>
@@ -56,17 +56,18 @@ void AccumulateChildKeyedHistograms(Tele
  * @param aScalarActions - actions to update the scalar data
  */
 void UpdateChildScalars(Telemetry::ProcessID aProcessType,
                         const nsTArray<Telemetry::ScalarAction>& aScalarActions);
 
 /**
  * Update keyed scalars for the given process type with the data coming from child process.
  *
- * @param aProcessType - the process type to process the keyed scalar actions for
+ * @param aProcessType - the process type to process the keyed scalar actions
+ *                       for
  * @param aScalarActions - actions to update the keyed scalar data
  */
 void UpdateChildKeyedScalars(Telemetry::ProcessID aProcessType,
                              const nsTArray<Telemetry::KeyedScalarAction>& aScalarActions);
 
 /**
  * Record events for the given process type with the data coming from child process.
  *
--- a/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.h
+++ b/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef TelemetryIPCAccumulator_h__
 #define TelemetryIPCAccumulator_h__
 
 #include "mozilla/AlreadyAddRefed.h"
--- a/toolkit/components/telemetry/geckoview/TelemetryGeckoViewPersistence.cpp
+++ b/toolkit/components/telemetry/geckoview/TelemetryGeckoViewPersistence.cpp
@@ -122,17 +122,18 @@ public:
 private:
   nsCOMPtr<nsIOutputStream> mStream;
 };
 
 /**
  * Get the path to the Android Data dir.
  *
  * @param {nsTString<PathChar>} aOutDir - the variable holding the path.
- * @return {nsresult} NS_OK if the data dir path was found, a failure value otherwise.
+ * @return {nsresult} NS_OK if the data dir path was found, a failure value
+ *                    otherwise.
  */
 nsresult
 GetAndroidDataDir(nsTString<PathChar>& aOutDir)
 {
   // This relies on the Java environment to set the location of the
   // cache directory. If that happens, the following variable is set.
   // This should always be the case.
   const char *dataDir = PR_GetEnv("MOZ_ANDROID_DATA_DIR");
@@ -143,18 +144,20 @@ GetAndroidDataDir(nsTString<PathChar>& a
 
   aOutDir.AssignASCII(dataDir);
   return NS_OK;
 }
 
 /**
  * Get the path to the persistence file in the Android Data dir.
  *
- * @param {nsCOMPtr<nsIFile>} aOutFile - the nsIFile pointer holding the file info.
- * @return {nsresult} NS_OK if the persistence file was found, a failure value otherwise.
+ * @param {nsCOMPtr<nsIFile>} aOutFile - the nsIFile pointer holding the file
+ *                                       info.
+ * @return {nsresult} NS_OK if the persistence file was found, a failure value
+ *                          otherwise.
  */
 nsresult
 GetPersistenceFile(nsCOMPtr<nsIFile>& aOutFile)
 {
   nsTString<PathChar> dataDir;
   nsresult rv = GetAndroidDataDir(dataDir);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -168,17 +171,18 @@ GetPersistenceFile(nsCOMPtr<nsIFile>& aO
   return NS_OK;
 }
 
 /**
  * Read and parses JSON content from a file.
  *
  * @param {nsCOMPtr<nsIFile>} aFile - the nsIFile handle to the file.
  * @param {nsACString} fileContent - the content of the file.
- * @return {nsresult} NS_OK if the file was correctly read, an error code otherwise.
+ * @return {nsresult} NS_OK if the file was correctly read, an error code
+ *                          otherwise.
  */
 nsresult
 ReadFromFile(const nsCOMPtr<nsIFile>& aFile, nsACString& fileContent)
 {
   int64_t fileSize = 0;
   nsresult rv = aFile->GetFileSize(&fileSize);
   if (NS_FAILED(rv)) {
     return rv;
--- a/toolkit/components/telemetry/other/CombinedStacks.h
+++ b/toolkit/components/telemetry/other/CombinedStacks.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef CombinedStacks_h__
 #define CombinedStacks_h__
 
 #include <vector>
--- a/toolkit/components/telemetry/other/KeyedStackCapturer.h
+++ b/toolkit/components/telemetry/other/KeyedStackCapturer.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef KeyedStackCapturer_h__
 #define KeyedStackCapturer_h__
 
 #include "CombinedStacks.h"
--- a/toolkit/components/terminator/nsTerminator.cpp
+++ b/toolkit/components/terminator/nsTerminator.cpp
@@ -95,24 +95,23 @@ static ShutdownStep sShutdownSteps[] = {
 Atomic<bool> sShutdownNotified;
 
 // Utility function: create a thread that is non-joinable,
 // does not prevent the process from terminating, is never
 // cooperatively scheduled, and uses a default stack size.
 PRThread* CreateSystemThread(void (*start)(void* arg),
                              void* arg)
 {
-  PRThread* thread = PR_CreateThread(
-    PR_SYSTEM_THREAD, /* This thread will not prevent the process from terminating */
-    start,
-    arg,
-    PR_PRIORITY_LOW,
-    PR_GLOBAL_THREAD /* Make sure that the thread is never cooperatively scheduled */,
-    PR_UNJOINABLE_THREAD,
-    0 /* Use default stack size */
+  PRThread* thread =
+    PR_CreateThread(PR_SYSTEM_THREAD, /* This thread will not prevent the
+                                         process from terminating */
+                    start, arg, PR_PRIORITY_LOW,
+                    PR_GLOBAL_THREAD, /* Make sure that the thread is never
+                                         cooperatively scheduled */
+                    PR_UNJOINABLE_THREAD, 0 /* Use default stack size */
   );
   MOZ_LSAN_INTENTIONALLY_LEAK_OBJECT(thread); // This pointer will never be deallocated.
   return thread;
 }
 
 
 ////////////////////////////////////////////
 //
--- a/toolkit/crashreporter/LoadLibraryRemote.cpp
+++ b/toolkit/crashreporter/LoadLibraryRemote.cpp
@@ -86,17 +86,18 @@ CopySections(const unsigned char *data, 
   unsigned char *dest;
   PIMAGE_SECTION_HEADER section = IMAGE_FIRST_SECTION(module->headers);
   for (i=0; i<module->headers->FileHeader.NumberOfSections; i++, section++) {
     dest = codeBase + section->VirtualAddress;
     memset(dest, 0, section->Misc.VirtualSize);
     if (section->SizeOfRawData) {
       memcpy(dest, data + section->PointerToRawData, section->SizeOfRawData);
     }
-    //     section->Misc.PhysicalAddress = (POINTER_TYPE) module->remoteCodeBase + section->VirtualAddress;
+    // section->Misc.PhysicalAddress = (POINTER_TYPE) module->remoteCodeBase +
+    //                                                section->VirtualAddress;
   }
 }
 
 static bool
 CopyRegion(HANDLE hRemoteProcess, void* remoteAddress, void* localAddress, DWORD size, DWORD protect)
 {
   if (size > 0) {
     // Copy the data from local->remote and set the memory protection
--- a/toolkit/mozapps/update/common/readstrings.cpp
+++ b/toolkit/mozapps/update/common/readstrings.cpp
@@ -113,18 +113,20 @@ find_key(const char *keyList, char* key)
 }
 
 /**
  * A very basic parser for updater.ini taken mostly from nsINIParser.cpp
  * that can be used by standalone apps.
  *
  * @param path       Path to the .ini file to read
  * @param keyList    List of zero-delimited keys ending with two zero characters
- * @param numStrings Number of strings to read into results buffer - must be equal to the number of keys
- * @param results    Two-dimensional array of strings to be filled in the same order as the keys provided
+ * @param numStrings Number of strings to read into results buffer - must be
+ *                   equal to the number of keys
+ * @param results    Two-dimensional array of strings to be filled in the same
+ *                   order as the keys provided
  * @param section    Optional name of the section to read; defaults to "Strings"
  */
 int
 ReadStrings(const NS_tchar *path,
             const char *keyList,
             unsigned int numStrings,
             char results[][MAX_TEXT_LEN],
             const char *section)
--- a/toolkit/recordreplay/ProcessRedirectDarwin.cpp
+++ b/toolkit/recordreplay/ProcessRedirectDarwin.cpp
@@ -2047,19 +2047,19 @@ static SystemRedirection gSystemRedirect
       RR_Compose<RR_CStringRval,
                  RR_WriteOptionalBufferFixedSize<1, PATH_MAX>>> },
   { "realpath$DARWIN_EXTSN",
     RR_SaveRvalHadErrorZero<
       RR_Compose<RR_CStringRval,
                  RR_WriteOptionalBufferFixedSize<1, PATH_MAX>>> },
 
   // By passing through events when initializing the sandbox, we ensure both
-  // that we actually initialize the process sandbox while replaying as well as
-  // while recording, and that any activity in these calls does not interfere
-  // with the replay.
+  // that we actually initialize the process sandbox while replaying as well
+  // as while recording, and that any activity in these calls does not
+  // interfere with the replay.
   { "sandbox_init", nullptr, Preamble_PassThrough },
   { "sandbox_init_with_parameters", nullptr, Preamble_PassThrough },
 
   // Make sure events are passed through here so that replaying processes can
   // inspect their own threads.
   { "task_threads", nullptr, Preamble_PassThrough },
 
   { "vm_copy", nullptr, Preamble_vm_copy },
--- a/toolkit/system/unixproxy/nsLibProxySettings.cpp
+++ b/toolkit/system/unixproxy/nsLibProxySettings.cpp
@@ -109,17 +109,18 @@ nsUnixSystemProxySettings::GetProxyForUR
 
     c++;
   }
 
   free(proxyArray);
   return NS_OK;
 }
 
-#define NS_UNIXSYSTEMPROXYSERVICE_CID  /* 0fa3158c-d5a7-43de-9181-a285e74cf1d4 */\
+/* 0fa3158c-d5a7-43de-9181-a285e74cf1d4 */
+#define NS_UNIXSYSTEMPROXYSERVICE_CID  \
      { 0x0fa3158c, 0xd5a7, 0x43de, \
        {0x91, 0x81, 0xa2, 0x85, 0xe7, 0x4c, 0xf1, 0xd4 } }
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUnixSystemProxySettings, Init)
 NS_DEFINE_NAMED_CID(NS_UNIXSYSTEMPROXYSERVICE_CID);
 
 static const mozilla::Module::CIDEntry kUnixProxyCIDs[] = {
   { &kNS_UNIXSYSTEMPROXYSERVICE_CID, false, nullptr, nsUnixSystemProxySettingsConstructor },
--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
+++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
@@ -512,17 +512,18 @@ nsUnixSystemProxySettings::GetProxyForUR
       return rv;
   }
   if (mGConf)
     return GetProxyFromGConf(aScheme, aHost, aPort, aResult);
 
   return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult);
 }
 
-#define NS_UNIXSYSTEMPROXYSERVICE_CID  /* 0fa3158c-d5a7-43de-9181-a285e74cf1d4 */\
+/* 0fa3158c-d5a7-43de-9181-a285e74cf1d4 */
+#define NS_UNIXSYSTEMPROXYSERVICE_CID  \
      { 0x0fa3158c, 0xd5a7, 0x43de, \
        {0x91, 0x81, 0xa2, 0x85, 0xe7, 0x4c, 0xf1, 0xd4 } }
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUnixSystemProxySettings, Init)
 NS_DEFINE_NAMED_CID(NS_UNIXSYSTEMPROXYSERVICE_CID);
 
 static const mozilla::Module::CIDEntry kUnixProxyCIDs[] = {
   { &kNS_UNIXSYSTEMPROXYSERVICE_CID, false, nullptr, nsUnixSystemProxySettingsConstructor },
--- a/toolkit/system/windowsDHCPClient/DHCPUtils.cpp
+++ b/toolkit/system/windowsDHCPClient/DHCPUtils.cpp
@@ -14,19 +14,20 @@
 #define MOZ_WORKING_BUFFER_SIZE_DHCP_PARAMS 1000
 #define MOZ_MAX_TRIES 3
 namespace mozilla {
 namespace toolkit {
 namespace system {
 namespace windowsDHCPClient {
 
 //
-// The comments on this page reference the following Microsoft documentation pages (both retrieved 2017-06-27)
-// [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa365915(v=vs.85).aspx
-// [2] https://msdn.microsoft.com/en-us/library/windows/desktop/aa363298(v=vs.85).aspx
+// The comments on this page reference the following Microsoft documentation
+// pages (both retrieved 2017-06-27)
+// https://msdn.microsoft.com/en-us/library/windows/desktop/aa365915(v=vs.85).aspx
+// https://msdn.microsoft.com/en-us/library/windows/desktop/aa363298(v=vs.85).aspx
 mozilla::LazyLogModule gDhcpUtilsLog("dhcpUtils");
 
 #undef LOG
 #define LOG(args) MOZ_LOG(gDhcpUtilsLog, LogLevel::Debug, args)
 
 bool
 IsCurrentAndHasDHCP(PIP_ADAPTER_ADDRESSES aAddresses)
 {
--- a/toolkit/system/windowsDHCPClient/nsWindowsDHCPClient.cpp
+++ b/toolkit/system/windowsDHCPClient/nsWindowsDHCPClient.cpp
@@ -67,17 +67,18 @@ nsWindowsDHCPClient::GetOption(uint8_t a
   if (rv != NS_OK) {
     LOG(("Failed to get DHCP Option %d nsWindowsDHCPClient::GetOption due to error %d", aOption, rv));
     return rv;
   }
   aRetVal.Assign(optionValue.data(), sizeOptionValue);
   return NS_OK;
 }
 
-#define NS_WINDOWSDHCPCLIENTSERVICE_CID  /* {FEBF1D69-4D7D-4891-9524-045AD18B5592} */\
+/* {FEBF1D69-4D7D-4891-9524-045AD18B5592} */
+#define NS_WINDOWSDHCPCLIENTSERVICE_CID  \
     { 0xFEBF1D69, 0x4D7D, 0x4891, \
          {0x95, 0x24, 0x04, 0x5a, 0xd1, 0x8b, 0x55, 0x92 } }
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowsDHCPClient, Init)
 NS_DEFINE_NAMED_CID(NS_WINDOWSDHCPCLIENTSERVICE_CID);
 
 static const mozilla::Module::CIDEntry kSysDHCPClientCIDs[] = {
   { &kNS_WINDOWSDHCPCLIENTSERVICE_CID, false, nullptr, nsWindowsDHCPClientConstructor },
@@ -95,9 +96,9 @@ static const mozilla::Module kSysDHCPCli
   kSysDHCPClientContracts
 };
 
 NSMODULE_DEFN(nsDHCPClientModule) = &kSysDHCPClientModule;
 
 } // namespace windowsDHCPClient
 } // namespace system
 } // namespace toolkit
-} // namespace mozilla
\ No newline at end of file
+} // namespace mozilla
--- a/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp
+++ b/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp
@@ -268,17 +268,18 @@ nsWindowsSystemProxySettings::GetProxyFo
     else if (!socksProxy.IsEmpty())
         SetProxyResult("SOCKS", socksProxy, aResult); // SOCKS proxy.
     else
         SetProxyResultDirect(aResult); // Direct connection.
 
     return NS_OK;
 }
 
-#define NS_WINDOWSSYSTEMPROXYSERVICE_CID  /* 4e22d3ea-aaa2-436e-ada4-9247de57d367 */\
+/* 4e22d3ea-aaa2-436e-ada4-9247de57d367 */
+#define NS_WINDOWSSYSTEMPROXYSERVICE_CID  \
     { 0x4e22d3ea, 0xaaa2, 0x436e, \
         {0xad, 0xa4, 0x92, 0x47, 0xde, 0x57, 0xd3, 0x67 } }
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowsSystemProxySettings, Init)
 NS_DEFINE_NAMED_CID(NS_WINDOWSSYSTEMPROXYSERVICE_CID);
 
 static const mozilla::Module::CIDEntry kSysProxyCIDs[] = {
     { &kNS_WINDOWSSYSTEMPROXYSERVICE_CID, false, nullptr, nsWindowsSystemProxySettingsConstructor },
--- a/toolkit/xre/glxtest.cpp
+++ b/toolkit/xre/glxtest.cpp
@@ -226,19 +226,21 @@ void glxtest()
                         "VENDOR\n%s\nRENDERER\n%s\nVERSION\n%s\nTFP\n%s\n",
                         vendorString,
                         rendererString,
                         versionString,
                         glXBindTexImageEXT ? "TRUE" : "FALSE");
   if (length >= bufsize)
     fatal_error("GL strings length too large for buffer size");
 
-  ///// Clean up. Indeed, the parent process might fail to kill us (e.g. if it doesn't need to check GL info)
-  ///// so we might be staying alive for longer than expected, so it's important to consume as little memory as
-  ///// possible. Also we want to check that we're able to do that too without generating X errors.
+  ///// Clean up. Indeed, the parent process might fail to kill us (e.g. if it
+  ///// doesn't need to check GL info) so we might be staying alive for longer
+  ///// than expected, so it's important to consume as little memory as
+  ///// possible. Also we want to check that we're able to do that too without
+  ///// generating X errors.
   glXMakeCurrent(dpy, None, nullptr); // must release the GL context before destroying it
   glXDestroyContext(dpy, context);
   XDestroyWindow(dpy, window);
   XFreeColormap(dpy, swa.colormap);
 
 #ifdef NS_FREE_PERMANENT_DATA // conditionally defined in nscore.h, don't forget to #include it above
   XCloseDisplay(dpy);
 #else
--- a/tools/profiler/core/ProfileBufferEntry.h
+++ b/tools/profiler/core/ProfileBufferEntry.h
@@ -361,69 +361,70 @@ private:
 //
 // {
 //   "name": "Foo",
 //   "tid": 42,
 //   "samples":
 //   {
 //     "schema":
 //     {
-//       "stack": 0,           /* index into stackTable */
-//       "time": 1,            /* number */
-//       "responsiveness": 2,  /* number */
+//       "stack": 0,          /* index into stackTable */
+//       "time": 1,           /* number */
+//       "responsiveness": 2, /* number */
 //     },
 //     "data":
 //     [
-//       [ 1, 0.0, 0.0 ]       /* { stack: 1, time: 0.0, responsiveness: 0.0 } */
+//       [ 1, 0.0, 0.0 ]      /* { stack: 1, time: 0.0, responsiveness: 0.0 } */
 //     ]
 //   },
 //
 //   "markers":
 //   {
 //     "schema":
 //     {
-//       "name": 0,            /* index into stringTable */
-//       "time": 1,            /* number */
-//       "data": 2             /* arbitrary JSON */
+//       "name": 0,           /* index into stringTable */
+//       "time": 1,           /* number */
+//       "data": 2            /* arbitrary JSON */
 //     },
 //     "data":
 //     [
-//       [ 3, 0.1 ]            /* { name: 'example marker', time: 0.1 } */
+//       [ 3, 0.1 ]           /* { name: 'example marker', time: 0.1 } */
 //     ]
 //   },
 //
 //   "stackTable":
 //   {
 //     "schema":
 //     {
-//       "prefix": 0,          /* index into stackTable */
-//       "frame": 1            /* index into frameTable */
+//       "prefix": 0,         /* index into stackTable */
+//       "frame": 1           /* index into frameTable */
 //     },
 //     "data":
 //     [
-//       [ null, 0 ],          /* (root) */
-//       [ 0,    1 ]           /* (root) > foo.js */
+//       [ null, 0 ],         /* (root) */
+//       [ 0,    1 ]          /* (root) > foo.js */
 //     ]
 //   },
 //
 //   "frameTable":
 //   {
 //     "schema":
 //     {
-//       "location": 0,        /* index into stringTable */
-//       "implementation": 1,  /* index into stringTable */
-//       "optimizations": 2,   /* arbitrary JSON */
-//       "line": 3,            /* number */
-//       "column": 4,          /* number */
-//       "category": 5         /* number */
+//       "location": 0,       /* index into stringTable */
+//       "implementation": 1, /* index into stringTable */
+//       "optimizations": 2,  /* arbitrary JSON */
+//       "line": 3,           /* number */
+//       "column": 4,         /* number */
+//       "category": 5        /* number */
 //     },
 //     "data":
 //     [
-//       [ 0 ],                /* { location: '(root)' } */
-//       [ 1, 2 ]              /* { location: 'foo.js', implementation: 'baseline' } */
+//       [ 0 ],               /* { location: '(root)' } */
+//       [ 1, 2 ]             /* { location: 'foo.js',
+//                                 implementation: 'baseline' } */
 //     ]
 //   },
 //
 //   "stringTable":
 //   [
 //     "(root)",
 //     "foo.js",
 //     "baseline",
@@ -443,28 +444,29 @@ private:
 //   [
 //     {
 //       "name": "qwerty",
 //       "category": "uiop",
 //       "description": "this is qwerty uiop",
 //       "sample_groups:
 //       [
 //         {
-//           "id": 42,    /* number (thread id, or object identifier (tab), etc) */
+//           "id": 42, /* number (thread id, or object identifier (tab), etc) */
 //           "samples:
 //           {
 //             "schema":
 //             {
-//               "time": 1,            /* number */
-//               "number": 2,          /* number (of times the counter was touched) */
-//               "count": 3            /* number (total for the counter) */
+//               "time": 1,   /* number */
+//               "number": 2, /* number (of times the counter was touched) */
+//               "count": 3   /* number (total for the counter) */
 //             },
 //             "data":
 //             [
-//               [ 0.1, 1824, 454622 ] /* { time: 0.1, number: 1824, count: 454622 } */
+//               [ 0.1, 1824,
+//                 454622 ]   /* { time: 0.1, number: 1824, count: 454622 } */
 //             ]
 //           },
 //         },
 //         /* more sample-group objects with different id's */
 //       ]
 //     },
 //     /* more counters */
 //   ],
--- a/tools/profiler/public/GeckoProfiler.h
+++ b/tools/profiler/public/GeckoProfiler.h
@@ -259,17 +259,18 @@ void profiler_init(void* stackTop);
 // also save a shutdown profile if requested. No profiler calls should happen
 // after this point and all profiling stack labels should have been popped.
 void profiler_shutdown();
 
 // Start the profiler -- initializing it first if necessary -- with the
 // selected options. Stops and restarts the profiler if it is already active.
 // After starting the profiler is "active". The samples will be recorded in a
 // circular buffer.
-//   "aCapacity" is the maximum number of entries in the profiler's circular buffer.
+//   "aCapacity" is the maximum number of entries in the profiler's circular
+//               buffer.
 //   "aInterval" the sampling interval, measured in millseconds.
 //   "aFeatures" is the feature set. Features unsupported by this
 //               platform/configuration are ignored.
 //   "aFilters" is the list of thread filters. Threads that do not match any
 //              of the filters are not profiled. A filter matches a thread if
 //              (a) the thread name contains the filter as a case-insensitive
 //                  substring, or
 //              (b) the filter is of the form "pid:<n>" where n is the process
@@ -818,18 +819,19 @@ public:
                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 
     // Get the ProfilingStack from TLS.
     Push(sProfilingStack.get(), aLabel, aDynamicString, aCategory, aFlags);
   }
 
-  // This is the AUTO_PROFILER_LABEL_FAST variant. It retrieves the ProfilingStack
-  // from the JSContext and does nothing if the profiler is inactive.
+  // This is the AUTO_PROFILER_LABEL_FAST variant. It retrieves the
+  // ProfilingStack from the JSContext and does nothing if the profiler is
+  // inactive.
   AutoProfilerLabel(JSContext* aJSContext,
                     const char* aLabel, const char* aDynamicString,
                     js::ProfilingStackFrame::Category aCategory,
                     uint32_t aFlags
                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
     Push(js::GetContextProfilingStackIfEnabled(aJSContext),
--- a/tools/profiler/public/ProfilerCounts.h
+++ b/tools/profiler/public/ProfilerCounts.h
@@ -23,26 +23,28 @@ class BaseProfilerCount;
 void profiler_add_sampled_counter(BaseProfilerCount* aCounter);
 void profiler_remove_sampled_counter(BaseProfilerCount* aCounter);
 
 typedef mozilla::Atomic<int64_t, mozilla::MemoryOrdering::Relaxed> ProfilerAtomicSigned;
 typedef mozilla::Atomic<uint64_t, mozilla::MemoryOrdering::Relaxed> ProfilerAtomicUnsigned;
 
 // Counter support
 // There are two types of counters:
-// 1) a simple counter which can be added to or subtracted from.  This could track the number
-// of objects of a type, the number of calls to something (reflow, JIT, etc).
-// 2) a combined counter which has the above, plus a number-of-calls counter that is
-// incremented by 1 for each call to modify the count.  This provides an optional source for
-// a 'heatmap' of access.  This can be used (for example) to track the amount of memory
-// allocated, and provide a heatmap of memory operations (allocs/frees).
+// 1) a simple counter which can be added to or subtracted from.  This could
+// track the number of objects of a type, the number of calls to something
+// (reflow, JIT, etc).
+// 2) a combined counter which has the above, plus a number-of-calls counter
+// that is incremented by 1 for each call to modify the count.  This provides
+// an optional source for a 'heatmap' of access.  This can be used (for
+// example) to track the amount of memory allocated, and provide a heatmap of
+// memory operations (allocs/frees).
 //
-// Counters are sampled by the profiler once per sample-period.  At this time, all counters
-// are global to the process.  In the future, there might be more versions with per-thread
-// or other discriminators.
+// Counters are sampled by the profiler once per sample-period.  At this time,
+// all counters are global to the process.  In the future, there might be more
+// versions with per-thread or other discriminators.
 //
 // Typical usage:
 // There are two ways to use counters: With heap-created counter objects,
 // or using macros.  Note: the macros use statics, and will be slightly
 // faster/smaller, and you need to care about creating them before using
 // them.  They're similar to the use-pattern for the other AUTO_PROFILER*
 // macros, but they do need the PROFILER_DEFINE* to be use to instantiate
 // the statics.
@@ -50,23 +52,28 @@ typedef mozilla::Atomic<uint64_t, mozill
 // PROFILER_DEFINE_COUNT(mything, "JIT", "Some JIT byte count")
 // ...
 // void foo() { ... AUTO_PROFILER_COUNT(mything, number_of_bytes_used); ... }
 //
 // or (to also get a heatmap)
 //
 // PROFILER_DEFINE_COUNT_TOTAL(mything, "JIT", "Some JIT byte count")
 // ...
-// void foo() { ... AUTO_PROFILER_COUNT_TOTAL(mything, number_of_bytes_generated); ... }
+// void foo() {
+//   ...
+//   AUTO_PROFILER_COUNT_TOTAL(mything, number_of_bytes_generated);
+//   ...
+// }
 //
 // To use without statics/macros:
 //
 // UniquePtr<ProfilerCounter> myCounter;
 // ...
-// myCounter = MakeUnique<ProfilerCounter>("mything", "JIT", "Some JIT byte count"));
+// myCounter =
+//   MakeUnique<ProfilerCounter>("mything", "JIT", "Some JIT byte count"));
 // ...
 // void foo() { ... myCounter->Add(number_of_bytes_generated0; ... }
 
 class BaseProfilerCount
 {
 public:
   BaseProfilerCount(const char* aLabel,
                     ProfilerAtomicSigned* aCounter,
--- a/uriloader/exthandler/HandlerServiceParent.cpp
+++ b/uriloader/exthandler/HandlerServiceParent.cpp
@@ -97,17 +97,18 @@ NS_IMETHODIMP ProxyHandlerInfo::GetHasDe
 }
 
 /* readonly attribute AString defaultDescription; */
 NS_IMETHODIMP ProxyHandlerInfo::GetDefaultDescription(nsAString & aDefaultDescription)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-/* void launchWithURI (in nsIURI aURI, [optional] in nsIInterfaceRequestor aWindowContext); */
+/* void launchWithURI (in nsIURI aURI,
+                       [optional] in nsIInterfaceRequestor aWindowContext); */
 NS_IMETHODIMP ProxyHandlerInfo::LaunchWithURI(nsIURI *aURI, nsIInterfaceRequestor *aWindowContext)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 /* attribute ProxyHandlerInfoAction preferredAction; */
 NS_IMETHODIMP ProxyHandlerInfo::GetPreferredAction(nsHandlerInfoAction *aPreferredAction)
 {
--- a/uriloader/exthandler/mac/nsOSHelperAppService.h
+++ b/uriloader/exthandler/mac/nsOSHelperAppService.h
@@ -32,18 +32,20 @@ public:
                                           bool *found,
                                           nsIHandlerInfo **_retval) override;
 
   // override so we can have a child process sandbox-friendly implementation
   bool GetMIMETypeFromOSForExtension(const nsACString& aExtension,
                                      nsACString& aMIMEType) override;
 
   // GetFileTokenForPath must be implemented by each platform. 
-  // platformAppPath --> a platform specific path to an application that we got out of the 
-  //                     rdf data source. This can be a mac file spec, a unix path or a windows path depending on the platform
+  // platformAppPath --> a platform specific path to an application that we got
+  //                     out of the rdf data source. This can be a mac file
+  //                     spec, a unix path or a windows path depending on the
+  //                     platform
   // aFile --> an nsIFile representation of that platform application path.
   virtual MOZ_MUST_USE nsresult GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile) override;
 
   MOZ_MUST_USE nsresult OSProtocolHandlerExists(const char * aScheme,
                                                 bool * aHandlerExists) override;
 
 private:
   uint32_t mPermissions;
--- a/uriloader/exthandler/unix/nsOSHelperAppService.h
+++ b/uriloader/exthandler/unix/nsOSHelperAppService.h
@@ -32,18 +32,20 @@ public:
                                           bool *found,
                                           nsIHandlerInfo **_retval) override;
 
   // override nsIExternalProtocolService methods
   nsresult OSProtocolHandlerExists(const char * aProtocolScheme, bool * aHandlerExists) override;
   NS_IMETHOD GetApplicationDescription(const nsACString& aScheme, nsAString& _retval) override;
 
   // GetFileTokenForPath must be implemented by each platform.
-  // platformAppPath --> a platform specific path to an application that we got out of the
-  //                     rdf data source. This can be a mac file spec, a unix path or a windows path depending on the platform
+  // platformAppPath --> a platform specific path to an application that we got
+  //                     out of the rdf data source. This can be a mac file
+  //                     spec, a unix path or a windows path depending on the
+  //                     platform
   // aFile --> an nsIFile representation of that platform application path.
   virtual nsresult GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile) override;
 
 protected:
   already_AddRefed<nsMIMEInfoBase> GetFromType(const nsCString& aMimeType);
   already_AddRefed<nsMIMEInfoBase> GetFromExtension(const nsCString& aFileExt);
 
 private:
--- a/view/nsView.h
+++ b/view/nsView.h
@@ -346,20 +346,20 @@ public:
    * @param x new x position
    * @param y new y position
    */
   void SetPosition(nscoord aX, nscoord aY);
 
   /**
    * Called to indicate that the z-index of a view has been changed.
    * The z-index is relative to all siblings of the view.
-   * @param aAuto Indicate that the z-index of a view is "auto". An "auto" z-index
-   * means that the view does not define a new stacking context,
-   * which means that the z-indicies of the view's children are
-   * relative to the view's siblings.
+   * @param aAuto Indicate that the z-index of a view is "auto". An "auto"
+   *              z-index means that the view does not define a new stacking
+   *              context, which means that the z-indicies of the view's
+   *              children are relative to the view's siblings.
    * @param zindex new z depth
    */
   void SetZIndex(bool aAuto, int32_t aZIndex);
   bool GetZIndexIsAuto() const { return (mVFlags & NS_VIEW_FLAG_AUTO_ZINDEX) != 0; }
   int32_t GetZIndex() const { return mZIndex; }
 
   void SetParent(nsView *aParent) { mParent = aParent; }
   void SetNextSibling(nsView *aSibling)
--- a/view/nsViewManager.h
+++ b/view/nsViewManager.h
@@ -40,23 +40,25 @@ public:
    * because it holds a reference to this instance.
    * @result The result of the initialization, NS_OK if no errors
    */
   nsresult Init(nsDeviceContext* aContext);
 
   /**
    * Create an ordinary view
    * @param aBounds initial bounds for view
-   *        XXX We should eliminate this parameter; you can set the bounds after CreateView
+   *        XXX We should eliminate this parameter; you can set the bounds
+   *        after CreateView
    * @param aParent intended parent for view. this is not actually set in the
    *        nsView through this method. it is only used by the initialization
    *        code to walk up the view tree, if necessary, to find resources.
    *        XXX We should eliminate this parameter!
    * @param aVisibilityFlag initial visibility state of view
-   *        XXX We should eliminate this parameter; you can set it after CreateView
+   *        XXX We should eliminate this parameter; you can set it after
+   *        CreateView
    * @result The new view.  Never null.
    */
   nsView* CreateView(const nsRect& aBounds,
                      nsView* aParent,
                      nsViewVisibility aVisibilityFlag = nsViewVisibility_kShow);
 
   /**
    * Get the root of the view tree.
@@ -194,20 +196,20 @@ public:
    */
   void SetViewVisibility(nsView *aView, nsViewVisibility aVisible);
 
   /**
    * Set the z-index of a view. Positive z-indices mean that a view
    * is above its parent in z-order. Negative z-indices mean that a
    * view is below its parent.
    * The view manager generates the appropriate dirty regions.
-   * @param aAutoZIndex indicate that the z-index of a view is "auto". An "auto" z-index
-   * means that the view does not define a new stacking context,
-   * which means that the z-indicies of the view's children are
-   * relative to the view's siblings.
+   * @param aAutoZIndex indicate that the z-index of a view is "auto". An
+   *     "auto" z-index means that the view does not define a new stacking
+   *     context, which means that the z-indicies of the view's children are
+   *     relative to the view's siblings.
    * @param aView view to change z depth of
    * @param aZindex explicit z depth
    */
   void SetViewZIndex(nsView *aView, bool aAutoZIndex, int32_t aZindex);
 
   /**
    * Set whether the view "floats" above all other views,
    * which tells the compositor not to consider higher views in
--- a/widget/android/AndroidAlerts.cpp
+++ b/widget/android/AndroidAlerts.cpp
@@ -1,9 +1,9 @@
-/* -*- Mode: c++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "AndroidAlerts.h"
 #include "GeneratedJNIWrappers.h"
 #include "nsAlertsUtils.h"
 
--- a/widget/android/AndroidAlerts.h
+++ b/widget/android/AndroidAlerts.h
@@ -1,9 +1,9 @@
-/* -*- Mode: c++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
+/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_widget_AndroidAlerts_h__
 #define mozilla_widget_AndroidAlerts_h__
 
 #include "nsInterfaceHashtable.h"
--- a/widget/android/AndroidColors.h
+++ b/widget/android/AndroidColors.h
@@ -1,9 +1,9 @@
-/* -*- Mode: c++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_widget_AndroidColors_h
 #define mozilla_widget_AndroidColors_h
 
 #include "mozilla/gfx/2D.h"
--- a/widget/android/nsAppShell.cpp
+++ b/widget/android/nsAppShell.cpp
@@ -1,9 +1,9 @@
-/* -*- Mode: c++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsAppShell.h"
 
 #include "base/basictypes.h"
 #include "base/message_loop.h"
--- a/widget/android/nsAppShell.h
+++ b/widget/android/nsAppShell.h
@@ -1,9 +1,9 @@
-/* -*- Mode: c++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsAppShell_h__
 #define nsAppShell_h__
 
 #include <time.h>
--- a/widget/cocoa/SwipeTracker.h
+++ b/widget/cocoa/SwipeTracker.h
@@ -19,20 +19,22 @@ class nsIPresShell;
 namespace mozilla {
 
 class PanGestureInput;
 
 /**
  * SwipeTracker turns PanGestureInput events into swipe events
  * (WidgetSimpleGestureEvent) and dispatches them into Gecko.
  * The swiping behavior mirrors the behavior of the Cocoa API
- * -[NSEvent trackSwipeEventWithOptions:dampenAmountThresholdMin:max:usingHandler:].
+ * -[NSEvent
+ *     trackSwipeEventWithOptions:dampenAmountThresholdMin:max:usingHandler:].
  * The advantage of using this class over the Cocoa API is that this class
  * properly supports submitting queued up events to it, and that it hopefully
- * doesn't intermittently break scrolling the way the Cocoa API does (bug 927702).
+ * doesn't intermittently break scrolling the way the Cocoa API does (bug
+ * 927702).
  *
  * The swipe direction is either left or right. It is determined before the
  * SwipeTracker is created and stays fixed during the swipe.
  * During the swipe, the swipe has a current "value" which is between 0 and the
  * target value. The target value is either 1 (swiping left) or -1 (swiping
  * right) - see SwipeSuccessTargetValue().
  * A swipe can either succeed or fail. If it succeeds, the swipe animation
  * animates towards the success target value; if it fails, it animates back to
--- a/widget/cocoa/nsCursorManager.h
+++ b/widget/cocoa/nsCursorManager.h
@@ -6,19 +6,21 @@
 #define nsCursorManager_h_
 
 #import <Foundation/Foundation.h>
 #include "nsIWidget.h"
 #include "nsMacCursor.h"
 
 /*! @class      nsCursorManager
     @abstract   Singleton service provides access to all cursors available in the application.
-    @discussion Use <code>nsCusorManager</code> to set the current cursor using an XP <code>nsCusor</code> enum value.
-                <code>nsCursorManager</code> encapsulates the details of setting different types of cursors, animating
-                cursors and cleaning up cursors when they are no longer in use.
+    @discussion Use <code>nsCusorManager</code> to set the current cursor using
+                an XP <code>nsCusor</code> enum value.
+                <code>nsCursorManager</code> encapsulates the details of
+                setting different types of cursors, animating cursors and
+                cleaning up cursors when they are no longer in use.
  */
 @interface nsCursorManager : NSObject
 {
   @private
   NSMutableDictionary *mCursors;
   nsMacCursor *mCurrentMacCursor;
 }
 
--- a/widget/cocoa/nsMacCursor.h
+++ b/widget/cocoa/nsMacCursor.h
@@ -5,101 +5,122 @@
 #ifndef nsMacCursor_h_
 #define nsMacCursor_h_
 
 #import <Cocoa/Cocoa.h>
 #import "nsIWidget.h"
 
 /*! @class      nsMacCursor
     @abstract   Represents a native Mac cursor.
-    @discussion <code>nsMacCursor</code> provides a simple API for creating and working with native Macintosh cursors.
-                Cursors can be created used without needing to be aware of the way different cursors are implemented,
-                in particular the details of managing an animated cursor are hidden.
+    @discussion <code>nsMacCursor</code> provides a simple API for creating and
+                working with native Macintosh cursors.  Cursors can be created
+                used without needing to be aware of the way different cursors
+                are implemented, in particular the details of managing an
+                animated cursor are hidden.
 */
 @interface nsMacCursor : NSObject
 {
   @private
   NSTimer *mTimer;
   @protected
   nsCursor mType;
   int mFrameCounter;    
 }
 
 /*! @method     cursorWithCursor:
     @abstract   Create a cursor by specifying a Cocoa <code>NSCursor</code>.
     @discussion Creates a cursor representing the given Cocoa built-in cursor.
     @param      aCursor the <code>NSCursor</code> to use
     @param      aType the corresponding <code>nsCursor</code> constant
-    @result     an autoreleased instance of <code>nsMacCursor</code> representing the given <code>NSCursor</code>
+    @result     an autoreleased instance of <code>nsMacCursor</code>
+                representing the given <code>NSCursor</code>
  */
 + (nsMacCursor *) cursorWithCursor: (NSCursor *) aCursor type: (nsCursor) aType;
 
 /*! @method     cursorWithImageNamed:hotSpot:type:
-    @abstract   Create a cursor by specifying the name of an image resource to use for the cursor and a hotspot.
-    @discussion Creates a cursor by loading the named image using the <code>+[NSImage imageNamed:]</code> method.
-                <p>The image must be compatible with any restrictions laid down by <code>NSCursor</code>. These vary
-                by operating system version.</p>
-                <p>The hotspot precisely determines the point where the user clicks when using the cursor.</p>
+    @abstract   Create a cursor by specifying the name of an image resource to
+                use for the cursor and a hotspot.
+    @discussion Creates a cursor by loading the named image using the
+                <code>+[NSImage imageNamed:]</code> method.
+                <p>The image must be compatible with any restrictions laid down
+                by <code>NSCursor</code>. These vary by operating system
+                version.</p>
+                <p>The hotspot precisely determines the point where the user
+                clicks when using the cursor.</p>
     @param      aCursor the name of the image to use for the cursor
     @param      aPoint the point within the cursor to use as the hotspot
     @param      aType the corresponding <code>nsCursor</code> constant
     @result     an autoreleased instance of <code>nsMacCursor</code> that uses the given image and hotspot
  */
 + (nsMacCursor *) cursorWithImageNamed: (NSString *) aCursorImage hotSpot: (NSPoint) aPoint type: (nsCursor) aType;
 
 /*! @method     cursorWithFrames:type:
-    @abstract   Create an animated cursor by specifying the frames to use for the animation.
-    @discussion Creates a cursor that will animate by cycling through the given frames. Each element of the array
-                must be an instance of <code>NSCursor</code>
-    @param      aCursorFrames an array of <code>NSCursor</code>, representing the frames of an animated cursor, in the
-                order they should be played.
+    @abstract   Create an animated cursor by specifying the frames to use for
+                the animation.
+    @discussion Creates a cursor that will animate by cycling through the given
+                frames. Each element of the array must be an instance of
+                <code>NSCursor</code>
+    @param      aCursorFrames an array of <code>NSCursor</code>, representing
+                the frames of an animated cursor, in the order they should be
+                played.
     @param      aType the corresponding <code>nsCursor</code> constant
-    @result     an autoreleased instance of <code>nsMacCursor</code> that will animate the given cursor frames
+    @result     an autoreleased instance of <code>nsMacCursor</code> that will
+                animate the given cursor frames
  */
 + (nsMacCursor *) cursorWithFrames: (NSArray *) aCursorFrames type: (nsCursor) aType;
 
 /*! @method     cocoaCursorWithImageNamed:hotSpot:
-    @abstract   Create a Cocoa NSCursor object with a Gecko image resource name and a hotspot point.
-    @discussion Create a Cocoa NSCursor object with a Gecko image resource name and a hotspot point.
-    @param      imageName the name of the gecko image resource, "tiff" extension is assumed, do not append.
+    @abstract   Create a Cocoa NSCursor object with a Gecko image resource name
+                and a hotspot point.
+    @discussion Create a Cocoa NSCursor object with a Gecko image resource name
+                and a hotspot point.
+    @param      imageName the name of the gecko image resource, "tiff"
+                extension is assumed, do not append.
     @param      aPoint the point within the cursor to use as the hotspot
-    @result     an autoreleased instance of <code>nsMacCursor</code> that will animate the given cursor frames
+    @result     an autoreleased instance of <code>nsMacCursor</code> that will
+                animate the given cursor frames
  */
 + (NSCursor *) cocoaCursorWithImageNamed: (NSString *) imageName hotSpot: (NSPoint) aPoint;
 
 /*! @method     isSet
     @abstract   Determines whether this cursor is currently active.
-    @discussion This can be helpful when the Cocoa NSCursor state can be influenced without going
-                through nsCursorManager.
+    @discussion This can be helpful when the Cocoa NSCursor state can be
+                influenced without going through nsCursorManager.
     @result     whether the cursor is currently set
  */
 - (BOOL) isSet;
 
 /*! @method     set
     @abstract   Set the cursor.
-    @discussion Makes this cursor the current cursor. If the cursor is animated, the animation is started.
+    @discussion Makes this cursor the current cursor. If the cursor is
+                animated, the animation is started.
  */
 - (void) set;
 
 /*! @method     unset
-    @abstract   Unset the cursor. The cursor will return to the default (usually the arrow cursor).
-    @discussion Unsets the cursor. If the cursor is animated, the animation is stopped.
+    @abstract   Unset the cursor. The cursor will return to the default
+                (usually the arrow cursor).
+    @discussion Unsets the cursor. If the cursor is animated, the animation is
+                stopped.
  */
 - (void) unset;
 
 /*! @method     isAnimated
     @abstract   Tests whether this cursor is animated.
     @discussion Use this method to determine whether a cursor is animated
-    @result     YES if the cursor is animated (has more than one frame), NO if it is a simple static cursor.
+    @result     YES if the cursor is animated (has more than one frame), NO if
+                it is a simple static cursor.
  */
 - (BOOL) isAnimated;
 
 /** @method     cursorType
     @abstract   Get the cursor type for this cursor
-    @discussion This method returns the <code>nsCursor</code> constant that corresponds to this cursor, which is  
-                equivalent to the CSS name for the cursor.
-    @result     The nsCursor constant corresponding to this cursor, or nsCursor's 'eCursorCount' if the cursor 
-                is a custom cursor loaded from a URI
+    @discussion This method returns the <code>nsCursor</code> constant that
+                corresponds to this cursor, which is  equivalent to the CSS
+                name for the cursor.
+    @result     The nsCursor constant corresponding to this cursor, or
+                nsCursor's 'eCursorCount' if the cursor is a custom cursor
+                loaded from a URI
  */
 - (nsCursor) type;
 @end
 
 #endif // nsMacCursor_h_
--- a/widget/gtk/nsClipboardWayland.cpp
+++ b/widget/gtk/nsClipboardWayland.cpp
@@ -641,22 +641,23 @@ data_device_drop (void                  
  *
  * data_device_selection - It's called when the new wl_data_offer
  *                         is a clipboard content.
  *
  * data_device_enter - It's called when the new wl_data_offer is a drag & drop
  *                     content and it's tied to actual wl_surface.
  * data_device_leave - It's called when the wl_data_offer (drag & dop) is not
  *                     valid any more.
- * data_device_motion - It's called when the drag and drop selection moves across
- *                      wl_surface.
- * data_device_drop - It's called when D&D operation is sucessfully finished and
- *                    we can read the data from D&D.
+ * data_device_motion - It's called when the drag and drop selection moves
+ *                      across wl_surface.
+ * data_device_drop - It's called when D&D operation is sucessfully finished
+ *                    and we can read the data from D&D.
  *                    It's generated only if we call wl_data_offer_accept() and
- *                    wl_data_offer_set_actions() from data_device_motion callback.
+ *                    wl_data_offer_set_actions() from data_device_motion
+ *                    callback.
  */
 static const struct wl_data_device_listener data_device_listener = {
     data_device_data_offer,
     data_device_enter,
     data_device_leave,
     data_device_motion,
     data_device_drop,
     data_device_selection
@@ -681,24 +682,25 @@ primary_selection_selection (void       
     nsRetrievalContextWayland *context =
         static_cast<nsRetrievalContextWayland*>(data);
     context->SetPrimaryDataOffer(gtk_primary_offer);
 }
 
 /* gtk_primary_selection_device callback description:
  *
  * primary_selection_data_offer - It's called when there's a new
- *                          gtk_primary_selection_offer available.
- *                          We need to attach gtk_primary_selection_offer_listener
- *                          to it to get available MIME types.
+ *                          gtk_primary_selection_offer available.  We need to
+ *                          attach gtk_primary_selection_offer_listener to it
+ *                          to get available MIME types.
  *
- * primary_selection_selection - It's called when the new gtk_primary_selection_offer
- *                          is a primary selection content. It can be also called with
- *                          gtk_primary_selection_offer = null which means there's no
- *                          primary selection.
+ * primary_selection_selection - It's called when the new
+ *                          gtk_primary_selection_offer is a primary selection
+ *                          content. It can be also called with
+ *                          gtk_primary_selection_offer = null which means
+ *                          there's no primary selection.
  */
 static const struct
 gtk_primary_selection_device_listener primary_selection_device_listener = {
     primary_selection_data_offer,
     primary_selection_selection,
 };
 
 bool
--- a/widget/gtk/nsPrintSettingsGTK.h
+++ b/widget/gtk/nsPrintSettingsGTK.h
@@ -130,18 +130,20 @@ protected:
   /**
    * Re-initialize mUnwriteableMargin with values from mPageSetup.
    * Should be called whenever mPageSetup is initialized or overwritten.
    */
   void InitUnwriteableMargin();
 
   /**
    * On construction:
-   * - mPrintSettings and mPageSetup are just new objects with defaults determined by GTK.
-   * - mGTKPrinter is nullptr!!! Remember to be careful when accessing this property.
+   * - mPrintSettings and mPageSetup are just new objects with defaults
+   *   determined by GTK.
+   * - mGTKPrinter is nullptr!!! Remember to be careful when accessing this
+   *   property.
    */
   GtkPageSetup* mPageSetup;
   GtkPrintSettings* mPrintSettings;
   GtkPrinter* mGTKPrinter;
 
   bool mPrintSelectionOnly;
 };
 
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -1633,27 +1633,29 @@ nsBaseWidget::ResizeClient(double aX,
 
 //-------------------------------------------------------------------------
 //
 // Bounds
 //
 //-------------------------------------------------------------------------
 
 /**
-* If the implementation of nsWindow supports borders this method MUST be overridden
+* If the implementation of nsWindow supports borders this method MUST be
+* overridden
 *
 **/
 LayoutDeviceIntRect
 nsBaseWidget::GetClientBounds()
 {
   return GetBounds();
 }
 
 /**
-* If the implementation of nsWindow supports borders this method MUST be overridden
+* If the implementation of nsWindow supports borders this method MUST be
+* overridden
 *
 **/
 LayoutDeviceIntRect
 nsBaseWidget::GetBounds()
 {
   return mBounds;
 }
 
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -758,32 +758,37 @@ class nsIWidget : public nsISupports
      **/
     virtual void MoveClient(double aX, double aY) = 0;
 
     /**
      * Resize this widget. Any size constraints set for the window by a
      * previous call to SetSizeConstraints will be applied.
      *
      * @param aWidth  the new width expressed in the parent's coordinate system
-     * @param aHeight the new height expressed in the parent's coordinate system
+     * @param aHeight the new height expressed in the parent's coordinate
+     *                system
      * @param aRepaint whether the widget should be repainted
      */
     virtual void Resize(double aWidth,
                         double aHeight,
                         bool   aRepaint) = 0;
 
     /**
      * Move or resize this widget. Any size constraints set for the window by
      * a previous call to SetSizeConstraints will be applied.
      *
-     * @param aX       the new x position expressed in the parent's coordinate system
-     * @param aY       the new y position expressed in the parent's coordinate system
+     * @param aX       the new x position expressed in the parent's coordinate
+     *                 system
+     * @param aY       the new y position expressed in the parent's coordinate
+     *                 system
      * @param aWidth   the new width expressed in the parent's coordinate system
-     * @param aHeight  the new height expressed in the parent's coordinate system
-     * @param aRepaint whether the widget should be repainted if the size changes
+     * @param aHeight  the new height expressed in the parent's coordinate
+     *                 system
+     * @param aRepaint whether the widget should be repainted if the size
+     *                 changes
      *
      */
     virtual void Resize(double aX,
                         double aY,
                         double aWidth,
                         double aHeight,
                         bool   aRepaint) = 0;
 
--- a/widget/windows/GfxInfo.cpp
+++ b/widget/windows/GfxInfo.cpp
@@ -37,18 +37,19 @@ static const uint32_t allWindowsVersions
 
 GfxInfo::GfxInfo()
  :  mWindowsVersion(0),
     mActiveGPUIndex(0),
     mHasDualGPU(false)
 {
 }
 
-/* GetD2DEnabled and GetDwriteEnabled shouldn't be called until after gfxPlatform initialization
- * has occurred because they depend on it for information. (See bug 591561) */
+/* GetD2DEnabled and GetDwriteEnabled shouldn't be called until after
+ * gfxPlatform initialization has occurred because they depend on it for
+ * information. (See bug 591561) */
 nsresult
 GfxInfo::GetD2DEnabled(bool *aEnabled)
 {
   // Telemetry queries this during XPCOM initialization, and there's no
   // gfxPlatform by then. Just bail out if gfxPlatform isn't initialized.
   if (!gfxPlatform::Initialized()) {
     *aEnabled = false;
     return NS_OK;
@@ -348,17 +349,18 @@ GfxInfo::Init()
     // we did not find a nullptr
     return rv;
   }
 
   mDeviceKeyDebug = displayDevice.DeviceKey;
 
   /* DeviceKey is "reserved" according to MSDN so we'll be careful with it */
   /* check that DeviceKey begins with DEVICE_KEY_PREFIX */
-  /* some systems have a DeviceKey starting with \REGISTRY\Machine\ so we need to compare case insenstively */
+  /* some systems have a DeviceKey starting with \REGISTRY\Machine\ so we need
+   * to compare case insenstively */
   if (_wcsnicmp(displayDevice.DeviceKey, DEVICE_KEY_PREFIX, ArrayLength(DEVICE_KEY_PREFIX)-1) != 0)
     return rv;
 
   // chop off DEVICE_KEY_PREFIX
   mDeviceKey[0] = displayDevice.DeviceKey + ArrayLength(DEVICE_KEY_PREFIX)-1;
 
   mDeviceID[0] = displayDevice.DeviceID;
   mDeviceString[0] = displayDevice.DeviceString;
--- a/widget/windows/WinUtils.cpp
+++ b/widget/windows/WinUtils.cpp
@@ -1195,17 +1195,18 @@ WinUtils::InvalidatePluginAsWorkaround(n
     ::InvalidateRect(next, &rect, FALSE);
   }
 }
 
 #ifdef MOZ_PLACES
 /************************************************************************
  * Constructs as AsyncFaviconDataReady Object
  * @param aIOThread : the thread which performs the action
- * @param aURLShortcut : Differentiates between (false)Jumplistcache and (true)Shortcutcache
+ * @param aURLShortcut : Differentiates between (false)Jumplistcache and
+ *                       (true)Shortcutcache
  ************************************************************************/
 
 AsyncFaviconDataReady::AsyncFaviconDataReady(nsIURI *aNewURI, 
                                              nsCOMPtr<nsIThread> &aIOThread, 
                                              const bool aURLShortcut):
   mNewURI(aNewURI),
   mIOThread(aIOThread),
   mURLShortcut(aURLShortcut)
@@ -1509,17 +1510,18 @@ AsyncDeleteAllFaviconsFromDisk::~AsyncDe
 /*
  * (static) If the data is available, will return the path on disk where 
  * the favicon for page aFaviconPageURI is stored.  If the favicon does not
  * exist, or its cache is expired, this method will kick off an async request
  * for the icon so that next time the method is called it will be available. 
  * @param aFaviconPageURI The URI of the page to obtain
  * @param aICOFilePath The path of the icon file
  * @param aIOThread The thread to perform the Fetch on
- * @param aURLShortcut to distinguish between jumplistcache(false) and shortcutcache(true)
+ * @param aURLShortcut to distinguish between jumplistcache(false) and
+ *        shortcutcache(true)
  */
 nsresult FaviconHelper::ObtainCachedIconFile(nsCOMPtr<nsIURI> aFaviconPageURI,
                                              nsString &aICOFilePath,
                                              nsCOMPtr<nsIThread> &aIOThread,
                                              bool aURLShortcut)
 {
   // Obtain the ICO file path
   nsCOMPtr<nsIFile> icoFile;
--- a/widget/windows/nsClipboard.cpp
+++ b/widget/windows/nsClipboard.cpp
@@ -438,37 +438,39 @@ nsresult nsClipboard::GetNativeDataOffCl
     static CLIPFORMAT preferredDropEffect = ::RegisterClipboardFormat(CFSTR_PREFERREDDROPEFFECT);
 
     switch (stm.tymed) {
      case TYMED_HGLOBAL: 
         {
           switch (fe.cfFormat) {
             case CF_TEXT:
               {
-                // Get the data out of the global data handle. The size we return
-                // should not include the null because the other platforms don't
-                // use nulls, so just return the length we get back from strlen(),
-                // since we know CF_TEXT is null terminated. Recall that GetGlobalData() 
-                // returns the size of the allocated buffer, not the size of the data 
-                // (on 98, these are not the same) so we can't use that.
+                // Get the data out of the global data handle. The size we
+                // return should not include the null because the other
+                // platforms don't use nulls, so just return the length we get
+                // back from strlen(), since we know CF_TEXT is null
+                // terminated. Recall that GetGlobalData() returns the size of
+                // the allocated buffer, not the size of the data (on 98, these
+                // are not the same) so we can't use that.
                 uint32_t allocLen = 0;
                 if ( NS_SUCCEEDED(GetGlobalData(stm.hGlobal, aData, &allocLen)) ) {
                   *aLen = strlen ( reinterpret_cast<char*>(*aData) );
                   result = NS_OK;
                 }
               } break;
 
             case CF_UNICODETEXT:
               {
-                // Get the data out of the global data handle. The size we return
-                // should not include the null because the other platforms don't
-                // use nulls, so just return the length we get back from strlen(),
-                // since we know CF_UNICODETEXT is null terminated. Recall that GetGlobalData() 
-                // returns the size of the allocated buffer, not the size of the data 
-                // (on 98, these are not the same) so we can't use that.
+                // Get the data out of the global data handle. The size we
+                // return should not include the null because the other
+                // platforms don't use nulls, so just return the length we get
+                // back from strlen(), since we know CF_UNICODETEXT is null
+                // terminated. Recall that GetGlobalData() returns the size of
+                // the allocated buffer, not the size of the data (on 98, these
+                // are not the same) so we can't use that.
                 uint32_t allocLen = 0;
                 if ( NS_SUCCEEDED(GetGlobalData(stm.hGlobal, aData, &allocLen)) ) {
                   *aLen = NS_strlen(reinterpret_cast<char16_t*>(*aData)) * 2;
                   result = NS_OK;
                 }
               } break;
 
             case CF_DIBV5:
@@ -535,33 +537,36 @@ nsresult nsClipboard::GetNativeDataOffCl
               } break;
 
             default: {
               if ( fe.cfFormat == fileDescriptorFlavorA || fe.cfFormat == fileDescriptorFlavorW || fe.cfFormat == fileFlavor ) {
                 NS_WARNING ( "Mozilla doesn't yet understand how to read this type of file flavor" );
               } 
               else
               {
-                // Get the data out of the global data handle. The size we return
-                // should not include the null because the other platforms don't
-                // use nulls, so just return the length we get back from strlen(),
-                // since we know CF_UNICODETEXT is null terminated. Recall that GetGlobalData() 
-                // returns the size of the allocated buffer, not the size of the data 
-                // (on 98, these are not the same) so we can't use that.
+                // Get the data out of the global data handle. The size we
+                // return should not include the null because the other
+                // platforms don't use nulls, so just return the length we get
+                // back from strlen(), since we know CF_UNICODETEXT is null
+                // terminated. Recall that GetGlobalData() returns the size of
+                // the allocated buffer, not the size of the data (on 98, these
+                // are not the same) so we can't use that.
                 //
-                // NOTE: we are assuming that anything that falls into this default case
-                //        is unicode. As we start to get more kinds of binary data, this
-                //        may become an incorrect assumption. Stay tuned.
+                // NOTE: we are assuming that anything that falls into this
+                //        default case is unicode. As we start to get more
+                //        kinds of binary data, this may become an incorrect
+                //        assumption. Stay tuned.
                 uint32_t allocLen = 0;
                 if ( NS_SUCCEEDED(GetGlobalData(stm.hGlobal, aData, &allocLen)) ) {
                   if ( fe.cfFormat == CF_HTML ) {
-                    // CF_HTML is actually UTF8, not unicode, so disregard the assumption
-                    // above. We have to check the header for the actual length, and we'll
-                    // do that in FindPlatformHTML(). For now, return the allocLen. This
-                    // case is mostly to ensure we don't try to call strlen on the buffer.
+                    // CF_HTML is actually UTF8, not unicode, so disregard the
+                    // assumption above. We have to check the header for the
+                    // actual length, and we'll do that in FindPlatformHTML().
+                    // For now, return the allocLen. This case is mostly to
+                    // ensure we don't try to call strlen on the buffer.
                     *aLen = allocLen;
                   } else if (fe.cfFormat == CF_CUSTOMTYPES) {
                     // Binary data
                     *aLen = allocLen;
                   } else if (fe.cfFormat == preferredDropEffect) {
                     // As per the MSDN doc entitled: "Shell Clipboard Formats"
                     // CFSTR_PREFERREDDROPEFFECT should return a DWORD
                     // Reference: http://msdn.microsoft.com/en-us/library/bb776902(v=vs.85).aspx
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -7005,18 +7005,19 @@ bool nsWindow::OnTouch(WPARAM wParam, LP
     MultiTouchInput touchInput, touchEndInput;
 
     // Walk across the touch point array processing each contact point.
     for (uint32_t i = 0; i < cInputs; i++) {
       bool addToEvent = false, addToEndEvent = false;
 
       // N.B.: According with MS documentation
       // https://msdn.microsoft.com/en-us/library/windows/desktop/dd317334(v=vs.85).aspx
-      // TOUCHEVENTF_DOWN cannot be combined with TOUCHEVENTF_MOVE or TOUCHEVENTF_UP.
-      // Possibly, it means that TOUCHEVENTF_MOVE and TOUCHEVENTF_UP can be combined together.
+      // TOUCHEVENTF_DOWN cannot be combined with TOUCHEVENTF_MOVE or
+      // TOUCHEVENTF_UP.  Possibly, it means that TOUCHEVENTF_MOVE and
+      // TOUCHEVENTF_UP can be combined together.
 
       if (pInputs[i].dwFlags & (TOUCHEVENTF_DOWN | TOUCHEVENTF_MOVE)) {
         if (touchInput.mTimeStamp.IsNull()) {
           // Initialize a touch event to send.
           touchInput.mType = MultiTouchInput::MULTITOUCH_MOVE;
           touchInput.mTime = ::GetMessageTime();
           touchInput.mTimeStamp = GetMessageTimeStamp(touchInput.mTime);
           ModifierKeyState modifierKeyState;
--- a/widget/x11/keysym2ucs.c
+++ b/widget/x11/keysym2ucs.c
@@ -40,16 +40,17 @@
  */
 
 #include "keysym2ucs.h"
 
 static const struct codepair {
   unsigned short keysym;
   unsigned short ucs;
 } keysymtab[] = {
+  // clang-format off
   { 0x01a1, 0x0104 }, /*                     Aogonek Ą LATIN CAPITAL LETTER A WITH OGONEK */
   { 0x01a2, 0x02d8 }, /*                       breve ˘ BREVE */
   { 0x01a3, 0x0141 }, /*                     Lstroke Ł LATIN CAPITAL LETTER L WITH STROKE */
   { 0x01a5, 0x013d }, /*                      Lcaron Ľ LATIN CAPITAL LETTER L WITH CARON */
   { 0x01a6, 0x015a }, /*                      Sacute Ś LATIN CAPITAL LETTER S WITH ACUTE */
   { 0x01a9, 0x0160 }, /*                      Scaron Š LATIN CAPITAL LETTER S WITH CARON */
   { 0x01aa, 0x015e }, /*                    Scedilla Ş LATIN CAPITAL LETTER S WITH CEDILLA */
   { 0x01ab, 0x0164 }, /*                      Tcaron Ť LATIN CAPITAL LETTER T WITH CARON */
@@ -826,16 +827,17 @@ static const struct codepair {
   { 0x20a5, 0x20a5 }, /*                    MillSign ₥ MILL SIGN */
   { 0x20a6, 0x20a6 }, /*                   NairaSign ₦ NAIRA SIGN */
   { 0x20a7, 0x20a7 }, /*                  PesetaSign ₧ PESETA SIGN */
   { 0x20a8, 0x20a8 }, /*                   RupeeSign ₨ RUPEE SIGN */
   { 0x20a9, 0x20a9 }, /*                     WonSign ₩ WON SIGN */
   { 0x20aa, 0x20aa }, /*               NewSheqelSign ₪ NEW SHEQEL SIGN */
   { 0x20ab, 0x20ab }, /*                    DongSign ₫ DONG SIGN */
   { 0x20ac, 0x20ac }, /*                    EuroSign € EURO SIGN */
+  // clang-format on
 };
 
 long keysym2ucs(KeySym keysym)
 {
     int min = 0;
     int max = sizeof(keysymtab) / sizeof(struct codepair) - 1;
     int mid;
 
--- a/xpcom/base/MemoryMapping.cpp
+++ b/xpcom/base/MemoryMapping.cpp
@@ -119,19 +119,21 @@ GetMemoryMappings(nsTArray<MemoryMapping
   std::string buffer;
   while (std::getline(stream, buffer)) {
     size_t start, end, offset;
     char flags[4] = "---";
     char name[512];
 
     name[0] = 0;
 
+    // clang-format off
     // Match the start of an entry. A typical line looks something like:
     //
     // 1487118a7000-148711a5a000 r-xp 00000000 103:03 54004561                  /usr/lib/libc-2.27.so
+    // clang-format on
     if (sscanf(buffer.c_str(), "%zx-%zx %4c %zx %*u:%*u %*u %511s\n",
                &start, &end, flags, &offset, name) >= 4) {
       PermSet perms;
       if (flags[0] == 'r') {
         perms += Perm::Read;
       }
       if (flags[1] == 'w') {
         perms += Perm::Write;
--- a/xpcom/build/MainThreadIOLogger.cpp
+++ b/xpcom/build/MainThreadIOLogger.cpp
@@ -166,20 +166,22 @@ MainThreadIOLoggerImpl::IOThreadFunc()
         double durationMs = i->mObservation.Duration().ToMilliseconds();
         nsAutoCString nativeFilename;
         nativeFilename.AssignLiteral("(not available)");
         if (!i->mFilename.IsEmpty()) {
           if (NS_FAILED(NS_CopyUnicodeToNative(i->mFilename, nativeFilename))) {
             nativeFilename.AssignLiteral("(conversion failed)");
           }
         }
+        // clang-format off
         /**
          * Format:
          * Start Timestamp (Milliseconds), Operation, Duration (Milliseconds), Event Source, Filename
          */
+        // clang-format on
         if (PR_fprintf(fd, "%f,%s,%f,%s,%s\n",
                        (i->mObservation.Start() - mLogStartTime).ToMilliseconds(),
                        i->mObservation.ObservedOperationString(), durationMs,
                        i->mObservation.Reference(), nativeFilename.get()) > 0) {
 #ifdef MOZ_GECKO_PROFILER
           // TODO: Write out the callstack
           i->mStack = nullptr;
 #endif
--- a/xpcom/ds/nsGkAtoms.h
+++ b/xpcom/ds/nsGkAtoms.h
@@ -41,18 +41,20 @@
 //   public.
 //
 // nsGkAtoms below defines static atoms in a way that satisfies these
 // constraints. It uses nsGkAtomList.h, which defines the names and values of
 // the atoms. nsGkAtomList.h is generated by StaticAtoms.py and has entries
 // that look like this:
 //
 //   GK_ATOM(a, "a", 0x01234567, nsStaticAtom, Atom)
-//   GK_ATOM(bb, "bb", 0x12345678, nsCSSPseudoElementStaticAtom, PseudoElementAtom)
-//   GK_ATOM(Ccc, "Ccc", 0x23456789, nsCSSAnonBoxPseudoStaticAtom, InheritingAnonBoxAtom)
+//   GK_ATOM(bb, "bb", 0x12345678, nsCSSPseudoElementStaticAtom,
+//           PseudoElementAtom)
+//   GK_ATOM(Ccc, "Ccc", 0x23456789, nsCSSAnonBoxPseudoStaticAtom,
+//           InheritingAnonBoxAtom)
 //
 // Comments throughout this file and nsGkAtoms.cpp show how these entries get
 // expanded by macros.
 
 // Trivial subclasses of nsStaticAtom so that function signatures can require
 // an atom from a specific atom list.
 #define DEFINE_STATIC_ATOM_SUBCLASS(name_)                                     \
   class name_ : public nsStaticAtom                                            \
--- a/xpcom/ds/nsTArray-inl.h
+++ b/xpcom/ds/nsTArray-inl.h
@@ -74,17 +74,18 @@ nsTArray_base<Alloc, Copy>::UsesAutoArra
   //
   // This could happen if |*this| lives on the heap and malloc allocated our
   // buffer on the heap adjacent to |*this|.
   //
   // However, we can show that this can't happen.  If |this| is an auto array
   // (as we ensured at the beginning of the method), GetAutoArrayBuffer(8)
   // always points to memory owned by |*this|, because (as we assert below)
   //
-  //   * GetAutoArrayBuffer(8) is at most 4 bytes past GetAutoArrayBuffer(4), and
+  //   * GetAutoArrayBuffer(8) is at most 4 bytes past GetAutoArrayBuffer(4),
+  //     and
   //   * sizeof(nsTArrayHeader) > 4.
   //
   // Since AutoTArray always contains an nsTArrayHeader,
   // GetAutoArrayBuffer(8) will always point inside the auto array object,
   // even if it doesn't point at the beginning of the header.
   //
   // Note that this means that we can't store elements with alignment 16 in an
   // nsTArray, because GetAutoArrayBuffer(16) could lie outside the memory
--- a/xpcom/ds/nsTHashtable.h
+++ b/xpcom/ds/nsTHashtable.h
@@ -514,17 +514,18 @@ ImplCycleCollectionTraverse(nsCycleColle
  * might slightly improve performance as well.
  */
 
 /**
  * We need a separate entry type class for the inheritance structure of the
  * nsTHashtable specialization below; nsVoidPtrHashKey is simply typedefed to a
  * specialization of nsPtrHashKey, and the formulation:
  *
- * class nsTHashtable<nsPtrHashKey<T>> : protected nsTHashtable<nsPtrHashKey<const void>
+ * class nsTHashtable<nsPtrHashKey<T>> :
+ *   protected nsTHashtable<nsPtrHashKey<const void>
  *
  * is not going to turn out very well, since we'd wind up with an nsTHashtable
  * instantiation that is its own base class.
  */
 namespace detail {
 
 class VoidPtrHashKey : public nsPtrHashKey<const void>
 {
--- a/xpcom/io/nsLinebreakConverter.h
+++ b/xpcom/io/nsLinebreakConverter.h
@@ -34,96 +34,111 @@ public:
 
   enum {
     kIgnoreLen = -1
   };
 
   /* ConvertLineBreaks
    * Convert line breaks in the supplied string, allocating and returning
    * a new buffer. Returns nullptr on failure.
-   * @param aSrc: the source string. if aSrcLen == kIgnoreLen this string is assumed
-   *              to be null terminated, otherwise it must be at least aSrcLen long.
-   * @param aSrcBreaks: the line breaks in the source. If unknown, pass eLinebreakAny.
-   *              If known, pass the known value, as this may be more efficient.
+   * @param aSrc: the source string. if aSrcLen == kIgnoreLen this string is
+   *              assumed to be null terminated, otherwise it must be at least
+   *              aSrcLen long.
+   * @param aSrcBreaks: the line breaks in the source. If unknown, pass
+   *              eLinebreakAny.  If known, pass the known value, as this may
+   *              be more efficient.
    * @param aDestBreaks: the line breaks you want in the output.
-   * @param aSrcLen: length of the source. If -1, the source is assumed to be a null-
-   *              terminated string.
-   * @param aOutLen: used to return character length of returned buffer, if not null.
+   * @param aSrcLen: length of the source. If -1, the source is assumed to be a
+   *              null-terminated string.
+   * @param aOutLen: used to return character length of returned buffer, if not
+   *              null.
    */
   static char* ConvertLineBreaks(const char* aSrc,
                                  ELinebreakType aSrcBreaks, ELinebreakType aDestBreaks,
                                  int32_t aSrcLen = kIgnoreLen, int32_t* aOutLen = nullptr);
 
 
   /* ConvertUnicharLineBreaks
    * Convert line breaks in the supplied string, allocating and returning
    * a new buffer. Returns nullptr on failure.
-   * @param aSrc: the source string. if aSrcLen == kIgnoreLen this string is assumed
-   *              to be null terminated, otherwise it must be at least aSrcLen long.
-   * @param aSrcBreaks: the line breaks in the source. If unknown, pass eLinebreakAny.
-   *              If known, pass the known value, as this may be more efficient.
+   * @param aSrc: the source string. if aSrcLen == kIgnoreLen this string is
+   *              assumed to be null terminated, otherwise it must be at least
+   *              aSrcLen long.
+   * @param aSrcBreaks: the line breaks in the source. If unknown, pass
+   *              eLinebreakAny.  If known, pass the known value, as this may
+   *              be more efficient.
    * @param aDestBreaks: the line breaks you want in the output.
-   * @param aSrcLen: length of the source, in characters. If -1, the source is assumed to be a null-
-   *              terminated string.
-   * @param aOutLen: used to return character length of returned buffer, if not null.
+   * @param aSrcLen: length of the source, in characters. If -1, the source is
+   *              assumed to be a null-terminated string.
+   * @param aOutLen: used to return character length of returned buffer, if not
+   *              null.
    */
   static char16_t* ConvertUnicharLineBreaks(const char16_t* aSrc,
                                             ELinebreakType aSrcBreaks, ELinebreakType aDestBreaks,
                                             int32_t aSrcLen = kIgnoreLen, int32_t* aOutLen = nullptr);
 
 
   /* ConvertStringLineBreaks
    * Convert line breaks in the supplied string, changing the string buffer (i.e. in-place conversion)
    * @param ioString: the string to be converted.
-   * @param aSrcBreaks: the line breaks in the source. If unknown, pass eLinebreakAny.
-   *              If known, pass the known value, as this may be more efficient.
+   * @param aSrcBreaks: the line breaks in the source. If unknown, pass
+   *              eLinebreakAny.  If known, pass the known value, as this may
+   *              be more efficient.
    * @param aDestBreaks: the line breaks you want in the output.
-   * @param aSrcLen: length of the source, in characters. If -1, the source is assumed to be a null-
-   *              terminated string.
+   * @param aSrcLen: length of the source, in characters. If -1, the source is
+   *              assumed to be a null-terminated string.
    */
   static nsresult ConvertStringLineBreaks(nsString& aIoString,
                                           ELinebreakType aSrcBreaks,
                                           ELinebreakType aDestBreaks);
 
 
   /* ConvertLineBreaksInSitu
-   * Convert line breaks in place if possible. NOTE: THIS MAY REALLOCATE THE BUFFER,
-   * BUT IT WON'T FREE THE OLD BUFFER (because it doesn't know how). So be prepared
-   * to keep a copy of the old pointer, and free it if this passes back a new pointer.
-   * ALSO NOTE: DON'T PASS A STATIC STRING POINTER TO THIS FUNCTION.
+   * Convert line breaks in place if possible. NOTE: THIS MAY REALLOCATE THE
+   * BUFFER, BUT IT WON'T FREE THE OLD BUFFER (because it doesn't know how). So
+   * be prepared to keep a copy of the old pointer, and free it if this passes
+   * back a new pointer.  ALSO NOTE: DON'T PASS A STATIC STRING POINTER TO THIS
+   * FUNCTION.
    *
-   * @param ioBuffer: the source buffer. if aSrcLen == kIgnoreLen this string is assumed
-   *              to be null terminated, otherwise it must be at least aSrcLen long.
-   * @param aSrcBreaks: the line breaks in the source. If unknown, pass eLinebreakAny.
-   *              If known, pass the known value, as this may be more efficient.
+   * @param ioBuffer: the source buffer. if aSrcLen == kIgnoreLen this string
+   *              is assumed to be null terminated, otherwise it must be at
+   *              least aSrcLen long.
+   * @param aSrcBreaks: the line breaks in the source. If unknown, pass
+   *              eLinebreakAny.  If known, pass the known value, as this may
+   *              be more efficient.
    * @param aDestBreaks: the line breaks you want in the output.
-   * @param aSrcLen: length of the source. If -1, the source is assumed to be a null-
-   *              terminated string.
-   * @param aOutLen: used to return character length of returned buffer, if not null.
+   * @param aSrcLen: length of the source. If -1, the source is assumed to be a
+   *              null-terminated string.
+   * @param aOutLen: used to return character length of returned buffer, if not
+   *              null.
    */
   static nsresult ConvertLineBreaksInSitu(char** aIoBuffer,
                                           ELinebreakType aSrcBreaks,
                                           ELinebreakType aDestBreaks,
                                           int32_t aSrcLen = kIgnoreLen,
                                           int32_t* aOutLen = nullptr);
 
 
   /* ConvertUnicharLineBreaksInSitu
-   * Convert line breaks in place if possible. NOTE: THIS MAY REALLOCATE THE BUFFER,
-   * BUT IT WON'T FREE THE OLD BUFFER (because it doesn't know how). So be prepared
-   * to keep a copy of the old pointer, and free it if this passes back a new pointer.
+   * Convert line breaks in place if possible. NOTE: THIS MAY REALLOCATE THE
+   * BUFFER, BUT IT WON'T FREE THE OLD BUFFER (because it doesn't know how). So
+   * be prepared to keep a copy of the old pointer, and free it if this passes
+   * back a new pointer.
    *
-   * @param ioBuffer: the source buffer. if aSrcLen == kIgnoreLen this string is assumed
-   *              to be null terminated, otherwise it must be at least aSrcLen long.
-   * @param aSrcBreaks: the line breaks in the source. If unknown, pass eLinebreakAny.
-   *              If known, pass the known value, as this may be more efficient.
+   * @param ioBuffer: the source buffer. if aSrcLen == kIgnoreLen this string
+   *              is assumed to be null terminated, otherwise it must be at
+   *              least aSrcLen long.
+   * @param aSrcBreaks: the line breaks in the source. If unknown, pass
+   *              eLinebreakAny.  If known, pass the known value, as this may
+   *              be more efficient.
    * @param aDestBreaks: the line breaks you want in the output.
-   * @param aSrcLen: length of the source in characters. If -1, the source is assumed to be a null-
-   *              terminated string.
-   * @param aOutLen: used to return character length of returned buffer, if not null.
+   * @param aSrcLen: length of the source in characters. If -1, the source is
+   *              assumed to be a null-terminated string.
+   * @param aOutLen: used to return character length of returned buffer, if not
+   *              null.
    */
   static nsresult ConvertUnicharLineBreaksInSitu(char16_t** aIoBuffer,
                                                  ELinebreakType aSrcBreaks,
                                                  ELinebreakType aDestBreaks,
                                                  int32_t aSrcLen = kIgnoreLen,
                                                  int32_t* aOutLen = nullptr);
 
 };
--- a/xpcom/io/nsLocalFileCommon.cpp
+++ b/xpcom/io/nsLocalFileCommon.cpp
@@ -37,17 +37,18 @@ nsLocalFile::InitWithFile(nsIFile* aFile
   }
   return InitWithNativePath(path);
 }
 #endif
 
 #define kMaxFilenameLength 255
 #define kMaxExtensionLength 100
 #define kMaxSequenceNumberLength 5 // "-9999"
-// requirement: kMaxExtensionLength < kMaxFilenameLength - kMaxSequenceNumberLength
+// requirement: kMaxExtensionLength <
+//                kMaxFilenameLength - kMaxSequenceNumberLength
 
 NS_IMETHODIMP
 nsLocalFile::CreateUnique(uint32_t aType, uint32_t aAttributes)
 {
   nsresult rv;
   bool longName;
 
 #ifdef XP_WIN
--- a/xpcom/string/nsStringIterator.h
+++ b/xpcom/string/nsStringIterator.h
@@ -40,18 +40,20 @@ private:
 
 public:
   nsReadingIterator()
     : mStart(nullptr)
     , mEnd(nullptr)
     , mPosition(nullptr)
   {
   }
+  // clang-format off
   // nsReadingIterator( const nsReadingIterator<CharT>& );                    // auto-generated copy-constructor OK
   // nsReadingIterator<CharT>& operator=( const nsReadingIterator<CharT>& );  // auto-generated copy-assignment operator OK
+  // clang-format on
 
   pointer get() const
   {
     return mPosition;
   }
 
   CharT operator*() const
   {
--- a/xpcom/string/nsStringObsolete.cpp
+++ b/xpcom/string/nsStringObsolete.cpp
@@ -382,18 +382,20 @@ Compare1To2(const char* aStr1,const char
 
 /**
  * This method compresses duplicate runs of a given char from the given buffer
  *
  * @update	rickg 03.23.2000
  * @param   aString is the buffer to be manipulated
  * @param   aLength is the length of the buffer
  * @param   aSet tells us which chars to compress from given buffer
- * @param   aEliminateLeading tells us whether to strip chars from the start of the buffer
- * @param   aEliminateTrailing tells us whether to strip chars from the start of the buffer
+ * @param   aEliminateLeading tells us whether to strip chars from the start of
+ *          the buffer
+ * @param   aEliminateTrailing tells us whether to strip chars from the start
+ *          of the buffer
  * @return  the new length of the given buffer
  */
 static int32_t
 CompressChars1(char* aString,uint32_t aLength,const char* aSet){
 
   char*  from = aString;
   char*  end =  aString + aLength;
   char*  to = from;
@@ -427,18 +429,20 @@ CompressChars1(char* aString,uint32_t aL
 
 /**
  * This method compresses duplicate runs of a given char from the given buffer
  *
  * @update	rickg 03.23.2000
  * @param   aString is the buffer to be manipulated
  * @param   aLength is the length of the buffer
  * @param   aSet tells us which chars to compress from given buffer
- * @param   aEliminateLeading tells us whether to strip chars from the start of the buffer
- * @param   aEliminateTrailing tells us whether to strip chars from the start of the buffer
+ * @param   aEliminateLeading tells us whether to strip chars from the start of
+ *          the buffer
+ * @param   aEliminateTrailing tells us whether to strip chars from the start
+ *          of the buffer
  * @return  the new length of the given buffer
  */
 static int32_t
 CompressChars2(char16_t* aString,uint32_t aLength,const char* aSet) {
 
   char16_t*  from = aString;
   char16_t*  end =  from + aLength;
   char16_t*  to = from;
@@ -470,18 +474,20 @@ CompressChars2(char16_t* aString,uint32_
 
 /**
  * This method strips chars in a given set from the given buffer
  *
  * @update	gess 01/04/99
  * @param   aString is the buffer to be manipulated
  * @param   aLength is the length of the buffer
  * @param   aSet tells us which chars to compress from given buffer
- * @param   aEliminateLeading tells us whether to strip chars from the start of the buffer
- * @param   aEliminateTrailing tells us whether to strip chars from the start of the buffer
+ * @param   aEliminateLeading tells us whether to strip chars from the start of
+ *          the buffer
+ * @param   aEliminateTrailing tells us whether to strip chars from the start
+ *          of the buffer
  * @return  the new length of the given buffer
  */
 static int32_t
 StripChars1(char* aString,uint32_t aLength,const char* aSet) {
 
   // XXX(darin): this code should defer writing until necessary.
 
   char*  to   = aString;
@@ -504,18 +510,20 @@ StripChars1(char* aString,uint32_t aLeng
 
 /**
  * This method strips chars in a given set from the given buffer
  *
  * @update	gess 01/04/99
  * @param   aString is the buffer to be manipulated
  * @param   aLength is the length of the buffer
  * @param   aSet tells us which chars to compress from given buffer
- * @param   aEliminateLeading tells us whether to strip chars from the start of the buffer
- * @param   aEliminateTrailing tells us whether to strip chars from the start of the buffer
+ * @param   aEliminateLeading tells us whether to strip chars from the start of
+ *          the buffer
+ * @param   aEliminateTrailing tells us whether to strip chars from the start
+ *          of the buffer
  * @return  the new length of the given buffer
  */
 static int32_t
 StripChars2(char16_t* aString,uint32_t aLength,const char* aSet) {
 
   // XXX(darin): this code should defer writing until necessary.
 
   char16_t*  to   = aString;
--- a/xpcom/string/nsTString.h
+++ b/xpcom/string/nsTString.h
@@ -265,17 +265,18 @@ public:
    *
    *  @param   aChar is the character to search for
    *  @param   aOffset tells us where in this string to start searching
    *  @param   aCount tells us how far from the offset we are to search.
    *           Use -1 to search the whole string.
    *  @return  offset in string, or kNotFound
    */
 
-  // int32_t FindChar( char16_t aChar, int32_t aOffset=0, int32_t aCount=-1 ) const;
+  // int32_t FindChar( char16_t aChar, int32_t aOffset=0,
+  //                   int32_t aCount=-1 ) const;
   int32_t RFindChar(char16_t aChar, int32_t aOffset = -1,
                     int32_t aCount = -1) const;
 
 
   /**
    * This method searches this string for the first character found in
    * the given string.
    *
@@ -357,23 +358,27 @@ public:
    * @return  single-precision float rep of string value
    */
   float ToFloat(nsresult* aErrorCode) const;
 
   /**
    * |Left|, |Mid|, and |Right| are annoying signatures that seem better almost
    * any _other_ way than they are now.  Consider these alternatives
    *
-   * aWritable = aReadable.Left(17);   // ...a member function that returns a |Substring|
-   * aWritable = Left(aReadable, 17);  // ...a global function that returns a |Substring|
-   * Left(aReadable, 17, aWritable);   // ...a global function that does the assignment
+   * // ...a member function that returns a |Substring|
+   * aWritable = aReadable.Left(17);
+   * // ...a global function that returns a |Substring|
+   * aWritable = Left(aReadable, 17);
+   * // ...a global function that does the assignment
+   * Left(aReadable, 17, aWritable);
    *
    * as opposed to the current signature
    *
-   * aReadable.Left(aWritable, 17);    // ...a member function that does the assignment
+   * // ...a member function that does the assignment
+   * aReadable.Left(aWritable, 17);
    *
    * or maybe just stamping them out in favor of |Substring|, they are just duplicate functionality
    *
    * aWritable = Substring(aReadable, 0, 17);
    */
 
   size_type Mid(self_type& aResult, index_type aStartPos, size_type aCount) const;
 
--- a/xpcom/string/nsTSubstring.cpp
+++ b/xpcom/string/nsTSubstring.cpp
@@ -1465,18 +1465,18 @@ nsTSubstring<T>::SizeOfExcludingThisIfUn
   if (this->mDataFlags & DataFlags::OWNED) {
     return aMallocSizeOf(this->mData);
   }
 
   // If we reach here, exactly one of the following must be true:
   // - DataFlags::VOIDED is set, and this->mData points to sEmptyBuffer;
   // - DataFlags::INLINE is set, and this->mData points to a buffer within a
   //   string object (e.g. nsAutoString);
-  // - None of DataFlags::REFCOUNTED, DataFlags::OWNED, DataFlags::INLINE is set,
-  //   and this->mData points to a buffer owned by something else.
+  // - None of DataFlags::REFCOUNTED, DataFlags::OWNED, DataFlags::INLINE is
+  //   set, and this->mData points to a buffer owned by something else.
   //
   // In all three cases, we don't measure it.
   return 0;
 }
 
 template <typename T>
 size_t
 nsTSubstring<T>::SizeOfExcludingThisEvenIfShared(
--- a/xpcom/threads/Queue.h
+++ b/xpcom/threads/Queue.h
@@ -132,17 +132,18 @@ public:
     }
 
     /* How we count the number of events in the queue:
      * 1. Let pageCount(x, y) denote the number of pages excluding the tail page
      *    where x is the index of head page and y is the index of the tail page.
      * 2. Then we have pageCount(x, y) = y - x.
      *
      * Ex: pageCount(0, 0) = 0 where both head and tail pages point to page 0.
-     *     pageCount(0, 1) = 1 where head points to page 0 and tail points page 1.
+     *     pageCount(0, 1) = 1 where head points to page 0 and tail points
+     *     page 1.
      *
      * 3. number of events = (ItemsPerPage * pageCount(x, y))
      *      - (empty slots in head page) + (non-empty slots in tail page)
      *      = (ItemsPerPage * pageCount(x, y)) - mOffsetHead + mOffsetTail
      */
 
     int count = -mOffsetHead;
 
--- a/xpcom/threads/nsThreadUtils.h
+++ b/xpcom/threads/nsThreadUtils.h
@@ -1115,31 +1115,31 @@ struct NonParameterStorageClass
                          typename PointerStorageClass<
                            typename mozilla::RemovePointer<T>::Type
                          >::Type,
                          typename NonPointerStorageClass<T>::Type>
 {};
 
 // Choose storage&passing strategy based on preferred storage type:
 // - If IsParameterStorageClass<T>::value is true, use as-is.
-// - RC*       -> StoreRefPtrPassByPtr<RC>       : Store RefPtr<RC>, pass RC*
+// - RC*       -> StoreRefPtrPassByPtr<RC>       :Store RefPtr<RC>, pass RC*
 //   ^^ RC quacks like a ref-counted type (i.e., has AddRef and Release methods)
-// - const T*  -> StoreConstPtrPassByConstPtr<T> : Store const T*, pass const T*
-// - T*        -> StorePtrPassByPtr<T>           : Store T*, pass T*.
-// - const T&  -> StoreConstRefPassByConstLRef<T>: Store const T&, pass const T&.
-// - T&        -> StoreRefPassByLRef<T>          : Store T&, pass T&.
-// - T&&       -> StoreCopyPassByRRef<T>         : Store T, pass std::move(T).
+// - const T*  -> StoreConstPtrPassByConstPtr<T> :Store const T*, pass const T*
+// - T*        -> StorePtrPassByPtr<T>           :Store T*, pass T*.
+// - const T&  -> StoreConstRefPassByConstLRef<T>:Store const T&, pass const T&.
+// - T&        -> StoreRefPassByLRef<T>          :Store T&, pass T&.
+// - T&&       -> StoreCopyPassByRRef<T>         :Store T, pass std::move(T).
 // - RefPtr<T>, nsCOMPtr<T>
-//             -> StoreRefPtrPassByPtr<T>        : Store RefPtr<T>, pass T*
-// - Other T   -> StoreCopyPassByConstLRef<T>    : Store T, pass const T&.
+//             -> StoreRefPtrPassByPtr<T>        :Store RefPtr<T>, pass T*
+// - Other T   -> StoreCopyPassByConstLRef<T>    :Store T, pass const T&.
 // Other available explicit options:
-// -              StoreCopyPassByValue<T>        : Store T, pass T.
-// -              StoreCopyPassByLRef<T>         : Store T, pass T& (of copy!)
-// -              StoreCopyPassByConstPtr<T>     : Store T, pass const T*
-// -              StoreCopyPassByPtr<T>          : Store T, pass T* (of copy!)
+// -              StoreCopyPassByValue<T>        :Store T, pass T.
+// -              StoreCopyPassByLRef<T>         :Store T, pass T& (of copy!)
+// -              StoreCopyPassByConstPtr<T>     :Store T, pass const T*
+// -              StoreCopyPassByPtr<T>          :Store T, pass T* (of copy!)
 // Or create your own class with PassAsParameter() method, optional
 // clean-up in destructor, and with associated IsParameterStorageClass<>.
 template<typename T>
 struct ParameterStorage
   : mozilla::Conditional<IsParameterStorageClass<T>::value,
                          T,
                          typename NonParameterStorageClass<T>::Type>
 {};
@@ -1353,17 +1353,18 @@ using NonOwningIdleRunnableMethodWithTim
 // to invoke a method (with or without arguments) asynchronously.  You
 // could write a small helper class inheriting from nsRunnable to handle
 // all these details, or you could let NewRunnableMethod take care of all
 // those details for you.
 //
 // The simplest use of NewRunnableMethod looks like:
 //
 //   nsCOMPtr<nsIRunnable> event =
-//     mozilla::NewRunnableMethod("description", myObject, &MyClass::HandleEvent);
+//     mozilla::NewRunnableMethod("description", myObject,
+//                                &MyClass::HandleEvent);
 //   NS_DispatchToCurrentThread(event);
 //
 // Statically enforced constraints:
 //  - myObject must be of (or implicitly convertible to) type MyClass
 //  - MyClass must define AddRef and Release methods
 //
 // The "description" string should specify a human-readable name for the
 // runnable; the provided string is used by various introspection tools
@@ -1381,17 +1382,18 @@ using NonOwningIdleRunnableMethodWithTim
 // (If you find yourself writing contorted code to Release() an object
 // asynchronously on a different thread, you should use the
 // NS_ProxyRelease function.)
 //
 // Invoking a method with arguments takes a little more care.  The
 // natural extension of the above:
 //
 //   nsCOMPtr<nsIRunnable> event =
-//     mozilla::NewRunnableMethod("description", myObject, &MyClass::HandleEvent,
+//     mozilla::NewRunnableMethod("description", myObject,
+//                                &MyClass::HandleEvent,
 //                                arg1, arg2, ...);
 //
 // can lead to security hazards (e.g. passing in raw pointers to refcounted
 // objects and storing those raw pointers in the runnable).  We therefore
 // require you to specify the storage types used by the runnable, just as
 // you would if you were writing out the class by hand:
 //
 //   nsCOMPtr<nsIRunnable> event =