Bug 1014377 - Convert the first quarter of MFBT to Gecko style. r=froydnj.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 29 May 2014 22:40:33 -0700
changeset 185796 038794b1a5bc9886976d9eac1d626f7b31e027b3
parent 185795 dc1eb75430123543f279a386e1930becee6c4af8
child 185797 d271a898515bb4bd6899151aeb6280f5e7969994
push id26863
push userMs2ger@gmail.com
push dateFri, 30 May 2014 12:08:33 +0000
treeherdermozilla-central@76432b693fc4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1014377
milestone32.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 1014377 - Convert the first quarter of MFBT to Gecko style. r=froydnj.
mfbt/Alignment.h
mfbt/AllocPolicy.h
mfbt/Array.h
mfbt/ArrayUtils.h
mfbt/Assertions.h
mfbt/Atomics.h
mfbt/Attributes.h
mfbt/BinarySearch.h
mfbt/BloomFilter.h
mfbt/Casting.h
mfbt/ChaosMode.h
mfbt/Char16.h
mfbt/CheckedInt.h
mfbt/Compression.cpp
mfbt/Compression.h
mfbt/DebugOnly.h
--- a/mfbt/Alignment.h
+++ b/mfbt/Alignment.h
@@ -16,24 +16,24 @@ namespace mozilla {
 
 /*
  * This class, and the corresponding macro MOZ_ALIGNOF, figures out how many
  * bytes of alignment a given type needs.
  */
 template<typename T>
 class AlignmentFinder
 {
-    struct Aligner
-    {
-        char c;
-        T t;
-    };
+  struct Aligner
+  {
+    char mChar;
+    T mT;
+  };
 
-  public:
-    static const size_t alignment = sizeof(Aligner) - sizeof(T);
+public:
+  static const size_t alignment = sizeof(Aligner) - sizeof(T);
 };
 
 #define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment
 
 /*
  * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.
  *
  * For instance,
@@ -66,72 +66,74 @@ struct AlignedElem;
 /*
  * We have to specialize this template because GCC doesn't like __attribute__((aligned(foo))) where
  * foo is a template parameter.
  */
 
 template<>
 struct AlignedElem<1>
 {
-    MOZ_ALIGNED_DECL(uint8_t elem, 1);
+  MOZ_ALIGNED_DECL(uint8_t elem, 1);
 };
 
 template<>
 struct AlignedElem<2>
 {
-    MOZ_ALIGNED_DECL(uint8_t elem, 2);
+  MOZ_ALIGNED_DECL(uint8_t elem, 2);
 };
 
 template<>
 struct AlignedElem<4>
 {
-    MOZ_ALIGNED_DECL(uint8_t elem, 4);
+  MOZ_ALIGNED_DECL(uint8_t elem, 4);
 };
 
 template<>
 struct AlignedElem<8>
 {
-    MOZ_ALIGNED_DECL(uint8_t elem, 8);
+  MOZ_ALIGNED_DECL(uint8_t elem, 8);
 };
 
 template<>
 struct AlignedElem<16>
 {
-    MOZ_ALIGNED_DECL(uint8_t elem, 16);
+  MOZ_ALIGNED_DECL(uint8_t elem, 16);
 };
 
 /*
  * This utility pales in comparison to Boost's aligned_storage. The utility
  * simply assumes that uint64_t is enough alignment for anyone. This may need
  * to be extended one day...
  *
  * As an important side effect, pulling the storage into this template is
  * enough obfuscation to confuse gcc's strict-aliasing analysis into not giving
  * false negatives when we cast from the char buffer to whatever type we've
  * constructed using the bytes.
  */
 template<size_t Nbytes>
 struct AlignedStorage
 {
-    union U {
-      char bytes[Nbytes];
-      uint64_t _;
-    } u;
+  union U
+  {
+    char mBytes[Nbytes];
+    uint64_t mDummy;
+  } u;
 
-    const void* addr() const { return u.bytes; }
-    void* addr() { return u.bytes; }
+  const void* addr() const { return u.mBytes; }
+  void* addr() { return u.mBytes; }
 };
 
 template<typename T>
 struct AlignedStorage2
 {
-    union U {
-      char bytes[sizeof(T)];
-      uint64_t _;
-    } u;
+  union U
+  {
+    char mBytes[sizeof(T)];
+    uint64_t mDummy;
+  } u;
 
-    const T* addr() const { return reinterpret_cast<const T*>(u.bytes); }
-    T* addr() { return static_cast<T*>(static_cast<void*>(u.bytes)); }
+  const T* addr() const { return reinterpret_cast<const T*>(u.mBytes); }
+  T* addr() { return static_cast<T*>(static_cast<void*>(u.mBytes)); }
 };
 
 } /* namespace mozilla */
 
 #endif /* mozilla_Alignment_h */
--- a/mfbt/AllocPolicy.h
+++ b/mfbt/AllocPolicy.h
@@ -44,20 +44,37 @@ namespace mozilla {
  */
 
 /*
  * A policy that straightforwardly uses malloc/calloc/realloc/free and adds no
  * extra behaviors.
  */
 class MallocAllocPolicy
 {
-  public:
-    void* malloc_(size_t bytes) { return malloc(bytes); }
-    void* calloc_(size_t bytes) { return calloc(bytes, 1); }
-    void* realloc_(void* p, size_t oldBytes, size_t bytes) { return realloc(p, bytes); }
-    void free_(void* p) { free(p); }
-    void reportAllocOverflow() const {}
+public:
+  void* malloc_(size_t aBytes)
+  {
+    return malloc(aBytes);
+  }
+
+  void* calloc_(size_t aBytes)
+  {
+    return calloc(aBytes, 1);
+  }
+
+  void* realloc_(void* aPtr, size_t aOldBytes, size_t aBytes)
+  {
+    return realloc(aPtr, aBytes);
+  }
+
+  void free_(void* aPtr)
+  {
+    free(aPtr);
+  }
+
+  void reportAllocOverflow() const
+  {
+  }
 };
 
-
 } // namespace mozilla
 
 #endif /* mozilla_AllocPolicy_h */
--- a/mfbt/Array.h
+++ b/mfbt/Array.h
@@ -14,38 +14,42 @@
 
 #include <stddef.h>
 
 namespace mozilla {
 
 template<typename T, size_t Length>
 class Array
 {
-    T arr[Length];
+  T mArr[Length];
 
-  public:
-    T& operator[](size_t i) {
-      MOZ_ASSERT(i < Length);
-      return arr[i];
-    }
+public:
+  T& operator[](size_t aIndex)
+  {
+    MOZ_ASSERT(aIndex < Length);
+    return mArr[aIndex];
+  }
 
-    const T& operator[](size_t i) const {
-      MOZ_ASSERT(i < Length);
-      return arr[i];
-    }
+  const T& operator[](size_t aIndex) const
+  {
+    MOZ_ASSERT(aIndex < Length);
+    return mArr[aIndex];
+  }
 };
 
 template<typename T>
 class Array<T, 0>
 {
-  public:
-    T& operator[](size_t i) {
-      MOZ_CRASH("indexing into zero-length array");
-    }
+public:
+  T& operator[](size_t aIndex)
+  {
+    MOZ_CRASH("indexing into zero-length array");
+  }
 
-    const T& operator[](size_t i) const {
-      MOZ_CRASH("indexing into zero-length array");
-    }
+  const T& operator[](size_t aIndex) const
+  {
+    MOZ_CRASH("indexing into zero-length array");
+  }
 };
 
 }  /* namespace mozilla */
 
 #endif /* mozilla_Array_h */
--- a/mfbt/ArrayUtils.h
+++ b/mfbt/ArrayUtils.h
@@ -18,73 +18,73 @@
 
 #ifdef __cplusplus
 
 #include "mozilla/Array.h"
 
 namespace mozilla {
 
 /*
- * Safely subtract two pointers when it is known that end >= begin.  This avoids
- * the common compiler bug that if (size_t(end) - size_t(begin)) has the MSB
- * set, the unsigned subtraction followed by right shift will produce -1, or
- * size_t(-1), instead of the real difference.
+ * Safely subtract two pointers when it is known that aEnd >= aBegin.  This
+ * avoids the common compiler bug that if (size_t(aEnd) - size_t(aBegin)) has
+ * the MSB set, the unsigned subtraction followed by right shift will produce
+ * -1, or size_t(-1), instead of the real difference.
  */
 template<class T>
 MOZ_ALWAYS_INLINE size_t
-PointerRangeSize(T* begin, T* end)
+PointerRangeSize(T* aBegin, T* aEnd)
 {
-  MOZ_ASSERT(end >= begin);
-  return (size_t(end) - size_t(begin)) / sizeof(T);
+  MOZ_ASSERT(aEnd >= aBegin);
+  return (size_t(aEnd) - size_t(aBegin)) / sizeof(T);
 }
 
 /*
  * Compute the length of an array with constant length.  (Use of this method
  * with a non-array pointer will not compile.)
  *
  * Beware of the implicit trailing '\0' when using this with string constants.
  */
 template<typename T, size_t N>
 MOZ_CONSTEXPR size_t
-ArrayLength(T (&arr)[N])
+ArrayLength(T (&aArr)[N])
 {
   return N;
 }
 
 template<typename T, size_t N>
 MOZ_CONSTEXPR size_t
-ArrayLength(const Array<T, N>& arr)
+ArrayLength(const Array<T, N>& aArr)
 {
   return N;
 }
 
 /*
  * Compute the address one past the last element of a constant-length array.
  *
  * Beware of the implicit trailing '\0' when using this with string constants.
  */
 template<typename T, size_t N>
 MOZ_CONSTEXPR T*
-ArrayEnd(T (&arr)[N])
+ArrayEnd(T (&aArr)[N])
 {
-  return arr + ArrayLength(arr);
+  return aArr + ArrayLength(aArr);
 }
 
 template<typename T, size_t N>
 MOZ_CONSTEXPR T*
-ArrayEnd(Array<T, N>& arr)
+ArrayEnd(Array<T, N>& aArr)
 {
-  return &arr[0] + ArrayLength(arr);
+  return &aArr[0] + ArrayLength(aArr);
 }
 
 template<typename T, size_t N>
 MOZ_CONSTEXPR const T*
-ArrayEnd(const Array<T, N>& arr)
+ArrayEnd(const Array<T, N>& aArr)
 {
-  return &arr[0] + ArrayLength(arr);
+  return &aArr[0] + ArrayLength(aArr);
 }
 
 namespace detail {
 
 /*
  * Helper for the MOZ_ARRAY_LENGTH() macro to make the length a typesafe
  * compile-time constant even on compilers lacking constexpr support.
  */
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -27,23 +27,23 @@
 #ifdef WIN32
    /*
     * TerminateProcess and GetCurrentProcess are defined in <winbase.h>, which
     * further depends on <windef.h>.  We hardcode these few definitions manually
     * because those headers clutter the global namespace with a significant
     * number of undesired macros and symbols.
     */
 #  ifdef __cplusplus
-   extern "C" {
+extern "C" {
 #  endif
-   __declspec(dllimport) int __stdcall
-   TerminateProcess(void* hProcess, unsigned int uExitCode);
-   __declspec(dllimport) void* __stdcall GetCurrentProcess(void);
+__declspec(dllimport) int __stdcall
+TerminateProcess(void* hProcess, unsigned int uExitCode);
+__declspec(dllimport) void* __stdcall GetCurrentProcess(void);
 #  ifdef __cplusplus
-   }
+}
 #  endif
 #else
 #  include <signal.h>
 #endif
 #ifdef ANDROID
 #  include <android/log.h>
 #endif
 
@@ -119,46 +119,48 @@
 #define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  static_assert(!(cond) || (expr), reason)
 #endif
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /*
- * Prints |s| as an assertion failure (using file and ln as the location of the
- * assertion) to the standard debug-output channel.
+ * Prints |aStr| as an assertion failure (using aFilename and aLine as the
+ * location of the assertion) to the standard debug-output channel.
  *
  * Usually you should use MOZ_ASSERT or MOZ_CRASH instead of this method.  This
  * method is primarily for internal use in this header, and only secondarily
  * for use in implementing release-build assertions.
  */
 static MOZ_ALWAYS_INLINE void
-MOZ_ReportAssertionFailure(const char* s, const char* file, int ln) MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS
+MOZ_ReportAssertionFailure(const char* aStr, const char* aFilename, int aLine)
+  MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS
 {
 #ifdef ANDROID
   __android_log_print(ANDROID_LOG_FATAL, "MOZ_Assert",
-                      "Assertion failure: %s, at %s:%d\n", s, file, ln);
+                      "Assertion failure: %s, at %s:%d\n",
+                      aStr, aFilename, aLine);
 #else
-  fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln);
+  fprintf(stderr, "Assertion failure: %s, at %s:%d\n", aStr, aFilename, aLine);
 #ifdef MOZ_DUMP_ASSERTION_STACK
   nsTraceRefcnt::WalkTheStack(stderr);
 #endif
   fflush(stderr);
 #endif
 }
 
 static MOZ_ALWAYS_INLINE void
-MOZ_ReportCrash(const char* s, const char* file, int ln) MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS
+MOZ_ReportCrash(const char* aStr, const char* aFilename, int aLine) MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS
 {
 #ifdef ANDROID
-    __android_log_print(ANDROID_LOG_FATAL, "MOZ_CRASH",
-                        "Hit MOZ_CRASH(%s) at %s:%d\n", s, file, ln);
+  __android_log_print(ANDROID_LOG_FATAL, "MOZ_CRASH",
+                      "Hit MOZ_CRASH(%s) at %s:%d\n", aStr, aFilename, aLine);
 #else
-  fprintf(stderr, "Hit MOZ_CRASH(%s) at %s:%d\n", s, file, ln);
+  fprintf(stderr, "Hit MOZ_CRASH(%s) at %s:%d\n", aStr, aFilename, aLine);
 #ifdef MOZ_DUMP_ASSERTION_STACK
   nsTraceRefcnt::WalkTheStack(stderr);
 #endif
   fflush(stderr);
 #endif
 }
 
 /**
@@ -314,71 +316,75 @@ MOZ_ReportCrash(const char* s, const cha
 #ifdef MOZ_SUPPORT_ASSERT_CONDITION_TYPE_VALIDATION
 #  include "mozilla/TypeTraits.h"
 namespace mozilla {
 namespace detail {
 
 template<typename T>
 struct IsFunction
 {
-    static const bool value = false;
+  static const bool value = false;
 };
 
 template<typename R, typename... A>
 struct IsFunction<R(A...)>
 {
-    static const bool value = true;
+  static const bool value = true;
 };
 
 template<typename T>
 void ValidateAssertConditionType()
 {
   typedef typename RemoveReference<T>::Type ValueT;
   static_assert(!IsArray<ValueT>::value,
-                "Expected boolean assertion condition, got an array or a string!");
+                "Expected boolean assertion condition, got an array or a "
+                "string!");
   static_assert(!IsFunction<ValueT>::value,
-                "Expected boolean assertion condition, got a function! Did you intend to call that function?");
+                "Expected boolean assertion condition, got a function! Did "
+                "you intend to call that function?");
   static_assert(!IsFloatingPoint<ValueT>::value,
-                "It's often a bad idea to assert that a floating-point number is nonzero, "
-                "because such assertions tend to intermittently fail. Shouldn't your code gracefully handle "
-                "this case instead of asserting? Anyway, if you really want to "
-                "do that, write an explicit boolean condition, like !!x or x!=0.");
+                "It's often a bad idea to assert that a floating-point number "
+                "is nonzero, because such assertions tend to intermittently "
+                "fail. Shouldn't your code gracefully handle this case instead "
+                "of asserting? Anyway, if you really want to do that, write an "
+                "explicit boolean condition, like !!x or x!=0.");
 }
 
 } // namespace detail
 } // namespace mozilla
-#  define MOZ_VALIDATE_ASSERT_CONDITION_TYPE(x) mozilla::detail::ValidateAssertConditionType<decltype(x)>()
+#  define MOZ_VALIDATE_ASSERT_CONDITION_TYPE(x) \
+     mozilla::detail::ValidateAssertConditionType<decltype(x)>()
 #else
 #  define MOZ_VALIDATE_ASSERT_CONDITION_TYPE(x)
 #endif
 
 /* First the single-argument form. */
 #define MOZ_ASSERT_HELPER1(expr) \
-   do { \
-     MOZ_VALIDATE_ASSERT_CONDITION_TYPE(expr); \
-     if (MOZ_UNLIKELY(!(expr))) { \
-       MOZ_ReportAssertionFailure(#expr, __FILE__, __LINE__); \
-       MOZ_REALLY_CRASH(); \
-     } \
-   } while (0)
+  do { \
+    MOZ_VALIDATE_ASSERT_CONDITION_TYPE(expr); \
+    if (MOZ_UNLIKELY(!(expr))) { \
+      MOZ_ReportAssertionFailure(#expr, __FILE__, __LINE__); \
+      MOZ_REALLY_CRASH(); \
+    } \
+  } while (0)
 /* Now the two-argument form. */
 #define MOZ_ASSERT_HELPER2(expr, explain) \
-   do { \
-     MOZ_VALIDATE_ASSERT_CONDITION_TYPE(expr); \
-     if (MOZ_UNLIKELY(!(expr))) { \
-       MOZ_ReportAssertionFailure(#expr " (" explain ")", __FILE__, __LINE__); \
-       MOZ_REALLY_CRASH(); \
-     } \
-   } while (0)
+  do { \
+    MOZ_VALIDATE_ASSERT_CONDITION_TYPE(expr); \
+    if (MOZ_UNLIKELY(!(expr))) { \
+      MOZ_ReportAssertionFailure(#expr " (" explain ")", __FILE__, __LINE__); \
+      MOZ_REALLY_CRASH(); \
+    } \
+  } while (0)
 
 #define MOZ_RELEASE_ASSERT_GLUE(a, b) a b
 #define MOZ_RELEASE_ASSERT(...) \
-   MOZ_RELEASE_ASSERT_GLUE( \
-     MOZ_PASTE_PREFIX_AND_ARG_COUNT(MOZ_ASSERT_HELPER, __VA_ARGS__), \
-     (__VA_ARGS__))
+  MOZ_RELEASE_ASSERT_GLUE( \
+    MOZ_PASTE_PREFIX_AND_ARG_COUNT(MOZ_ASSERT_HELPER, __VA_ARGS__), \
+    (__VA_ARGS__))
 
 #ifdef DEBUG
 #  define MOZ_ASSERT(...) MOZ_RELEASE_ASSERT(__VA_ARGS__)
 #else
 #  define MOZ_ASSERT(...) do { } while(0)
 #endif /* DEBUG */
 
 /*
@@ -406,20 +412,21 @@ void ValidateAssertConditionType()
        if (cond) \
          MOZ_ASSERT(expr); \
      } while (0)
 #else
 #  define MOZ_ASSERT_IF(cond, expr)  do { } while (0)
 #endif
 
 /*
- * MOZ_ASSUME_UNREACHABLE_MARKER() expands to an expression which states that it is
- * undefined behavior for execution to reach this point.  No guarantees are made
- * about what will happen if this is reached at runtime.  Most code should use
- * MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE because it has extra asserts.
+ * MOZ_ASSUME_UNREACHABLE_MARKER() expands to an expression which states that
+ * it is undefined behavior for execution to reach this point.  No guarantees
+ * are made about what will happen if this is reached at runtime.  Most code
+ * should use MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE because it has extra
+ * asserts.
  */
 #if defined(__clang__)
 #  define MOZ_ASSUME_UNREACHABLE_MARKER() __builtin_unreachable()
 #elif defined(__GNUC__)
    /*
     * __builtin_unreachable() was implemented in gcc 4.5.  If we don't have
     * that, call a noreturn function; abort() will do nicely.  Qualify the call
     * in C++ in case there's another abort() visible in local scope.
--- a/mfbt/Atomics.h
+++ b/mfbt/Atomics.h
@@ -109,16 +109,17 @@ enum MemoryOrdering {
    * x86 architectures don't take advantage of the optimization
    * opportunities that relaxed ordering permits.  Thus it's possible
    * that using relaxed ordering will "work" on x86 but fail elsewhere
    * (ARM, say, which *does* implement non-sequentially-consistent
    * relaxed ordering semantics).  Be extra-careful using relaxed
    * ordering if you can't easily test non-x86 architectures!
    */
   Relaxed,
+
   /*
    * When an atomic value is updated with ReleaseAcquire ordering, and
    * that new value is observed with ReleaseAcquire ordering, prior
    * writes (atomic or not) are also observable.  What ReleaseAcquire
    * *doesn't* give you is any observable ordering guarantees for
    * ReleaseAcquire-ordered operations on different objects.  For
    * example, if there are two cores that each perform ReleaseAcquire
    * operations on separate objects, each core may or may not observe
@@ -130,16 +131,17 @@ enum MemoryOrdering {
    *
    * ReleaseAcquire ordering is good for (as the name implies) atomic
    * operations on values controlling ownership of things: reference
    * counts, mutexes, and the like.  However, if you are thinking about
    * using these to implement your own locks or mutexes, you should take
    * a good, hard look at actual lock or mutex primitives first.
    */
   ReleaseAcquire,
+
   /*
    * When an atomic value is updated with SequentiallyConsistent
    * ordering, all writes observable when the update is observed, just
    * as with ReleaseAcquire ordering.  But, furthermore, a global total
    * ordering of SequentiallyConsistent operations *can* be described.
    * For example, if two cores perform SequentiallyConsistent operations
    * on separate objects, one core will observably perform its update
    * (and all previous operations will have completed), then the other
@@ -179,136 +181,163 @@ namespace detail {
  * We provide CompareExchangeFailureOrder to work around a bug in some
  * versions of GCC's <atomic> header.  See bug 898491.
  */
 template<MemoryOrdering Order> struct AtomicOrderConstraints;
 
 template<>
 struct AtomicOrderConstraints<Relaxed>
 {
-    static const std::memory_order AtomicRMWOrder = std::memory_order_relaxed;
-    static const std::memory_order LoadOrder = std::memory_order_relaxed;
-    static const std::memory_order StoreOrder = std::memory_order_relaxed;
-    static const std::memory_order CompareExchangeFailureOrder =
-      std::memory_order_relaxed;
+  static const std::memory_order AtomicRMWOrder = std::memory_order_relaxed;
+  static const std::memory_order LoadOrder = std::memory_order_relaxed;
+  static const std::memory_order StoreOrder = std::memory_order_relaxed;
+  static const std::memory_order CompareExchangeFailureOrder =
+    std::memory_order_relaxed;
 };
 
 template<>
 struct AtomicOrderConstraints<ReleaseAcquire>
 {
-    static const std::memory_order AtomicRMWOrder = std::memory_order_acq_rel;
-    static const std::memory_order LoadOrder = std::memory_order_acquire;
-    static const std::memory_order StoreOrder = std::memory_order_release;
-    static const std::memory_order CompareExchangeFailureOrder =
-      std::memory_order_acquire;
+  static const std::memory_order AtomicRMWOrder = std::memory_order_acq_rel;
+  static const std::memory_order LoadOrder = std::memory_order_acquire;
+  static const std::memory_order StoreOrder = std::memory_order_release;
+  static const std::memory_order CompareExchangeFailureOrder =
+    std::memory_order_acquire;
 };
 
 template<>
 struct AtomicOrderConstraints<SequentiallyConsistent>
 {
-    static const std::memory_order AtomicRMWOrder = std::memory_order_seq_cst;
-    static const std::memory_order LoadOrder = std::memory_order_seq_cst;
-    static const std::memory_order StoreOrder = std::memory_order_seq_cst;
-    static const std::memory_order CompareExchangeFailureOrder =
-      std::memory_order_seq_cst;
+  static const std::memory_order AtomicRMWOrder = std::memory_order_seq_cst;
+  static const std::memory_order LoadOrder = std::memory_order_seq_cst;
+  static const std::memory_order StoreOrder = std::memory_order_seq_cst;
+  static const std::memory_order CompareExchangeFailureOrder =
+    std::memory_order_seq_cst;
 };
 
 template<typename T, MemoryOrdering Order>
 struct IntrinsicBase
 {
-    typedef std::atomic<T> ValueType;
-    typedef AtomicOrderConstraints<Order> OrderedOp;
+  typedef std::atomic<T> ValueType;
+  typedef AtomicOrderConstraints<Order> OrderedOp;
 };
 
 template<typename T, MemoryOrdering Order>
 struct IntrinsicMemoryOps : public IntrinsicBase<T, Order>
 {
-    typedef IntrinsicBase<T, Order> Base;
-    static T load(const typename Base::ValueType& ptr) {
-      return ptr.load(Base::OrderedOp::LoadOrder);
-    }
-    static void store(typename Base::ValueType& ptr, T val) {
-      ptr.store(val, Base::OrderedOp::StoreOrder);
-    }
-    static T exchange(typename Base::ValueType& ptr, T val) {
-      return ptr.exchange(val, Base::OrderedOp::AtomicRMWOrder);
-    }
-    static bool compareExchange(typename Base::ValueType& ptr, T oldVal, T newVal) {
-      return ptr.compare_exchange_strong(oldVal, newVal,
-                                         Base::OrderedOp::AtomicRMWOrder,
-                                         Base::OrderedOp::CompareExchangeFailureOrder);
-    }
+  typedef IntrinsicBase<T, Order> Base;
+
+  static T load(const typename Base::ValueType& aPtr)
+  {
+    return aPtr.load(Base::OrderedOp::LoadOrder);
+  }
+
+  static void store(typename Base::ValueType& aPtr, T aVal)
+  {
+    aPtr.store(aVal, Base::OrderedOp::StoreOrder);
+  }
+
+  static T exchange(typename Base::ValueType& aPtr, T aVal)
+  {
+    return aPtr.exchange(aVal, Base::OrderedOp::AtomicRMWOrder);
+  }
+
+  static bool compareExchange(typename Base::ValueType& aPtr,
+                              T aOldVal, T aNewVal)
+  {
+    return aPtr.compare_exchange_strong(aOldVal, aNewVal,
+                                        Base::OrderedOp::AtomicRMWOrder,
+                                        Base::OrderedOp::CompareExchangeFailureOrder);
+  }
 };
 
 template<typename T, MemoryOrdering Order>
 struct IntrinsicAddSub : public IntrinsicBase<T, Order>
 {
-    typedef IntrinsicBase<T, Order> Base;
-    static T add(typename Base::ValueType& ptr, T val) {
-      return ptr.fetch_add(val, Base::OrderedOp::AtomicRMWOrder);
-    }
-    static T sub(typename Base::ValueType& ptr, T val) {
-      return ptr.fetch_sub(val, Base::OrderedOp::AtomicRMWOrder);
-    }
+  typedef IntrinsicBase<T, Order> Base;
+
+  static T add(typename Base::ValueType& aPtr, T aVal)
+  {
+    return aPtr.fetch_add(aVal, Base::OrderedOp::AtomicRMWOrder);
+  }
+
+  static T sub(typename Base::ValueType& aPtr, T aVal)
+  {
+    return aPtr.fetch_sub(aVal, Base::OrderedOp::AtomicRMWOrder);
+  }
 };
 
 template<typename T, MemoryOrdering Order>
 struct IntrinsicAddSub<T*, Order> : public IntrinsicBase<T*, Order>
 {
-    typedef IntrinsicBase<T*, Order> Base;
-    static T* add(typename Base::ValueType& ptr, ptrdiff_t val) {
-      return ptr.fetch_add(fixupAddend(val), Base::OrderedOp::AtomicRMWOrder);
-    }
-    static T* sub(typename Base::ValueType& ptr, ptrdiff_t val) {
-      return ptr.fetch_sub(fixupAddend(val), Base::OrderedOp::AtomicRMWOrder);
-    }
-  private:
-    /*
-     * GCC 4.6's <atomic> header has a bug where adding X to an
-     * atomic<T*> is not the same as adding X to a T*.  Hence the need
-     * for this function to provide the correct addend.
-     */
-    static ptrdiff_t fixupAddend(ptrdiff_t val) {
+  typedef IntrinsicBase<T*, Order> Base;
+
+  static T* add(typename Base::ValueType& aPtr, ptrdiff_t aVal)
+  {
+    return aPtr.fetch_add(fixupAddend(aVal), Base::OrderedOp::AtomicRMWOrder);
+  }
+
+  static T* sub(typename Base::ValueType& aPtr, ptrdiff_t aVal)
+  {
+    return aPtr.fetch_sub(fixupAddend(aVal), Base::OrderedOp::AtomicRMWOrder);
+  }
+private:
+  /*
+   * GCC 4.6's <atomic> header has a bug where adding X to an
+   * atomic<T*> is not the same as adding X to a T*.  Hence the need
+   * for this function to provide the correct addend.
+   */
+  static ptrdiff_t fixupAddend(ptrdiff_t aVal) {
 #if defined(__clang__) || defined(_MSC_VER)
-      return val;
+    return aVal;
 #elif defined(__GNUC__) && MOZ_GCC_VERSION_AT_LEAST(4, 6, 0) && \
-      !MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
-      return val * sizeof(T);
+    !MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
+    return aVal * sizeof(T);
 #else
-      return val;
+    return aVal;
 #endif
-    }
+  }
 };
 
 template<typename T, MemoryOrdering Order>
 struct IntrinsicIncDec : public IntrinsicAddSub<T, Order>
 {
-    typedef IntrinsicBase<T, Order> Base;
-    static T inc(typename Base::ValueType& ptr) {
-      return IntrinsicAddSub<T, Order>::add(ptr, 1);
-    }
-    static T dec(typename Base::ValueType& ptr) {
-      return IntrinsicAddSub<T, Order>::sub(ptr, 1);
-    }
+  typedef IntrinsicBase<T, Order> Base;
+
+  static T inc(typename Base::ValueType& aPtr)
+  {
+    return IntrinsicAddSub<T, Order>::add(aPtr, 1);
+  }
+
+  static T dec(typename Base::ValueType& aPtr)
+  {
+    return IntrinsicAddSub<T, Order>::sub(aPtr, 1);
+  }
 };
 
 template<typename T, MemoryOrdering Order>
 struct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,
                           public IntrinsicIncDec<T, Order>
 {
-    typedef IntrinsicBase<T, Order> Base;
-    static T or_(typename Base::ValueType& ptr, T val) {
-      return ptr.fetch_or(val, Base::OrderedOp::AtomicRMWOrder);
-    }
-    static T xor_(typename Base::ValueType& ptr, T val) {
-      return ptr.fetch_xor(val, Base::OrderedOp::AtomicRMWOrder);
-    }
-    static T and_(typename Base::ValueType& ptr, T val) {
-      return ptr.fetch_and(val, Base::OrderedOp::AtomicRMWOrder);
-    }
+  typedef IntrinsicBase<T, Order> Base;
+
+  static T or_(typename Base::ValueType& aPtr, T aVal)
+  {
+    return aPtr.fetch_or(aVal, Base::OrderedOp::AtomicRMWOrder);
+  }
+
+  static T xor_(typename Base::ValueType& aPtr, T aVal)
+  {
+    return aPtr.fetch_xor(aVal, Base::OrderedOp::AtomicRMWOrder);
+  }
+
+  static T and_(typename Base::ValueType& aPtr, T aVal)
+  {
+    return aPtr.fetch_and(aVal, Base::OrderedOp::AtomicRMWOrder);
+  }
 };
 
 template<typename T, MemoryOrdering Order>
 struct AtomicIntrinsics<T*, Order>
   : public IntrinsicMemoryOps<T*, Order>, public IntrinsicIncDec<T*, Order>
 {
 };
 
@@ -347,121 +376,129 @@ template<MemoryOrdering Order> struct Ba
  * __sync_sychronize as our specializations of Barrier produce.  If
  * performance turns out to be an issue, defining these specializations
  * on a per-processor basis would be a good first tuning step.
  */
 
 template<>
 struct Barrier<Relaxed>
 {
-    static void beforeLoad() {}
-    static void afterLoad() {}
-    static void beforeStore() {}
-    static void afterStore() {}
+  static void beforeLoad() {}
+  static void afterLoad() {}
+  static void beforeStore() {}
+  static void afterStore() {}
 };
 
 template<>
 struct Barrier<ReleaseAcquire>
 {
-    static void beforeLoad() {}
-    static void afterLoad() { __sync_synchronize(); }
-    static void beforeStore() { __sync_synchronize(); }
-    static void afterStore() {}
+  static void beforeLoad() {}
+  static void afterLoad() { __sync_synchronize(); }
+  static void beforeStore() { __sync_synchronize(); }
+  static void afterStore() {}
 };
 
 template<>
 struct Barrier<SequentiallyConsistent>
 {
-    static void beforeLoad() { __sync_synchronize(); }
-    static void afterLoad() { __sync_synchronize(); }
-    static void beforeStore() { __sync_synchronize(); }
-    static void afterStore() { __sync_synchronize(); }
+  static void beforeLoad() { __sync_synchronize(); }
+  static void afterLoad() { __sync_synchronize(); }
+  static void beforeStore() { __sync_synchronize(); }
+  static void afterStore() { __sync_synchronize(); }
 };
 
 template<typename T, MemoryOrdering Order>
 struct IntrinsicMemoryOps
 {
-    static T load(const T& ptr) {
-      Barrier<Order>::beforeLoad();
-      T val = ptr;
-      Barrier<Order>::afterLoad();
-      return val;
-    }
-    static void store(T& ptr, T val) {
-      Barrier<Order>::beforeStore();
-      ptr = val;
-      Barrier<Order>::afterStore();
-    }
-    static T exchange(T& ptr, T val) {
-      // __sync_lock_test_and_set is only an acquire barrier; loads and stores
-      // can't be moved up from after to before it, but they can be moved down
-      // from before to after it.  We may want a stricter ordering, so we need
-      // an explicit barrier.
+  static T load(const T& aPtr)
+  {
+    Barrier<Order>::beforeLoad();
+    T val = aPtr;
+    Barrier<Order>::afterLoad();
+    return val;
+  }
+
+  static void store(T& aPtr, T aVal)
+  {
+    Barrier<Order>::beforeStore();
+    aPtr = aVal;
+    Barrier<Order>::afterStore();
+  }
 
-      Barrier<Order>::beforeStore();
-      return __sync_lock_test_and_set(&ptr, val);
-    }
-    static bool compareExchange(T& ptr, T oldVal, T newVal) {
-      return __sync_bool_compare_and_swap(&ptr, oldVal, newVal);
-    }
+  static T exchange(T& aPtr, T aVal)
+  {
+    // __sync_lock_test_and_set is only an acquire barrier; loads and stores
+    // can't be moved up from after to before it, but they can be moved down
+    // from before to after it.  We may want a stricter ordering, so we need
+    // an explicit barrier.
+    Barrier<Order>::beforeStore();
+    return __sync_lock_test_and_set(&aPtr, aVal);
+  }
+
+  static bool compareExchange(T& aPtr, T aOldVal, T aNewVal)
+  {
+    return __sync_bool_compare_and_swap(&aPtr, aOldVal, aNewVal);
+  }
 };
 
 template<typename T>
 struct IntrinsicAddSub
 {
-    typedef T ValueType;
-    static T add(T& ptr, T val) {
-      return __sync_fetch_and_add(&ptr, val);
-    }
-    static T sub(T& ptr, T val) {
-      return __sync_fetch_and_sub(&ptr, val);
-    }
+  typedef T ValueType;
+
+  static T add(T& aPtr, T aVal)
+  {
+    return __sync_fetch_and_add(&aPtr, aVal);
+  }
+
+  static T sub(T& aPtr, T aVal)
+  {
+    return __sync_fetch_and_sub(&aPtr, aVal);
+  }
 };
 
 template<typename T>
 struct IntrinsicAddSub<T*>
 {
-    typedef T* ValueType;
-    /*
-     * The reinterpret_casts are needed so that
-     * __sync_fetch_and_{add,sub} will properly type-check.
-     *
-     * Also, these functions do not provide standard semantics for
-     * pointer types, so we need to adjust the addend.
-     */
-    static ValueType add(ValueType& ptr, ptrdiff_t val) {
-      ValueType amount = reinterpret_cast<ValueType>(val * sizeof(T));
-      return __sync_fetch_and_add(&ptr, amount);
-    }
-    static ValueType sub(ValueType& ptr, ptrdiff_t val) {
-      ValueType amount = reinterpret_cast<ValueType>(val * sizeof(T));
-      return __sync_fetch_and_sub(&ptr, amount);
-    }
+  typedef T* ValueType;
+
+  /*
+   * The reinterpret_casts are needed so that
+   * __sync_fetch_and_{add,sub} will properly type-check.
+   *
+   * Also, these functions do not provide standard semantics for
+   * pointer types, so we need to adjust the addend.
+   */
+  static ValueType add(ValueType& aPtr, ptrdiff_t aVal)
+  {
+    ValueType amount = reinterpret_cast<ValueType>(aVal * sizeof(T));
+    return __sync_fetch_and_add(&aPtr, amount);
+  }
+
+  static ValueType sub(ValueType& aPtr, ptrdiff_t aVal)
+  {
+    ValueType amount = reinterpret_cast<ValueType>(aVal * sizeof(T));
+    return __sync_fetch_and_sub(&aPtr, amount);
+  }
 };
 
 template<typename T>
 struct IntrinsicIncDec : public IntrinsicAddSub<T>
 {
-    static T inc(T& ptr) { return IntrinsicAddSub<T>::add(ptr, 1); }
-    static T dec(T& ptr) { return IntrinsicAddSub<T>::sub(ptr, 1); }
+  static T inc(T& aPtr) { return IntrinsicAddSub<T>::add(aPtr, 1); }
+  static T dec(T& aPtr) { return IntrinsicAddSub<T>::sub(aPtr, 1); }
 };
 
 template<typename T, MemoryOrdering Order>
 struct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,
                           public IntrinsicIncDec<T>
 {
-    static T or_(T& ptr, T val) {
-      return __sync_fetch_and_or(&ptr, val);
-    }
-    static T xor_(T& ptr, T val) {
-      return __sync_fetch_and_xor(&ptr, val);
-    }
-    static T and_(T& ptr, T val) {
-      return __sync_fetch_and_and(&ptr, val);
-    }
+  static T or_( T& aPtr, T aVal) { return __sync_fetch_and_or(&aPtr, aVal); }
+  static T xor_(T& aPtr, T aVal) { return __sync_fetch_and_xor(&aPtr, aVal); }
+  static T and_(T& aPtr, T aVal) { return __sync_fetch_and_and(&aPtr, aVal); }
 };
 
 template<typename T, MemoryOrdering Order>
 struct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,
                                      public IntrinsicIncDec<T*>
 {
 };
 
@@ -478,22 +515,22 @@ struct AtomicIntrinsics<T*, Order> : pub
  * on 32-bit datatypes for 32-bit Windows versions; for 64-bit Windows
  * versions, we support 64-bit datatypes as well.
  *
  * To avoid namespace pollution issues, we declare whatever functions we
  * need ourselves.
  */
 
 extern "C" {
-long __cdecl _InterlockedExchangeAdd(long volatile* dst, long value);
-long __cdecl _InterlockedOr(long volatile* dst, long value);
-long __cdecl _InterlockedXor(long volatile* dst, long value);
-long __cdecl _InterlockedAnd(long volatile* dst, long value);
-long __cdecl _InterlockedExchange(long volatile *dst, long value);
-long __cdecl _InterlockedCompareExchange(long volatile *dst, long newVal, long oldVal);
+long __cdecl _InterlockedExchangeAdd(long volatile* aDst, long aVal);
+long __cdecl _InterlockedOr(long volatile* aDst, long aVal);
+long __cdecl _InterlockedXor(long volatile* aDst, long aVal);
+long __cdecl _InterlockedAnd(long volatile* aDst, long aVal);
+long __cdecl _InterlockedExchange(long volatile *aDst, long aVal);
+long __cdecl _InterlockedCompareExchange(long volatile *aDst, long aNewVal, long aOldVal);
 }
 
 #  pragma intrinsic(_InterlockedExchangeAdd)
 #  pragma intrinsic(_InterlockedOr)
 #  pragma intrinsic(_InterlockedXor)
 #  pragma intrinsic(_InterlockedAnd)
 #  pragma intrinsic(_InterlockedExchange)
 #  pragma intrinsic(_InterlockedCompareExchange)
@@ -509,144 +546,174 @@ namespace detail {
       */
 #    error "Unknown CPU type"
 #  endif
 
 /*
  * The PrimitiveIntrinsics template should define |Type|, the datatype of size
  * DataSize upon which we operate, and the following eight functions.
  *
- * static Type add(Type* ptr, Type val);
- * static Type sub(Type* ptr, Type val);
- * static Type or_(Type* ptr, Type val);
- * static Type xor_(Type* ptr, Type val);
- * static Type and_(Type* ptr, Type val);
+ * static Type add(Type* aPtr, Type aVal);
+ * static Type sub(Type* aPtr, Type aVal);
+ * static Type or_(Type* aPtr, Type aVal);
+ * static Type xor_(Type* aPtr, Type aVal);
+ * static Type and_(Type* aPtr, Type aVal);
  *
  *   These functions perform the obvious operation on the value contained in
- *   |*ptr| combined with |val| and return the value previously stored in
- *   |*ptr|.
+ *   |*aPtr| combined with |aVal| and return the value previously stored in
+ *   |*aPtr|.
  *
- * static void store(Type* ptr, Type val);
+ * static void store(Type* aPtr, Type aVal);
  *
- *   This function atomically stores |val| into |*ptr| and must provide a full
+ *   This function atomically stores |aVal| into |*aPtr| and must provide a full
  *   memory fence after the store to prevent compiler and hardware instruction
  *   reordering.  It should also act as a compiler barrier to prevent reads and
  *   writes from moving to after the store.
  *
- * static Type exchange(Type* ptr, Type val);
+ * static Type exchange(Type* aPtr, Type aVal);
  *
- *   This function atomically stores |val| into |*ptr| and returns the previous
- *   contents of *ptr;
+ *   This function atomically stores |aVal| into |*aPtr| and returns the
+ *   previous contents of |*aPtr|;
  *
- * static bool compareExchange(Type* ptr, Type oldVal, Type newVal);
+ * static bool compareExchange(Type* aPtr, Type aOldVal, Type aNewVal);
  *
  *   This function atomically performs the following operation:
  *
- *     if (*ptr == oldVal) {
- *       *ptr = newVal;
+ *     if (*aPtr == aOldVal) {
+ *       *aPtr = aNewVal;
  *       return true;
  *     } else {
  *       return false;
  *     }
  *
  */
 template<size_t DataSize> struct PrimitiveIntrinsics;
 
 template<>
 struct PrimitiveIntrinsics<4>
 {
-    typedef long Type;
+  typedef long Type;
+
+  static Type add(Type* aPtr, Type aVal)
+  {
+    return _InterlockedExchangeAdd(aPtr, aVal);
+  }
+
+  static Type sub(Type* aPtr, Type aVal)
+  {
+    /*
+     * _InterlockedExchangeSubtract isn't available before Windows 7,
+     * and we must support Windows XP.
+     */
+    return _InterlockedExchangeAdd(aPtr, -aVal);
+  }
+
+  static Type or_(Type* aPtr, Type aVal)
+  {
+    return _InterlockedOr(aPtr, aVal);
+  }
 
-    static Type add(Type* ptr, Type val) {
-      return _InterlockedExchangeAdd(ptr, val);
-    }
-    static Type sub(Type* ptr, Type val) {
-      /*
-       * _InterlockedExchangeSubtract isn't available before Windows 7,
-       * and we must support Windows XP.
-       */
-      return _InterlockedExchangeAdd(ptr, -val);
-    }
-    static Type or_(Type* ptr, Type val) {
-      return _InterlockedOr(ptr, val);
-    }
-    static Type xor_(Type* ptr, Type val) {
-      return _InterlockedXor(ptr, val);
-    }
-    static Type and_(Type* ptr, Type val) {
-      return _InterlockedAnd(ptr, val);
-    }
-    static void store(Type* ptr, Type val) {
-      _InterlockedExchange(ptr, val);
-    }
-    static Type exchange(Type* ptr, Type val) {
-      return _InterlockedExchange(ptr, val);
-    }
-    static bool compareExchange(Type* ptr, Type oldVal, Type newVal) {
-      return _InterlockedCompareExchange(ptr, newVal, oldVal) == oldVal;
-    }
+  static Type xor_(Type* aPtr, Type aVal)
+  {
+    return _InterlockedXor(aPtr, aVal);
+  }
+
+  static Type and_(Type* aPtr, Type aVal)
+  {
+    return _InterlockedAnd(aPtr, aVal);
+  }
+
+  static void store(Type* aPtr, Type aVal)
+  {
+    _InterlockedExchange(aPtr, aVal);
+  }
+
+  static Type exchange(Type* aPtr, Type aVal)
+  {
+    return _InterlockedExchange(aPtr, aVal);
+  }
+
+  static bool compareExchange(Type* aPtr, Type aOldVal, Type aNewVal)
+  {
+    return _InterlockedCompareExchange(aPtr, aNewVal, aOldVal) == aOldVal;
+  }
 };
 
 #  if defined(_M_X64)
 
 extern "C" {
-long long __cdecl _InterlockedExchangeAdd64(long long volatile* dst,
-                                            long long value);
-long long __cdecl _InterlockedOr64(long long volatile* dst,
-                                   long long value);
-long long __cdecl _InterlockedXor64(long long volatile* dst,
-                                    long long value);
-long long __cdecl _InterlockedAnd64(long long volatile* dst,
-                                    long long value);
-long long __cdecl _InterlockedExchange64(long long volatile* dst,
-                                         long long value);
-long long __cdecl _InterlockedCompareExchange64(long long volatile* dst,
-                                                long long newVal,
-                                                long long oldVal);
+long long __cdecl _InterlockedExchangeAdd64(long long volatile* aDst,
+                                            long long aVal);
+long long __cdecl _InterlockedOr64(long long volatile* aDst,
+                                   long long aVal);
+long long __cdecl _InterlockedXor64(long long volatile* aDst,
+                                    long long aVal);
+long long __cdecl _InterlockedAnd64(long long volatile* aDst,
+                                    long long aVal);
+long long __cdecl _InterlockedExchange64(long long volatile* aDst,
+                                         long long aVal);
+long long __cdecl _InterlockedCompareExchange64(long long volatile* aDst,
+                                                long long aNewVal,
+                                                long long aOldVal);
 }
 
 #    pragma intrinsic(_InterlockedExchangeAdd64)
 #    pragma intrinsic(_InterlockedOr64)
 #    pragma intrinsic(_InterlockedXor64)
 #    pragma intrinsic(_InterlockedAnd64)
 #    pragma intrinsic(_InterlockedExchange64)
 #    pragma intrinsic(_InterlockedCompareExchange64)
 
 template <>
 struct PrimitiveIntrinsics<8>
 {
-    typedef __int64 Type;
+  typedef __int64 Type;
+
+  static Type add(Type* aPtr, Type aVal)
+  {
+    return _InterlockedExchangeAdd64(aPtr, aVal);
+  }
+
+  static Type sub(Type* aPtr, Type aVal)
+  {
+    /*
+     * There is no _InterlockedExchangeSubtract64.
+     */
+    return _InterlockedExchangeAdd64(aPtr, -aVal);
+  }
+
+  static Type or_(Type* aPtr, Type aVal)
+  {
+    return _InterlockedOr64(aPtr, aVal);
+  }
 
-    static Type add(Type* ptr, Type val) {
-      return _InterlockedExchangeAdd64(ptr, val);
-    }
-    static Type sub(Type* ptr, Type val) {
-      /*
-       * There is no _InterlockedExchangeSubtract64.
-       */
-      return _InterlockedExchangeAdd64(ptr, -val);
-    }
-    static Type or_(Type* ptr, Type val) {
-      return _InterlockedOr64(ptr, val);
-    }
-    static Type xor_(Type* ptr, Type val) {
-      return _InterlockedXor64(ptr, val);
-    }
-    static Type and_(Type* ptr, Type val) {
-      return _InterlockedAnd64(ptr, val);
-    }
-    static void store(Type* ptr, Type val) {
-      _InterlockedExchange64(ptr, val);
-    }
-    static Type exchange(Type* ptr, Type val) {
-      return _InterlockedExchange64(ptr, val);
-    }
-    static bool compareExchange(Type* ptr, Type oldVal, Type newVal) {
-      return _InterlockedCompareExchange64(ptr, newVal, oldVal) == oldVal;
-    }
+  static Type xor_(Type* aPtr, Type aVal)
+  {
+    return _InterlockedXor64(aPtr, aVal);
+  }
+
+  static Type and_(Type* aPtr, Type aVal)
+  {
+    return _InterlockedAnd64(aPtr, aVal);
+  }
+
+  static void store(Type* aPtr, Type aVal)
+  {
+    _InterlockedExchange64(aPtr, aVal);
+  }
+
+  static Type exchange(Type* aPtr, Type aVal)
+  {
+    return _InterlockedExchange64(aPtr, aVal);
+  }
+
+  static bool compareExchange(Type* aPtr, Type aOldVal, Type aNewVal)
+  {
+    return _InterlockedCompareExchange64(aPtr, aNewVal, aOldVal) == aOldVal;
+  }
 };
 
 #  endif
 
 extern "C" { void _ReadWriteBarrier(); }
 
 #  pragma intrinsic(_ReadWriteBarrier)
 
@@ -656,265 +723,293 @@ template<MemoryOrdering Order> struct Ba
  * We do not provide an afterStore method in Barrier, as Relaxed and
  * ReleaseAcquire orderings do not require one, and the required barrier
  * for SequentiallyConsistent is handled by PrimitiveIntrinsics.
  */
 
 template<>
 struct Barrier<Relaxed>
 {
-    static void beforeLoad() {}
-    static void afterLoad() {}
-    static void beforeStore() {}
+  static void beforeLoad() {}
+  static void afterLoad() {}
+  static void beforeStore() {}
 };
 
 template<>
 struct Barrier<ReleaseAcquire>
 {
-    static void beforeLoad() {}
-    static void afterLoad() { _ReadWriteBarrier(); }
-    static void beforeStore() { _ReadWriteBarrier(); }
+  static void beforeLoad() {}
+  static void afterLoad() { _ReadWriteBarrier(); }
+  static void beforeStore() { _ReadWriteBarrier(); }
 };
 
 template<>
 struct Barrier<SequentiallyConsistent>
 {
-    static void beforeLoad() { _ReadWriteBarrier(); }
-    static void afterLoad() { _ReadWriteBarrier(); }
-    static void beforeStore() { _ReadWriteBarrier(); }
+  static void beforeLoad() { _ReadWriteBarrier(); }
+  static void afterLoad() { _ReadWriteBarrier(); }
+  static void beforeStore() { _ReadWriteBarrier(); }
 };
 
 template<typename PrimType, typename T>
 struct CastHelper
 {
-  static PrimType toPrimType(T val) { return static_cast<PrimType>(val); }
-  static T fromPrimType(PrimType val) { return static_cast<T>(val); }
+  static PrimType toPrimType(T aVal) { return static_cast<PrimType>(aVal); }
+  static T fromPrimType(PrimType aVal) { return static_cast<T>(aVal); }
 };
 
 template<typename PrimType, typename T>
 struct CastHelper<PrimType, T*>
 {
-  static PrimType toPrimType(T* val) { return reinterpret_cast<PrimType>(val); }
-  static T* fromPrimType(PrimType val) { return reinterpret_cast<T*>(val); }
+  static PrimType toPrimType(T* aVal) { return reinterpret_cast<PrimType>(aVal); }
+  static T* fromPrimType(PrimType aVal) { return reinterpret_cast<T*>(aVal); }
 };
 
 template<typename T>
 struct IntrinsicBase
 {
-    typedef T ValueType;
-    typedef PrimitiveIntrinsics<sizeof(T)> Primitives;
-    typedef typename Primitives::Type PrimType;
-    static_assert(sizeof(PrimType) == sizeof(T),
-                  "Selection of PrimitiveIntrinsics was wrong");
-    typedef CastHelper<PrimType, T> Cast;
+  typedef T ValueType;
+  typedef PrimitiveIntrinsics<sizeof(T)> Primitives;
+  typedef typename Primitives::Type PrimType;
+  static_assert(sizeof(PrimType) == sizeof(T),
+                "Selection of PrimitiveIntrinsics was wrong");
+  typedef CastHelper<PrimType, T> Cast;
 };
 
 template<typename T, MemoryOrdering Order>
 struct IntrinsicMemoryOps : public IntrinsicBase<T>
 {
-    typedef typename IntrinsicBase<T>::ValueType ValueType;
-    typedef typename IntrinsicBase<T>::Primitives Primitives;
-    typedef typename IntrinsicBase<T>::PrimType PrimType;
-    typedef typename IntrinsicBase<T>::Cast Cast;
-    static ValueType load(const ValueType& ptr) {
-      Barrier<Order>::beforeLoad();
-      ValueType val = ptr;
-      Barrier<Order>::afterLoad();
-      return val;
+  typedef typename IntrinsicBase<T>::ValueType ValueType;
+  typedef typename IntrinsicBase<T>::Primitives Primitives;
+  typedef typename IntrinsicBase<T>::PrimType PrimType;
+  typedef typename IntrinsicBase<T>::Cast Cast;
+
+  static ValueType load(const ValueType& aPtr)
+  {
+    Barrier<Order>::beforeLoad();
+    ValueType val = aPtr;
+    Barrier<Order>::afterLoad();
+    return val;
+  }
+
+  static void store(ValueType& aPtr, ValueType aVal)
+  {
+    // For SequentiallyConsistent, Primitives::store() will generate the
+    // proper memory fence.  Everything else just needs a barrier before
+    // the store.
+    if (Order == SequentiallyConsistent) {
+      Primitives::store(reinterpret_cast<PrimType*>(&aPtr),
+                        Cast::toPrimType(aVal));
+    } else {
+      Barrier<Order>::beforeStore();
+      aPtr = aVal;
     }
-    static void store(ValueType& ptr, ValueType val) {
-      // For SequentiallyConsistent, Primitives::store() will generate the
-      // proper memory fence.  Everything else just needs a barrier before
-      // the store.
-      if (Order == SequentiallyConsistent) {
-        Primitives::store(reinterpret_cast<PrimType*>(&ptr),
-                          Cast::toPrimType(val));
-      } else {
-        Barrier<Order>::beforeStore();
-        ptr = val;
-      }
-    }
-    static ValueType exchange(ValueType& ptr, ValueType val) {
-      PrimType oldval =
-        Primitives::exchange(reinterpret_cast<PrimType*>(&ptr),
-                             Cast::toPrimType(val));
-      return Cast::fromPrimType(oldval);
-    }
-    static bool compareExchange(ValueType& ptr, ValueType oldVal, ValueType newVal) {
-      return Primitives::compareExchange(reinterpret_cast<PrimType*>(&ptr),
-                                         Cast::toPrimType(oldVal),
-                                         Cast::toPrimType(newVal));
-    }
+  }
+
+  static ValueType exchange(ValueType& aPtr, ValueType aVal)
+  {
+    PrimType oldval =
+      Primitives::exchange(reinterpret_cast<PrimType*>(&aPtr),
+                           Cast::toPrimType(aVal));
+    return Cast::fromPrimType(oldval);
+  }
+
+  static bool compareExchange(ValueType& aPtr, ValueType aOldVal,
+                              ValueType aNewVal)
+  {
+    return Primitives::compareExchange(reinterpret_cast<PrimType*>(&aPtr),
+                                       Cast::toPrimType(aOldVal),
+                                       Cast::toPrimType(aNewVal));
+  }
 };
 
 template<typename T>
 struct IntrinsicApplyHelper : public IntrinsicBase<T>
 {
-    typedef typename IntrinsicBase<T>::ValueType ValueType;
-    typedef typename IntrinsicBase<T>::PrimType PrimType;
-    typedef typename IntrinsicBase<T>::Cast Cast;
-    typedef PrimType (*BinaryOp)(PrimType*, PrimType);
-    typedef PrimType (*UnaryOp)(PrimType*);
+  typedef typename IntrinsicBase<T>::ValueType ValueType;
+  typedef typename IntrinsicBase<T>::PrimType PrimType;
+  typedef typename IntrinsicBase<T>::Cast Cast;
+  typedef PrimType (*BinaryOp)(PrimType*, PrimType);
+  typedef PrimType (*UnaryOp)(PrimType*);
 
-    static ValueType applyBinaryFunction(BinaryOp op, ValueType& ptr,
-                                         ValueType val) {
-      PrimType* primTypePtr = reinterpret_cast<PrimType*>(&ptr);
-      PrimType primTypeVal = Cast::toPrimType(val);
-      return Cast::fromPrimType(op(primTypePtr, primTypeVal));
-    }
+  static ValueType applyBinaryFunction(BinaryOp aOp, ValueType& aPtr,
+                                       ValueType aVal)
+  {
+    PrimType* primTypePtr = reinterpret_cast<PrimType*>(&aPtr);
+    PrimType primTypeVal = Cast::toPrimType(aVal);
+    return Cast::fromPrimType(aOp(primTypePtr, primTypeVal));
+  }
 
-    static ValueType applyUnaryFunction(UnaryOp op, ValueType& ptr) {
-      PrimType* primTypePtr = reinterpret_cast<PrimType*>(&ptr);
-      return Cast::fromPrimType(op(primTypePtr));
-    }
+  static ValueType applyUnaryFunction(UnaryOp aOp, ValueType& aPtr)
+  {
+    PrimType* primTypePtr = reinterpret_cast<PrimType*>(&aPtr);
+    return Cast::fromPrimType(aOp(primTypePtr));
+  }
 };
 
 template<typename T>
 struct IntrinsicAddSub : public IntrinsicApplyHelper<T>
 {
-    typedef typename IntrinsicApplyHelper<T>::ValueType ValueType;
-    typedef typename IntrinsicBase<T>::Primitives Primitives;
-    static ValueType add(ValueType& ptr, ValueType val) {
-      return applyBinaryFunction(&Primitives::add, ptr, val);
-    }
-    static ValueType sub(ValueType& ptr, ValueType val) {
-      return applyBinaryFunction(&Primitives::sub, ptr, val);
-    }
+  typedef typename IntrinsicApplyHelper<T>::ValueType ValueType;
+  typedef typename IntrinsicBase<T>::Primitives Primitives;
+
+  static ValueType add(ValueType& aPtr, ValueType aVal)
+  {
+    return applyBinaryFunction(&Primitives::add, aPtr, aVal);
+  }
+
+  static ValueType sub(ValueType& aPtr, ValueType aVal)
+  {
+    return applyBinaryFunction(&Primitives::sub, aPtr, aVal);
+  }
 };
 
 template<typename T>
 struct IntrinsicAddSub<T*> : public IntrinsicApplyHelper<T*>
 {
-    typedef typename IntrinsicApplyHelper<T*>::ValueType ValueType;
-    static ValueType add(ValueType& ptr, ptrdiff_t amount) {
-      return applyBinaryFunction(&Primitives::add, ptr,
-                                 (ValueType)(amount * sizeof(ValueType)));
-    }
-    static ValueType sub(ValueType& ptr, ptrdiff_t amount) {
-      return applyBinaryFunction(&Primitives::sub, ptr,
-                                 (ValueType)(amount * sizeof(ValueType)));
-    }
+  typedef typename IntrinsicApplyHelper<T*>::ValueType ValueType;
+
+  static ValueType add(ValueType& aPtr, ptrdiff_t aAmount)
+  {
+    return applyBinaryFunction(&Primitives::add, aPtr,
+                               (ValueType)(aAmount * sizeof(ValueType)));
+  }
+
+  static ValueType sub(ValueType& aPtr, ptrdiff_t aAmount)
+  {
+    return applyBinaryFunction(&Primitives::sub, aPtr,
+                               (ValueType)(aAmount * sizeof(ValueType)));
+  }
 };
 
 template<typename T>
 struct IntrinsicIncDec : public IntrinsicAddSub<T>
 {
-    typedef typename IntrinsicAddSub<T>::ValueType ValueType;
-    static ValueType inc(ValueType& ptr) { return add(ptr, 1); }
-    static ValueType dec(ValueType& ptr) { return sub(ptr, 1); }
+  typedef typename IntrinsicAddSub<T>::ValueType ValueType;
+  static ValueType inc(ValueType& aPtr) { return add(aPtr, 1); }
+  static ValueType dec(ValueType& aPtr) { return sub(aPtr, 1); }
 };
 
 template<typename T, MemoryOrdering Order>
 struct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,
                           public IntrinsicIncDec<T>
 {
-    typedef typename IntrinsicIncDec<T>::ValueType ValueType;
-    static ValueType or_(ValueType& ptr, T val) {
-      return applyBinaryFunction(&Primitives::or_, ptr, val);
-    }
-    static ValueType xor_(ValueType& ptr, T val) {
-      return applyBinaryFunction(&Primitives::xor_, ptr, val);
-    }
-    static ValueType and_(ValueType& ptr, T val) {
-      return applyBinaryFunction(&Primitives::and_, ptr, val);
-    }
+  typedef typename IntrinsicIncDec<T>::ValueType ValueType;
+
+  static ValueType or_(ValueType& aPtr, T aVal)
+  {
+    return applyBinaryFunction(&Primitives::or_, aPtr, aVal);
+  }
+
+  static ValueType xor_(ValueType& aPtr, T aVal)
+  {
+    return applyBinaryFunction(&Primitives::xor_, aPtr, aVal);
+  }
+
+  static ValueType and_(ValueType& aPtr, T aVal)
+  {
+    return applyBinaryFunction(&Primitives::and_, aPtr, aVal);
+  }
 };
 
 template<typename T, MemoryOrdering Order>
 struct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,
                                      public IntrinsicIncDec<T*>
 {
-    typedef typename IntrinsicMemoryOps<T*, Order>::ValueType ValueType;
+  typedef typename IntrinsicMemoryOps<T*, Order>::ValueType ValueType;
 };
 
 } // namespace detail
 } // namespace mozilla
 
 #else
 # error "Atomic compiler intrinsics are not supported on your platform"
 #endif
 
 namespace mozilla {
 
 namespace detail {
 
 template<typename T, MemoryOrdering Order>
 class AtomicBase
 {
-    // We only support 32-bit types on 32-bit Windows, which constrains our
-    // implementation elsewhere.  But we support pointer-sized types everywhere.
-    static_assert(sizeof(T) == 4 || (sizeof(uintptr_t) == 8 && sizeof(T) == 8),
-                  "mozilla/Atomics.h only supports 32-bit and pointer-sized types");
+  // We only support 32-bit types on 32-bit Windows, which constrains our
+  // implementation elsewhere.  But we support pointer-sized types everywhere.
+  static_assert(sizeof(T) == 4 || (sizeof(uintptr_t) == 8 && sizeof(T) == 8),
+                "mozilla/Atomics.h only supports 32-bit and pointer-sized types");
 
-  protected:
-    typedef typename detail::AtomicIntrinsics<T, Order> Intrinsics;
-    typename Intrinsics::ValueType mValue;
+protected:
+  typedef typename detail::AtomicIntrinsics<T, Order> Intrinsics;
+  typename Intrinsics::ValueType mValue;
 
-  public:
-    MOZ_CONSTEXPR AtomicBase() : mValue() {}
-    MOZ_CONSTEXPR AtomicBase(T aInit) : mValue(aInit) {}
+public:
+  MOZ_CONSTEXPR AtomicBase() : mValue() {}
+  MOZ_CONSTEXPR AtomicBase(T aInit) : mValue(aInit) {}
 
-    // Note: we can't provide operator T() here because Atomic<bool> inherits
-    // from AtomcBase with T=uint32_t and not T=bool. If we implemented
-    // operator T() here, it would cause errors when comparing Atomic<bool> with
-    // a regular bool.
+  // Note: we can't provide operator T() here because Atomic<bool> inherits
+  // from AtomcBase with T=uint32_t and not T=bool. If we implemented
+  // operator T() here, it would cause errors when comparing Atomic<bool> with
+  // a regular bool.
 
-    T operator=(T aValue) {
-      Intrinsics::store(mValue, aValue);
-      return aValue;
-    }
+  T operator=(T aVal)
+  {
+    Intrinsics::store(mValue, aVal);
+    return aVal;
+  }
 
-    /**
-     * Performs an atomic swap operation.  aValue is stored and the previous
-     * value of this variable is returned.
-     */
-    T exchange(T aValue) {
-      return Intrinsics::exchange(mValue, aValue);
-    }
+  /**
+   * Performs an atomic swap operation.  aVal is stored and the previous
+   * value of this variable is returned.
+   */
+  T exchange(T aVal)
+  {
+    return Intrinsics::exchange(mValue, aVal);
+  }
 
-    /**
-     * Performs an atomic compare-and-swap operation and returns true if it
-     * succeeded. This is equivalent to atomically doing
-     *
-     *   if (mValue == aOldValue) {
-     *     mValue = aNewValue;
-     *     return true;
-     *   } else {
-     *     return false;
-     *   }
-     */
-    bool compareExchange(T aOldValue, T aNewValue) {
-      return Intrinsics::compareExchange(mValue, aOldValue, aNewValue);
-    }
+  /**
+   * Performs an atomic compare-and-swap operation and returns true if it
+   * succeeded. This is equivalent to atomically doing
+   *
+   *   if (mValue == aOldValue) {
+   *     mValue = aNewValue;
+   *     return true;
+   *   } else {
+   *     return false;
+   *   }
+   */
+  bool compareExchange(T aOldValue, T aNewValue)
+  {
+    return Intrinsics::compareExchange(mValue, aOldValue, aNewValue);
+  }
 
-  private:
-    template<MemoryOrdering AnyOrder>
-    AtomicBase(const AtomicBase<T, AnyOrder>& aCopy) MOZ_DELETE;
+private:
+  template<MemoryOrdering AnyOrder>
+  AtomicBase(const AtomicBase<T, AnyOrder>& aCopy) MOZ_DELETE;
 };
 
 template<typename T, MemoryOrdering Order>
 class AtomicBaseIncDec : public AtomicBase<T, Order>
 {
-    typedef typename detail::AtomicBase<T, Order> Base;
+  typedef typename detail::AtomicBase<T, Order> Base;
 
-  public:
-    MOZ_CONSTEXPR AtomicBaseIncDec() : Base() {}
-    MOZ_CONSTEXPR AtomicBaseIncDec(T aInit) : Base(aInit) {}
+public:
+  MOZ_CONSTEXPR AtomicBaseIncDec() : Base() {}
+  MOZ_CONSTEXPR AtomicBaseIncDec(T aInit) : Base(aInit) {}
 
-    using Base::operator=;
+  using Base::operator=;
 
-    operator T() const { return Base::Intrinsics::load(Base::mValue); }
-    T operator++(int) { return Base::Intrinsics::inc(Base::mValue); }
-    T operator--(int) { return Base::Intrinsics::dec(Base::mValue); }
-    T operator++() { return Base::Intrinsics::inc(Base::mValue) + 1; }
-    T operator--() { return Base::Intrinsics::dec(Base::mValue) - 1; }
+  operator T() const { return Base::Intrinsics::load(Base::mValue); }
+  T operator++(int) { return Base::Intrinsics::inc(Base::mValue); }
+  T operator--(int) { return Base::Intrinsics::dec(Base::mValue); }
+  T operator++() { return Base::Intrinsics::inc(Base::mValue) + 1; }
+  T operator--() { return Base::Intrinsics::dec(Base::mValue) - 1; }
 
-  private:
-    template<MemoryOrdering AnyOrder>
-    AtomicBaseIncDec(const AtomicBaseIncDec<T, AnyOrder>& aCopy) MOZ_DELETE;
+private:
+  template<MemoryOrdering AnyOrder>
+  AtomicBaseIncDec(const AtomicBaseIncDec<T, AnyOrder>& aCopy) MOZ_DELETE;
 };
 
 } // namespace detail
 
 /**
  * A wrapper for a type that enforces that all memory accesses are atomic.
  *
  * In general, where a variable |T foo| exists, |Atomic<T> foo| can be used in
@@ -940,88 +1035,111 @@ class Atomic;
  * Atomic<T> implementation for integral types.
  *
  * In addition to atomic store and load operations, compound assignment and
  * increment/decrement operators are implemented which perform the
  * corresponding read-modify-write operation atomically.  Finally, an atomic
  * swap method is provided.
  */
 template<typename T, MemoryOrdering Order>
-class Atomic<T, Order, typename EnableIf<IsIntegral<T>::value && !IsSame<T, bool>::value>::Type>
+class Atomic<T, Order, typename EnableIf<IsIntegral<T>::value &&
+                       !IsSame<T, bool>::value>::Type>
   : public detail::AtomicBaseIncDec<T, Order>
 {
-    typedef typename detail::AtomicBaseIncDec<T, Order> Base;
+  typedef typename detail::AtomicBaseIncDec<T, Order> Base;
+
+public:
+  MOZ_CONSTEXPR Atomic() : Base() {}
+  MOZ_CONSTEXPR Atomic(T aInit) : Base(aInit) {}
+
+  using Base::operator=;
 
-  public:
-    MOZ_CONSTEXPR Atomic() : Base() {}
-    MOZ_CONSTEXPR Atomic(T aInit) : Base(aInit) {}
+  T operator+=(T aDelta)
+  {
+    return Base::Intrinsics::add(Base::mValue, aDelta) + aDelta;
+  }
 
-    using Base::operator=;
+  T operator-=(T aDelta)
+  {
+    return Base::Intrinsics::sub(Base::mValue, aDelta) - aDelta;
+  }
 
-    T operator+=(T delta) { return Base::Intrinsics::add(Base::mValue, delta) + delta; }
-    T operator-=(T delta) { return Base::Intrinsics::sub(Base::mValue, delta) - delta; }
-    T operator|=(T val) { return Base::Intrinsics::or_(Base::mValue, val) | val; }
-    T operator^=(T val) { return Base::Intrinsics::xor_(Base::mValue, val) ^ val; }
-    T operator&=(T val) { return Base::Intrinsics::and_(Base::mValue, val) & val; }
+  T operator|=(T aVal)
+  {
+    return Base::Intrinsics::or_(Base::mValue, aVal) | aVal;
+  }
 
-  private:
-    Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;
+  T operator^=(T aVal)
+  {
+    return Base::Intrinsics::xor_(Base::mValue, aVal) ^ aVal;
+  }
+
+  T operator&=(T aVal)
+  {
+    return Base::Intrinsics::and_(Base::mValue, aVal) & aVal;
+  }
+
+private:
+  Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;
 };
 
 /**
  * Atomic<T> implementation for pointer types.
  *
  * An atomic compare-and-swap primitive for pointer variables is provided, as
  * are atomic increment and decement operators.  Also provided are the compound
  * assignment operators for addition and subtraction. Atomic swap (via
  * exchange()) is included as well.
  */
 template<typename T, MemoryOrdering Order>
 class Atomic<T*, Order> : public detail::AtomicBaseIncDec<T*, Order>
 {
-    typedef typename detail::AtomicBaseIncDec<T*, Order> Base;
+  typedef typename detail::AtomicBaseIncDec<T*, Order> Base;
 
-  public:
-    MOZ_CONSTEXPR Atomic() : Base() {}
-    MOZ_CONSTEXPR Atomic(T* aInit) : Base(aInit) {}
+public:
+  MOZ_CONSTEXPR Atomic() : Base() {}
+  MOZ_CONSTEXPR Atomic(T* aInit) : Base(aInit) {}
 
-    using Base::operator=;
+  using Base::operator=;
 
-    T* operator+=(ptrdiff_t delta) {
-      return Base::Intrinsics::add(Base::mValue, delta) + delta;
-    }
-    T* operator-=(ptrdiff_t delta) {
-      return Base::Intrinsics::sub(Base::mValue, delta) - delta;
-    }
+  T* operator+=(ptrdiff_t aDelta)
+  {
+    return Base::Intrinsics::add(Base::mValue, aDelta) + aDelta;
+  }
 
-  private:
-    Atomic(Atomic<T*, Order>& aOther) MOZ_DELETE;
+  T* operator-=(ptrdiff_t aDelta)
+  {
+    return Base::Intrinsics::sub(Base::mValue, aDelta) - aDelta;
+  }
+
+private:
+  Atomic(Atomic<T*, Order>& aOther) MOZ_DELETE;
 };
 
 /**
  * Atomic<T> implementation for enum types.
  *
  * The atomic store and load operations and the atomic swap method is provided.
  */
 template<typename T, MemoryOrdering Order>
 class Atomic<T, Order, typename EnableIf<IsEnum<T>::value>::Type>
   : public detail::AtomicBase<T, Order>
 {
-    typedef typename detail::AtomicBase<T, Order> Base;
+  typedef typename detail::AtomicBase<T, Order> Base;
 
-  public:
-    MOZ_CONSTEXPR Atomic() : Base() {}
-    MOZ_CONSTEXPR Atomic(T aInit) : Base(aInit) {}
+public:
+  MOZ_CONSTEXPR Atomic() : Base() {}
+  MOZ_CONSTEXPR Atomic(T aInit) : Base(aInit) {}
 
-    operator T() const { return Base::Intrinsics::load(Base::mValue); }
+  operator T() const { return Base::Intrinsics::load(Base::mValue); }
 
-    using Base::operator=;
+  using Base::operator=;
 
-  private:
-    Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;
+private:
+  Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;
 };
 
 /**
  * Atomic<T> implementation for boolean types.
  *
  * The atomic store and load operations and the atomic swap method is provided.
  *
  * Note:
@@ -1034,29 +1152,42 @@ class Atomic<T, Order, typename EnableIf
  *   inlined or not. If they are not inlined, the corresponding functions in the
  *   runtime library are not available on Windows XP. This is why we implement
  *   Atomic<bool> with an underlying type of uint32_t.
  */
 template<MemoryOrdering Order>
 class Atomic<bool, Order>
   : protected detail::AtomicBase<uint32_t, Order>
 {
-    typedef typename detail::AtomicBase<uint32_t, Order> Base;
+  typedef typename detail::AtomicBase<uint32_t, Order> Base;
+
+public:
+  MOZ_CONSTEXPR Atomic() : Base() {}
+  MOZ_CONSTEXPR Atomic(bool aInit) : Base(aInit) {}
 
-  public:
-    MOZ_CONSTEXPR Atomic() : Base() {}
-    MOZ_CONSTEXPR Atomic(bool aInit) : Base(aInit) {}
+  // We provide boolean wrappers for the underlying AtomicBase methods.
+  operator bool() const
+  {
+    return Base::Intrinsics::load(Base::mValue);
+  }
 
-    // We provide boolean wrappers for the underlying AtomicBase methods.
-    operator bool() const { return Base::Intrinsics::load(Base::mValue); }
-    bool operator=(bool aValue) { return Base::operator=(aValue); }
-    bool exchange(bool aValue) { return Base::exchange(aValue); }
-    bool compareExchange(bool aOldValue, bool aNewValue) {
-      return Base::compareExchange(aOldValue, aNewValue);
-    }
+  bool operator=(bool aVal)
+  {
+    return Base::operator=(aVal);
+  }
 
-  private:
-    Atomic(Atomic<bool, Order>& aOther) MOZ_DELETE;
+  bool exchange(bool aVal)
+  {
+    return Base::exchange(aVal);
+  }
+
+  bool compareExchange(bool aOldValue, bool aNewValue)
+  {
+    return Base::compareExchange(aOldValue, aNewValue);
+  }
+
+private:
+  Atomic(Atomic<bool, Order>& aOther) MOZ_DELETE;
 };
 
 } // namespace mozilla
 
 #endif /* mozilla_Atomics_h */
--- a/mfbt/Attributes.h
+++ b/mfbt/Attributes.h
@@ -145,20 +145,20 @@
  * this operator to allow only explicit type conversions, disallowing
  * implicit conversions.
  *
  * Example:
  *
  *   template<typename T>
  *   class Ptr
  *   {
- *      T* ptr;
- *      MOZ_EXPLICIT_CONVERSION operator bool() const {
- *        return ptr != nullptr;
- *      }
+ *     T* ptr;
+ *     MOZ_EXPLICIT_CONVERSION operator bool() const {
+ *       return ptr != nullptr;
+ *     }
  *   };
  *
  */
 #ifdef MOZ_HAVE_EXPLICIT_CONVERSION
 #  define MOZ_EXPLICIT_CONVERSION explicit
 #else
 #  define MOZ_EXPLICIT_CONVERSION /* no support */
 #endif
@@ -262,19 +262,19 @@
  * method declaration, attempts to delete that method from the corresponding
  * class.  An attempt to use the method will always produce an error *at compile
  * time* (instead of sometimes as late as link time) when this macro can be
  * implemented.  For example, you can use MOZ_DELETE to produce classes with no
  * implicit copy constructor or assignment operator:
  *
  *   struct NonCopyable
  *   {
- *     private:
- *       NonCopyable(const NonCopyable& other) MOZ_DELETE;
- *       void operator=(const NonCopyable& other) MOZ_DELETE;
+ *   private:
+ *     NonCopyable(const NonCopyable& other) MOZ_DELETE;
+ *     void operator=(const NonCopyable& other) MOZ_DELETE;
  *   };
  *
  * If MOZ_DELETE can't be implemented for the current compiler, use of the
  * annotated method will still cause an error, but the error might occur at link
  * time in some cases rather than at compile time.
  *
  * MOZ_DELETE relies on C++11 functionality not universally implemented.  As a
  * backstop, method declarations using MOZ_DELETE should be private.
@@ -290,33 +290,33 @@
  * overrides a member function of a base class, rather than potentially being a
  * new member function.  MOZ_OVERRIDE should be placed immediately before the
  * ';' terminating the member function's declaration, or before '= 0;' if the
  * member function is pure.  If the member function is defined in the class
  * definition, it should appear before the opening brace of the function body.
  *
  *   class Base
  *   {
- *     public:
- *       virtual void f() = 0;
+ *   public:
+ *     virtual void f() = 0;
  *   };
  *   class Derived1 : public Base
  *   {
- *     public:
- *       virtual void f() MOZ_OVERRIDE;
+ *   public:
+ *     virtual void f() MOZ_OVERRIDE;
  *   };
  *   class Derived2 : public Base
  *   {
- *     public:
- *       virtual void f() MOZ_OVERRIDE = 0;
+ *   public:
+ *     virtual void f() MOZ_OVERRIDE = 0;
  *   };
  *   class Derived3 : public Base
  *   {
- *     public:
- *       virtual void f() MOZ_OVERRIDE { }
+ *   public:
+ *     virtual void f() MOZ_OVERRIDE { }
  *   };
  *
  * In compilers supporting C++11 override controls, MOZ_OVERRIDE *requires* that
  * the function marked with it override a member function of a base class: it
  * is a compile error if it does not.  Otherwise MOZ_OVERRIDE does not affect
  * semantics and merely documents the override relationship to the reader (but
  * of course must still be used correctly to not break C++11 compilers).
  */
@@ -334,26 +334,26 @@
  * To annotate a class/struct with MOZ_FINAL, place MOZ_FINAL immediately after
  * the name of the class, before the list of classes from which it derives (if
  * any) and before its opening brace.  MOZ_FINAL must not be used to annotate
  * unnamed classes or structs.  (With some compilers, and with C++11 proper, the
  * underlying expansion is ambiguous with specifying a class name.)
  *
  *   class Base MOZ_FINAL
  *   {
- *     public:
- *       Base();
- *       ~Base();
- *       virtual void f() { }
+ *   public:
+ *     Base();
+ *     ~Base();
+ *     virtual void f() { }
  *   };
  *   // This will be an error in some compilers:
  *   class Derived : public Base
  *   {
- *     public:
- *       ~Derived() { }
+ *   public:
+ *     ~Derived() { }
  *   };
  *
  * One particularly common reason to specify MOZ_FINAL upon a class is to tell
  * the compiler that it's not dangerous for it to have a non-virtual destructor
  * yet have one or more virtual functions, silencing the warning it might emit
  * in this case.  Suppose Base above weren't annotated with MOZ_FINAL.  Because
  * ~Base() is non-virtual, an attempt to delete a Derived* through a Base*
  * wouldn't call ~Derived(), so any cleanup ~Derived() might do wouldn't happen.
@@ -370,24 +370,24 @@
  * before '= 0;' if the member function is pure.  If the member function is
  * defined in the class definition, it should appear before the opening brace of
  * the function body.  (This placement is identical to that for MOZ_OVERRIDE.
  * If both are used, they should appear in the order 'MOZ_FINAL MOZ_OVERRIDE'
  * for consistency.)
  *
  *   class Base
  *   {
- *     public:
- *       virtual void f() MOZ_FINAL;
+ *   public:
+ *     virtual void f() MOZ_FINAL;
  *   };
  *   class Derived
  *   {
- *     public:
- *       // This will be an error in some compilers:
- *       virtual void f();
+ *   public:
+ *     // This will be an error in some compilers:
+ *     virtual void f();
  *   };
  *
  * In compilers implementing final controls, it is an error for a derived class
  * to override a method annotated with MOZ_FINAL.  In other compilers it serves
  * only as documentation.
  */
 #if defined(MOZ_HAVE_CXX11_FINAL)
 #  define MOZ_FINAL             MOZ_HAVE_CXX11_FINAL
--- a/mfbt/BinarySearch.h
+++ b/mfbt/BinarySearch.h
@@ -9,58 +9,60 @@
 
 #include "mozilla/Assertions.h"
 
 #include <stddef.h>
 
 namespace mozilla {
 
 /*
- * The algorithm searches the given container 'c' over the sorted index range
- * [begin, end) for an index 'i' where 'c[i] == target'. If such an index 'i' is
- * found, BinarySearch returns 'true' and the index is returned via the outparam
- * 'matchOrInsertionPoint'. If no index is found, BinarySearch returns 'false'
- * and the outparam returns the first index in [begin, end] where 'target' can
- * be inserted to maintain sorted order.
+ * The algorithm searches the given container |aContainer| over the sorted
+ * index range [aBegin, aEnd) for an index |i| where |aContainer[i] == aTarget|.
+ * If such an index |i| is found, BinarySearch returns |true| and the index is
+ * returned via the outparam |aMatchOrInsertionPoint|. If no index is found,
+ * BinarySearch returns |false| and the outparam returns the first index in
+ * [aBegin, aEnd] where |aTarget| can be inserted to maintain sorted order.
  *
  * Example:
  *
  *   Vector<int> sortedInts = ...
  *
  *   size_t match;
  *   if (BinarySearch(sortedInts, 0, sortedInts.length(), 13, &match))
  *     printf("found 13 at %lu\n", match);
  */
 
 template <typename Container, typename T>
 bool
-BinarySearch(const Container &c, size_t begin, size_t end, T target, size_t *matchOrInsertionPoint)
+BinarySearch(const Container& aContainer, size_t aBegin, size_t aEnd,
+             T aTarget, size_t* aMatchOrInsertionPoint)
 {
-  MOZ_ASSERT(begin <= end);
+  MOZ_ASSERT(aBegin <= aEnd);
 
-  size_t low = begin;
-  size_t high = end;
+  size_t low = aBegin;
+  size_t high = aEnd;
   while (low != high) {
     size_t middle = low + (high - low) / 2;
-    const T &middleValue = c[middle];
+    const T& middleValue = aContainer[middle];
 
-    MOZ_ASSERT(c[low] <= c[middle]);
-    MOZ_ASSERT(c[middle] <= c[high - 1]);
-    MOZ_ASSERT(c[low] <= c[high - 1]);
+    MOZ_ASSERT(aContainer[low] <= aContainer[middle]);
+    MOZ_ASSERT(aContainer[middle] <= aContainer[high - 1]);
+    MOZ_ASSERT(aContainer[low] <= aContainer[high - 1]);
 
-    if (target == middleValue) {
-      *matchOrInsertionPoint = middle;
+    if (aTarget == middleValue) {
+      *aMatchOrInsertionPoint = middle;
       return true;
     }
 
-    if (target < middleValue)
+    if (aTarget < middleValue) {
       high = middle;
-    else
+    } else {
       low = middle + 1;
+    }
   }
 
-  *matchOrInsertionPoint = low;
+  *aMatchOrInsertionPoint = low;
   return false;
 }
 
 } // namespace mozilla
 
 #endif // mozilla_BinarySearch_h
--- a/mfbt/BloomFilter.h
+++ b/mfbt/BloomFilter.h
@@ -50,185 +50,207 @@ namespace mozilla {
  * incorrect answer rate.  A KeySize of 12 has the additional benefit
  * of using exactly one page for the filter in typical hardware
  * configurations.
  */
 
 template<unsigned KeySize, class T>
 class BloomFilter
 {
-    /*
-     * A counting Bloom filter with 8-bit counters.  For now we assume
-     * that having two hash functions is enough, but we may revisit that
-     * decision later.
-     *
-     * The filter uses an array with 2**KeySize entries.
-     *
-     * Assuming a well-distributed hash function, a Bloom filter with
-     * array size M containing N elements and
-     * using k hash function has expected false positive rate exactly
-     *
-     * $  (1 - (1 - 1/M)^{kN})^k  $
-     *
-     * because each array slot has a
-     *
-     * $  (1 - 1/M)^{kN}  $
-     *
-     * chance of being 0, and the expected false positive rate is the
-     * probability that all of the k hash functions will hit a nonzero
-     * slot.
-     *
-     * For reasonable assumptions (M large, kN large, which should both
-     * hold if we're worried about false positives) about M and kN this
-     * becomes approximately
-     *
-     * $$  (1 - \exp(-kN/M))^k   $$
-     *
-     * For our special case of k == 2, that's $(1 - \exp(-2N/M))^2$,
-     * or in other words
-     *
-     * $$    N/M = -0.5 * \ln(1 - \sqrt(r))   $$
-     *
-     * where r is the false positive rate.  This can be used to compute
-     * the desired KeySize for a given load N and false positive rate r.
-     *
-     * If N/M is assumed small, then the false positive rate can
-     * further be approximated as 4*N^2/M^2.  So increasing KeySize by
-     * 1, which doubles M, reduces the false positive rate by about a
-     * factor of 4, and a false positive rate of 1% corresponds to
-     * about M/N == 20.
-     *
-     * What this means in practice is that for a few hundred keys using a
-     * KeySize of 12 gives false positive rates on the order of 0.25-4%.
-     *
-     * Similarly, using a KeySize of 10 would lead to a 4% false
-     * positive rate for N == 100 and to quite bad false positive
-     * rates for larger N.
-     */
-  public:
-    BloomFilter() {
-        static_assert(KeySize <= keyShift, "KeySize too big");
+  /*
+   * A counting Bloom filter with 8-bit counters.  For now we assume
+   * that having two hash functions is enough, but we may revisit that
+   * decision later.
+   *
+   * The filter uses an array with 2**KeySize entries.
+   *
+   * Assuming a well-distributed hash function, a Bloom filter with
+   * array size M containing N elements and
+   * using k hash function has expected false positive rate exactly
+   *
+   * $  (1 - (1 - 1/M)^{kN})^k  $
+   *
+   * because each array slot has a
+   *
+   * $  (1 - 1/M)^{kN}  $
+   *
+   * chance of being 0, and the expected false positive rate is the
+   * probability that all of the k hash functions will hit a nonzero
+   * slot.
+   *
+   * For reasonable assumptions (M large, kN large, which should both
+   * hold if we're worried about false positives) about M and kN this
+   * becomes approximately
+   *
+   * $$  (1 - \exp(-kN/M))^k   $$
+   *
+   * For our special case of k == 2, that's $(1 - \exp(-2N/M))^2$,
+   * or in other words
+   *
+   * $$    N/M = -0.5 * \ln(1 - \sqrt(r))   $$
+   *
+   * where r is the false positive rate.  This can be used to compute
+   * the desired KeySize for a given load N and false positive rate r.
+   *
+   * If N/M is assumed small, then the false positive rate can
+   * further be approximated as 4*N^2/M^2.  So increasing KeySize by
+   * 1, which doubles M, reduces the false positive rate by about a
+   * factor of 4, and a false positive rate of 1% corresponds to
+   * about M/N == 20.
+   *
+   * What this means in practice is that for a few hundred keys using a
+   * KeySize of 12 gives false positive rates on the order of 0.25-4%.
+   *
+   * Similarly, using a KeySize of 10 would lead to a 4% false
+   * positive rate for N == 100 and to quite bad false positive
+   * rates for larger N.
+   */
+public:
+  BloomFilter()
+  {
+    static_assert(KeySize <= kKeyShift, "KeySize too big");
+
+    // Should we have a custom operator new using calloc instead and
+    // require that we're allocated via the operator?
+    clear();
+  }
 
-        // Should we have a custom operator new using calloc instead and
-        // require that we're allocated via the operator?
-        clear();
-    }
+  /*
+   * Clear the filter.  This should be done before reusing it, because
+   * just removing all items doesn't clear counters that hit the upper
+   * bound.
+   */
+  void clear();
+
+  /*
+   * Add an item to the filter.
+   */
+  void add(const T* aValue);
 
-    /*
-     * Clear the filter.  This should be done before reusing it, because
-     * just removing all items doesn't clear counters that hit the upper
-     * bound.
-     */
-    void clear();
+  /*
+   * Remove an item from the filter.
+   */
+  void remove(const T* aValue);
 
-    /*
-     * Add an item to the filter.
-     */
-    void add(const T* t);
+  /*
+   * Check whether the filter might contain an item.  This can
+   * sometimes return true even if the item is not in the filter,
+   * but will never return false for items that are actually in the
+   * filter.
+   */
+  bool mightContain(const T* aValue) const;
 
-    /*
-     * Remove an item from the filter.
-     */
-    void remove(const T* t);
+  /*
+   * Methods for add/remove/contain when we already have a hash computed
+   */
+  void add(uint32_t aHash);
+  void remove(uint32_t aHash);
+  bool mightContain(uint32_t aHash) const;
 
-    /*
-     * Check whether the filter might contain an item.  This can
-     * sometimes return true even if the item is not in the filter,
-     * but will never return false for items that are actually in the
-     * filter.
-     */
-    bool mightContain(const T* t) const;
+private:
+  static const size_t kArraySize = (1 << KeySize);
+  static const uint32_t kKeyMask = (1 << KeySize) - 1;
+  static const uint32_t kKeyShift = 16;
 
-    /*
-     * Methods for add/remove/contain when we already have a hash computed
-     */
-    void add(uint32_t hash);
-    void remove(uint32_t hash);
-    bool mightContain(uint32_t hash) const;
+  static uint32_t hash1(uint32_t aHash)
+  {
+    return aHash & kKeyMask;
+  }
+  static uint32_t hash2(uint32_t aHash)
+  {
+    return (aHash >> kKeyShift) & kKeyMask;
+  }
 
-  private:
-    static const size_t arraySize = (1 << KeySize);
-    static const uint32_t keyMask = (1 << KeySize) - 1;
-    static const uint32_t keyShift = 16;
-
-    static uint32_t hash1(uint32_t hash) { return hash & keyMask; }
-    static uint32_t hash2(uint32_t hash) { return (hash >> keyShift) & keyMask; }
+  uint8_t& firstSlot(uint32_t aHash)
+  {
+    return mCounters[hash1(aHash)];
+  }
+  uint8_t& secondSlot(uint32_t aHash)
+  {
+    return mCounters[hash2(aHash)];
+  }
 
-    uint8_t& firstSlot(uint32_t hash) { return counters[hash1(hash)]; }
-    uint8_t& secondSlot(uint32_t hash) { return counters[hash2(hash)]; }
-    const uint8_t& firstSlot(uint32_t hash) const { return counters[hash1(hash)]; }
-    const uint8_t& secondSlot(uint32_t hash) const { return counters[hash2(hash)]; }
+  const uint8_t& firstSlot(uint32_t aHash) const
+  {
+    return mCounters[hash1(aHash)];
+  }
+  const uint8_t& secondSlot(uint32_t aHash) const
+  {
+    return mCounters[hash2(aHash)];
+  }
 
-    static bool full(const uint8_t& slot) { return slot == UINT8_MAX; }
+  static bool full(const uint8_t& aSlot) { return aSlot == UINT8_MAX; }
 
-    uint8_t counters[arraySize];
+  uint8_t mCounters[kArraySize];
 };
 
 template<unsigned KeySize, class T>
 inline void
 BloomFilter<KeySize, T>::clear()
 {
-  memset(counters, 0, arraySize);
+  memset(mCounters, 0, kArraySize);
 }
 
 template<unsigned KeySize, class T>
 inline void
-BloomFilter<KeySize, T>::add(uint32_t hash)
+BloomFilter<KeySize, T>::add(uint32_t aHash)
 {
-  uint8_t& slot1 = firstSlot(hash);
-  if (MOZ_LIKELY(!full(slot1)))
+  uint8_t& slot1 = firstSlot(aHash);
+  if (MOZ_LIKELY(!full(slot1))) {
     ++slot1;
-
-  uint8_t& slot2 = secondSlot(hash);
+  }
+  uint8_t& slot2 = secondSlot(aHash); {
   if (MOZ_LIKELY(!full(slot2)))
     ++slot2;
+  }
 }
 
 template<unsigned KeySize, class T>
 MOZ_ALWAYS_INLINE void
-BloomFilter<KeySize, T>::add(const T* t)
+BloomFilter<KeySize, T>::add(const T* aValue)
 {
-  uint32_t hash = t->hash();
+  uint32_t hash = aValue->hash();
   return add(hash);
 }
 
 template<unsigned KeySize, class T>
 inline void
-BloomFilter<KeySize, T>::remove(uint32_t hash)
+BloomFilter<KeySize, T>::remove(uint32_t aHash)
 {
   // If the slots are full, we don't know whether we bumped them to be
   // there when we added or not, so just leave them full.
-  uint8_t& slot1 = firstSlot(hash);
-  if (MOZ_LIKELY(!full(slot1)))
+  uint8_t& slot1 = firstSlot(aHash);
+  if (MOZ_LIKELY(!full(slot1))) {
     --slot1;
-
-  uint8_t& slot2 = secondSlot(hash);
-  if (MOZ_LIKELY(!full(slot2)))
+  }
+  uint8_t& slot2 = secondSlot(aHash);
+  if (MOZ_LIKELY(!full(slot2))) {
     --slot2;
+  }
 }
 
 template<unsigned KeySize, class T>
 MOZ_ALWAYS_INLINE void
-BloomFilter<KeySize, T>::remove(const T* t)
+BloomFilter<KeySize, T>::remove(const T* aValue)
 {
-  uint32_t hash = t->hash();
+  uint32_t hash = aValue->hash();
   remove(hash);
 }
 
 template<unsigned KeySize, class T>
 MOZ_ALWAYS_INLINE bool
-BloomFilter<KeySize, T>::mightContain(uint32_t hash) const
+BloomFilter<KeySize, T>::mightContain(uint32_t aHash) const
 {
   // Check that all the slots for this hash contain something
-  return firstSlot(hash) && secondSlot(hash);
+  return firstSlot(aHash) && secondSlot(aHash);
 }
 
 template<unsigned KeySize, class T>
 MOZ_ALWAYS_INLINE bool
-BloomFilter<KeySize, T>::mightContain(const T* t) const
+BloomFilter<KeySize, T>::mightContain(const T* aValue) const
 {
-  uint32_t hash = t->hash();
+  uint32_t hash = aValue->hash();
   return mightContain(hash);
 }
 
 } // namespace mozilla
 
 #endif /* mozilla_BloomFilter_h */
--- a/mfbt/Casting.h
+++ b/mfbt/Casting.h
@@ -12,34 +12,36 @@
 #include "mozilla/Assertions.h"
 #include "mozilla/TypeTraits.h"
 
 #include <limits.h>
 
 namespace mozilla {
 
 /**
- * Return a value of type |To|, containing the underlying bit pattern of |from|.
+ * Return a value of type |To|, containing the underlying bit pattern of
+ * |aFrom|.
  *
  * |To| and |From| must be types of the same size; be careful of cross-platform
  * size differences, or this might fail to compile on some but not all
  * platforms.
  */
 template<typename To, typename From>
 inline To
-BitwiseCast(const From from)
+BitwiseCast(const From aFrom)
 {
   static_assert(sizeof(From) == sizeof(To),
                 "To and From must have the same size");
-  union {
-    From from;
-    To to;
+  union
+  {
+    From mFrom;
+    To mTo;
   } u;
-  u.from = from;
-  return u.to;
+  u.mFrom = aFrom;
+  return u.mTo;
 }
 
 namespace detail {
 
 enum ToSignedness { ToIsSigned, ToIsUnsigned };
 enum FromSignedness { FromIsSigned, FromIsUnsigned };
 
 template<typename From,
@@ -53,150 +55,167 @@ struct BoundsCheckImpl;
 // that are obviously the same type (and will undergo no further conversions),
 // even when it's not strictly necessary, for explicitness.
 
 enum UUComparison { FromIsBigger, FromIsNotBigger };
 
 // Unsigned-to-unsigned range check
 
 template<typename From, typename To,
-         UUComparison = (sizeof(From) > sizeof(To)) ? FromIsBigger : FromIsNotBigger>
+         UUComparison = (sizeof(From) > sizeof(To))
+                        ? FromIsBigger
+                        : FromIsNotBigger>
 struct UnsignedUnsignedCheck;
 
 template<typename From, typename To>
 struct UnsignedUnsignedCheck<From, To, FromIsBigger>
 {
-  public:
-    static bool checkBounds(const From from) {
-      return from <= From(To(-1));
-    }
+public:
+  static bool checkBounds(const From aFrom)
+  {
+    return aFrom <= From(To(-1));
+  }
 };
 
 template<typename From, typename To>
 struct UnsignedUnsignedCheck<From, To, FromIsNotBigger>
 {
-  public:
-    static bool checkBounds(const From from) {
-      return true;
-    }
+public:
+  static bool checkBounds(const From aFrom)
+  {
+    return true;
+  }
 };
 
 template<typename From, typename To>
 struct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsUnsigned>
 {
-  public:
-    static bool checkBounds(const From from) {
-      return UnsignedUnsignedCheck<From, To>::checkBounds(from);
-    }
+public:
+  static bool checkBounds(const From aFrom)
+  {
+    return UnsignedUnsignedCheck<From, To>::checkBounds(aFrom);
+  }
 };
 
 // Signed-to-unsigned range check
 
 template<typename From, typename To>
 struct BoundsCheckImpl<From, To, FromIsSigned, ToIsUnsigned>
 {
-  public:
-    static bool checkBounds(const From from) {
-      if (from < 0)
-        return false;
-      if (sizeof(To) >= sizeof(From))
-        return true;
-      return from <= From(To(-1));
+public:
+  static bool checkBounds(const From aFrom)
+  {
+    if (aFrom < 0) {
+      return false;
     }
+    if (sizeof(To) >= sizeof(From)) {
+      return true;
+    }
+    return aFrom <= From(To(-1));
+  }
 };
 
 // Unsigned-to-signed range check
 
 enum USComparison { FromIsSmaller, FromIsNotSmaller };
 
 template<typename From, typename To,
-         USComparison = (sizeof(From) < sizeof(To)) ? FromIsSmaller : FromIsNotSmaller>
+         USComparison = (sizeof(From) < sizeof(To))
+                        ? FromIsSmaller
+                        : FromIsNotSmaller>
 struct UnsignedSignedCheck;
 
 template<typename From, typename To>
 struct UnsignedSignedCheck<From, To, FromIsSmaller>
 {
-  public:
-    static bool checkBounds(const From from) {
-      return true;
-    }
+public:
+  static bool checkBounds(const From aFrom)
+  {
+    return true;
+  }
 };
 
 template<typename From, typename To>
 struct UnsignedSignedCheck<From, To, FromIsNotSmaller>
 {
-  public:
-    static bool checkBounds(const From from) {
-      const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);
-      return from <= From(MaxValue);
-    }
+public:
+  static bool checkBounds(const From aFrom)
+  {
+    const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);
+    return aFrom <= From(MaxValue);
+  }
 };
 
 template<typename From, typename To>
 struct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsSigned>
 {
-  public:
-    static bool checkBounds(const From from) {
-      return UnsignedSignedCheck<From, To>::checkBounds(from);
-    }
+public:
+  static bool checkBounds(const From aFrom)
+  {
+    return UnsignedSignedCheck<From, To>::checkBounds(aFrom);
+  }
 };
 
 // Signed-to-signed range check
 
 template<typename From, typename To>
 struct BoundsCheckImpl<From, To, FromIsSigned, ToIsSigned>
 {
-  public:
-    static bool checkBounds(const From from) {
-      if (sizeof(From) <= sizeof(To))
-        return true;
-      const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);
-      const To MinValue = -MaxValue - To(1);
-      return From(MinValue) <= from &&
-             From(from) <= From(MaxValue);
+public:
+  static bool checkBounds(const From aFrom)
+  {
+    if (sizeof(From) <= sizeof(To)) {
+      return true;
     }
+    const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);
+    const To MinValue = -MaxValue - To(1);
+    return From(MinValue) <= aFrom &&
+           From(aFrom) <= From(MaxValue);
+  }
 };
 
 template<typename From, typename To,
-         bool TypesAreIntegral = IsIntegral<From>::value && IsIntegral<To>::value>
+         bool TypesAreIntegral = IsIntegral<From>::value &&
+                                 IsIntegral<To>::value>
 class BoundsChecker;
 
 template<typename From>
 class BoundsChecker<From, From, true>
 {
-  public:
-    static bool checkBounds(const From from) { return true; }
+public:
+  static bool checkBounds(const From aFrom) { return true; }
 };
 
 template<typename From, typename To>
 class BoundsChecker<From, To, true>
 {
-  public:
-    static bool checkBounds(const From from) {
-      return BoundsCheckImpl<From, To>::checkBounds(from);
-    }
+public:
+  static bool checkBounds(const From aFrom)
+  {
+    return BoundsCheckImpl<From, To>::checkBounds(aFrom);
+  }
 };
 
 template<typename From, typename To>
 inline bool
-IsInBounds(const From from)
+IsInBounds(const From aFrom)
 {
-  return BoundsChecker<From, To>::checkBounds(from);
+  return BoundsChecker<From, To>::checkBounds(aFrom);
 }
 
 } // namespace detail
 
 /**
  * Cast a value of integral type |From| to a value of integral type |To|,
  * asserting that the cast will be a safe cast per C++ (that is, that |to| is in
  * the range of values permitted for the type |From|).
  */
 template<typename To, typename From>
 inline To
-SafeCast(const From from)
+SafeCast(const From aFrom)
 {
-  MOZ_ASSERT((detail::IsInBounds<From, To>(from)));
-  return static_cast<To>(from);
+  MOZ_ASSERT((detail::IsInBounds<From, To>(aFrom)));
+  return static_cast<To>(aFrom);
 }
 
 } // namespace mozilla
 
 #endif /* mozilla_Casting_h */
--- a/mfbt/ChaosMode.h
+++ b/mfbt/ChaosMode.h
@@ -14,28 +14,28 @@ namespace mozilla {
 
 /**
  * When "chaos mode" is activated, code that makes implicitly nondeterministic
  * choices is encouraged to make random and extreme choices, to test more
  * code paths and uncover bugs.
  */
 class ChaosMode
 {
-  public:
-    static bool isActive()
-    {
-      // Flip this to true to activate chaos mode
-      return false;
-    }
+public:
+  static bool isActive()
+  {
+    // Flip this to true to activate chaos mode
+    return false;
+  }
 
-    /**
-     * Returns a somewhat (but not uniformly) random uint32_t < aBound.
-     * Not to be used for anything except ChaosMode, since it's not very random.
-     */
-    static uint32_t randomUint32LessThan(uint32_t aBound)
-    {
-      return uint32_t(rand()) % aBound;
-    }
+  /**
+   * Returns a somewhat (but not uniformly) random uint32_t < aBound.
+   * Not to be used for anything except ChaosMode, since it's not very random.
+   */
+  static uint32_t randomUint32LessThan(uint32_t aBound)
+  {
+    return uint32_t(rand()) % aBound;
+  }
 };
 
 } /* namespace mozilla */
 
 #endif /* mozilla_ChaosMode_h */
--- a/mfbt/Char16.h
+++ b/mfbt/Char16.h
@@ -27,18 +27,18 @@
     * typedefs, which we set to wchar_t for C++ code.
     *
     * In addition, #defining _CHAR16T will prevent yvals.h from defining a
     * char32_t type, so we have to undo that damage here and provide our own,
     * which is identical to the yvals.h type.
     */
 #  define MOZ_UTF16_HELPER(s) L##s
 #  define _CHAR16T
-   typedef wchar_t char16_t;
-   typedef unsigned int char32_t;
+typedef wchar_t char16_t;
+typedef unsigned int char32_t;
 #else
    /* C++11 has a builtin char16_t type. */
 #  define MOZ_UTF16_HELPER(s) u##s
    /**
     * This macro is used to distinguish when char16_t would be a distinct
     * typedef from wchar_t.
     */
 #  define MOZ_CHAR16_IS_NOT_WCHAR
@@ -56,96 +56,118 @@
    * This class is supposed to make it easier. It stores char16_t const pointer,
    * but provides implicit casts for wchar_t as well. On other platforms, we
    * simply use |typedef const char16_t* char16ptr_t|. Here, we want to make
    * the class as similar to this typedef, including providing some casts that
    * are allowed by the typedef.
    */
 class char16ptr_t
 {
-  private:
-    const char16_t* ptr;
-    static_assert(sizeof(char16_t) == sizeof(wchar_t), "char16_t and wchar_t sizes differ");
+private:
+  const char16_t* mPtr;
+  static_assert(sizeof(char16_t) == sizeof(wchar_t),
+                "char16_t and wchar_t sizes differ");
 
-  public:
-    char16ptr_t(const char16_t* p) : ptr(p) {}
-    char16ptr_t(const wchar_t* p) : ptr(reinterpret_cast<const char16_t*>(p)) {}
+public:
+  char16ptr_t(const char16_t* aPtr) : mPtr(aPtr) {}
+  char16ptr_t(const wchar_t* aPtr) :
+    mPtr(reinterpret_cast<const char16_t*>(aPtr))
+  {}
 
-    /* Without this, nullptr assignment would be ambiguous. */
-    constexpr char16ptr_t(decltype(nullptr)) : ptr(nullptr) {}
+  /* Without this, nullptr assignment would be ambiguous. */
+  constexpr char16ptr_t(decltype(nullptr)) : mPtr(nullptr) {}
 
-    operator const char16_t*() const {
-      return ptr;
-    }
-    operator const wchar_t*() const {
-      return reinterpret_cast<const wchar_t*>(ptr);
-    }
-    operator const void*() const {
-      return ptr;
-    }
-    operator bool() const {
-      return ptr != nullptr;
-    }
-    operator std::wstring() const {
-      return std::wstring(static_cast<const wchar_t*>(*this));
-    }
+  operator const char16_t*() const
+  {
+    return mPtr;
+  }
+  operator const wchar_t*() const
+  {
+    return reinterpret_cast<const wchar_t*>(mPtr);
+  }
+  operator const void*() const
+  {
+    return mPtr;
+  }
+  operator bool() const
+  {
+    return mPtr != nullptr;
+  }
+  operator std::wstring() const
+  {
+    return std::wstring(static_cast<const wchar_t*>(*this));
+  }
 
-    /* Explicit cast operators to allow things like (char16_t*)str. */
-    explicit operator char16_t*() const {
-      return const_cast<char16_t*>(ptr);
-    }
-    explicit operator wchar_t*() const {
-      return const_cast<wchar_t*>(static_cast<const wchar_t*>(*this));
-    }
+  /* Explicit cast operators to allow things like (char16_t*)str. */
+  explicit operator char16_t*() const
+  {
+    return const_cast<char16_t*>(mPtr);
+  }
+  explicit operator wchar_t*() const
+  {
+    return const_cast<wchar_t*>(static_cast<const wchar_t*>(*this));
+  }
 
-    /**
-     * Some Windows API calls accept BYTE* but require that data actually be WCHAR*.
-     * Supporting this requires explicit operators to support the requisite explicit
-     * casts.
-     */
-    explicit operator const char*() const {
-      return reinterpret_cast<const char*>(ptr);
-    }
-    explicit operator const unsigned char*() const {
-      return reinterpret_cast<const unsigned char*>(ptr);
-    }
-    explicit operator unsigned char*() const {
-      return const_cast<unsigned char*>(reinterpret_cast<const unsigned char*>(ptr));
-    }
-    explicit operator void*() const {
-      return const_cast<char16_t*>(ptr);
-    }
+  /**
+   * Some Windows API calls accept BYTE* but require that data actually be WCHAR*.
+   * Supporting this requires explicit operators to support the requisite explicit
+   * casts.
+   */
+  explicit operator const char*() const
+  {
+    return reinterpret_cast<const char*>(mPtr);
+  }
+  explicit operator const unsigned char*() const
+  {
+    return reinterpret_cast<const unsigned char*>(mPtr);
+  }
+  explicit operator unsigned char*() const
+  {
+    return const_cast<unsigned char*>(reinterpret_cast<const unsigned char*>(mPtr));
+  }
+  explicit operator void*() const
+  {
+    return const_cast<char16_t*>(mPtr);
+  }
 
-    /* Some operators used on pointers. */
-    char16_t operator[](size_t i) const {
-      return ptr[i];
-    }
-    bool operator==(const char16ptr_t &x) const {
-      return ptr == x.ptr;
-    }
-    bool operator==(decltype(nullptr)) const {
-      return ptr == nullptr;
-    }
-    bool operator!=(const char16ptr_t &x) const {
-      return ptr != x.ptr;
-    }
-    bool operator!=(decltype(nullptr)) const {
-      return ptr != nullptr;
-    }
-    char16ptr_t operator+(size_t add) const {
-      return char16ptr_t(ptr + add);
-    }
-    ptrdiff_t operator-(const char16ptr_t &other) const {
-      return ptr - other.ptr;
-    }
+  /* Some operators used on pointers. */
+  char16_t operator[](size_t aIndex) const
+  {
+    return mPtr[aIndex];
+  }
+  bool operator==(const char16ptr_t &aOther) const
+  {
+    return mPtr == aOther.mPtr;
+  }
+  bool operator==(decltype(nullptr)) const
+  {
+    return mPtr == nullptr;
+  }
+  bool operator!=(const char16ptr_t &aOther) const
+  {
+    return mPtr != aOther.mPtr;
+  }
+  bool operator!=(decltype(nullptr)) const
+  {
+    return mPtr != nullptr;
+  }
+  char16ptr_t operator+(size_t aValue) const
+  {
+    return char16ptr_t(mPtr + aValue);
+  }
+  ptrdiff_t operator-(const char16ptr_t &aOther) const
+  {
+    return mPtr - aOther.mPtr;
+  }
 };
 
 inline decltype((char*)0-(char*)0)
-operator-(const char16_t* x, const char16ptr_t y) {
-  return x - static_cast<const char16_t*>(y);
+operator-(const char16_t* aX, const char16ptr_t aY)
+{
+  return aX - static_cast<const char16_t*>(aY);
 }
 
 #else
 
 typedef const char16_t* char16ptr_t;
 
 #endif
 
--- a/mfbt/CheckedInt.h
+++ b/mfbt/CheckedInt.h
@@ -30,23 +30,23 @@ namespace detail {
  * type that isn't just a typedef for some of them, is int8_t.
  */
 
 struct UnsupportedType {};
 
 template<typename IntegerType>
 struct IsSupportedPass2
 {
-    static const bool value = false;
+  static const bool value = false;
 };
 
 template<typename IntegerType>
 struct IsSupported
 {
-    static const bool value = IsSupportedPass2<IntegerType>::value;
+  static const bool value = IsSupportedPass2<IntegerType>::value;
 };
 
 template<>
 struct IsSupported<int8_t>
 { static const bool value = true; };
 
 template<>
 struct IsSupported<uint8_t>
@@ -125,298 +125,305 @@ struct IsSupportedPass2<unsigned long lo
  * Step 2: Implement the actual validity checks.
  *
  * Ideas taken from IntegerLib, code different.
  */
 
 template<typename IntegerType, size_t Size = sizeof(IntegerType)>
 struct TwiceBiggerType
 {
-    typedef typename detail::StdintTypeForSizeAndSignedness<
-                       sizeof(IntegerType) * 2,
-                       IsSigned<IntegerType>::value
-                     >::Type Type;
+  typedef typename detail::StdintTypeForSizeAndSignedness<
+                     sizeof(IntegerType) * 2,
+                     IsSigned<IntegerType>::value
+                   >::Type Type;
 };
 
 template<typename IntegerType>
 struct TwiceBiggerType<IntegerType, 8>
 {
-    typedef UnsupportedType Type;
+  typedef UnsupportedType Type;
 };
 
 template<typename T>
 inline bool
-HasSignBit(T x)
+HasSignBit(T aX)
 {
   // In C++, right bit shifts on negative values is undefined by the standard.
   // Notice that signed-to-unsigned conversions are always well-defined in the
   // standard, as the value congruent modulo 2**n as expected. By contrast,
   // unsigned-to-signed is only well-defined if the value is representable.
-  return bool(typename MakeUnsigned<T>::Type(x) >> PositionOfSignBit<T>::value);
+  return bool(typename MakeUnsigned<T>::Type(aX) >>
+              PositionOfSignBit<T>::value);
 }
 
 // Bitwise ops may return a larger type, so it's good to use this inline
 // helper guaranteeing that the result is really of type T.
 template<typename T>
 inline T
-BinaryComplement(T x)
+BinaryComplement(T aX)
 {
-  return ~x;
+  return ~aX;
 }
 
 template<typename T,
          typename U,
          bool IsTSigned = IsSigned<T>::value,
          bool IsUSigned = IsSigned<U>::value>
 struct DoesRangeContainRange
 {
 };
 
 template<typename T, typename U, bool Signedness>
 struct DoesRangeContainRange<T, U, Signedness, Signedness>
 {
-    static const bool value = sizeof(T) >= sizeof(U);
+  static const bool value = sizeof(T) >= sizeof(U);
 };
 
 template<typename T, typename U>
 struct DoesRangeContainRange<T, U, true, false>
 {
-    static const bool value = sizeof(T) > sizeof(U);
+  static const bool value = sizeof(T) > sizeof(U);
 };
 
 template<typename T, typename U>
 struct DoesRangeContainRange<T, U, false, true>
 {
-    static const bool value = false;
+  static const bool value = false;
 };
 
 template<typename T,
          typename U,
          bool IsTSigned = IsSigned<T>::value,
          bool IsUSigned = IsSigned<U>::value,
          bool DoesTRangeContainURange = DoesRangeContainRange<T, U>::value>
 struct IsInRangeImpl {};
 
 template<typename T, typename U, bool IsTSigned, bool IsUSigned>
 struct IsInRangeImpl<T, U, IsTSigned, IsUSigned, true>
 {
-    static bool run(U)
-    {
-       return true;
-    }
+  static bool run(U)
+  {
+    return true;
+  }
 };
 
 template<typename T, typename U>
 struct IsInRangeImpl<T, U, true, true, false>
 {
-    static bool run(U x)
-    {
-      return x <= MaxValue<T>::value && x >= MinValue<T>::value;
-    }
+  static bool run(U aX)
+  {
+    return aX <= MaxValue<T>::value && aX >= MinValue<T>::value;
+  }
 };
 
 template<typename T, typename U>
 struct IsInRangeImpl<T, U, false, false, false>
 {
-    static bool run(U x)
-    {
-      return x <= MaxValue<T>::value;
-    }
+  static bool run(U aX)
+  {
+    return aX <= MaxValue<T>::value;
+  }
 };
 
 template<typename T, typename U>
 struct IsInRangeImpl<T, U, true, false, false>
 {
-    static bool run(U x)
-    {
-      return sizeof(T) > sizeof(U) || x <= U(MaxValue<T>::value);
-    }
+  static bool run(U aX)
+  {
+    return sizeof(T) > sizeof(U) || aX <= U(MaxValue<T>::value);
+  }
 };
 
 template<typename T, typename U>
 struct IsInRangeImpl<T, U, false, true, false>
 {
-    static bool run(U x)
-    {
-      return sizeof(T) >= sizeof(U)
-             ? x >= 0
-             : x >= 0 && x <= U(MaxValue<T>::value);
-    }
+  static bool run(U aX)
+  {
+    return sizeof(T) >= sizeof(U)
+           ? aX >= 0
+           : aX >= 0 && aX <= U(MaxValue<T>::value);
+  }
 };
 
 template<typename T, typename U>
 inline bool
-IsInRange(U x)
+IsInRange(U aX)
 {
-  return IsInRangeImpl<T, U>::run(x);
+  return IsInRangeImpl<T, U>::run(aX);
 }
 
 template<typename T>
 inline bool
-IsAddValid(T x, T y)
+IsAddValid(T aX, T aY)
 {
-  // Addition is valid if the sign of x+y is equal to either that of x or that
-  // of y. Since the value of x+y is undefined if we have a signed type, we
-  // compute it using the unsigned type of the same size.
-  // Beware! These bitwise operations can return a larger integer type,
-  // if T was a small type like int8_t, so we explicitly cast to T.
+  // Addition is valid if the sign of aX+aY is equal to either that of aX or
+  // that of aY. Since the value of aX+aY is undefined if we have a signed
+  // type, we compute it using the unsigned type of the same size.  Beware!
+  // These bitwise operations can return a larger integer type, if T was a
+  // small type like int8_t, so we explicitly cast to T.
 
-  typename MakeUnsigned<T>::Type ux = x;
-  typename MakeUnsigned<T>::Type uy = y;
+  typename MakeUnsigned<T>::Type ux = aX;
+  typename MakeUnsigned<T>::Type uy = aY;
   typename MakeUnsigned<T>::Type result = ux + uy;
   return IsSigned<T>::value
-         ? HasSignBit(BinaryComplement(T((result ^ x) & (result ^ y))))
-         : BinaryComplement(x) >= y;
+         ? HasSignBit(BinaryComplement(T((result ^ aX) & (result ^ aY))))
+         : BinaryComplement(aX) >= aY;
 }
 
 template<typename T>
 inline bool
-IsSubValid(T x, T y)
+IsSubValid(T aX, T aY)
 {
-  // Subtraction is valid if either x and y have same sign, or x-y and x have
-  // same sign. Since the value of x-y is undefined if we have a signed type,
-  // we compute it using the unsigned type of the same size.
-  typename MakeUnsigned<T>::Type ux = x;
-  typename MakeUnsigned<T>::Type uy = y;
+  // Subtraction is valid if either aX and aY have same sign, or aX-aY and aX
+  // have same sign. Since the value of aX-aY is undefined if we have a signed
+  // type, we compute it using the unsigned type of the same size.
+  typename MakeUnsigned<T>::Type ux = aX;
+  typename MakeUnsigned<T>::Type uy = aY;
   typename MakeUnsigned<T>::Type result = ux - uy;
 
   return IsSigned<T>::value
-         ? HasSignBit(BinaryComplement(T((result ^ x) & (x ^ y))))
-         : x >= y;
+         ? HasSignBit(BinaryComplement(T((result ^ aX) & (aX ^ aY))))
+         : aX >= aY;
 }
 
 template<typename T,
          bool IsTSigned = IsSigned<T>::value,
          bool TwiceBiggerTypeIsSupported =
            IsSupported<typename TwiceBiggerType<T>::Type>::value>
 struct IsMulValidImpl {};
 
 template<typename T, bool IsTSigned>
 struct IsMulValidImpl<T, IsTSigned, true>
 {
-    static bool run(T x, T y)
-    {
-      typedef typename TwiceBiggerType<T>::Type TwiceBiggerType;
-      TwiceBiggerType product = TwiceBiggerType(x) * TwiceBiggerType(y);
-      return IsInRange<T>(product);
-    }
+  static bool run(T aX, T aY)
+  {
+    typedef typename TwiceBiggerType<T>::Type TwiceBiggerType;
+    TwiceBiggerType product = TwiceBiggerType(aX) * TwiceBiggerType(aY);
+    return IsInRange<T>(product);
+  }
 };
 
 template<typename T>
 struct IsMulValidImpl<T, true, false>
 {
-    static bool run(T x, T y)
-    {
-      const T max = MaxValue<T>::value;
-      const T min = MinValue<T>::value;
-
-      if (x == 0 || y == 0)
-        return true;
+  static bool run(T aX, T aY)
+  {
+    const T max = MaxValue<T>::value;
+    const T min = MinValue<T>::value;
 
-      if (x > 0) {
-        return y > 0
-               ? x <= max / y
-               : y >= min / x;
-      }
+    if (aX == 0 || aY == 0) {
+      return true;
+    }
+    if (aX > 0) {
+      return aY > 0
+             ? aX <= max / aY
+             : aY >= min / aX;
+    }
 
-      // If we reach this point, we know that x < 0.
-      return y > 0
-             ? x >= min / y
-             : y >= max / x;
-    }
+    // If we reach this point, we know that aX < 0.
+    return aY > 0
+           ? aX >= min / aY
+           : aY >= max / aX;
+  }
 };
 
 template<typename T>
 struct IsMulValidImpl<T, false, false>
 {
-    static bool run(T x, T y)
-    {
-      return y == 0 ||  x <= MaxValue<T>::value / y;
-    }
+  static bool run(T aX, T aY)
+  {
+    return aY == 0 ||  aX <= MaxValue<T>::value / aY;
+  }
 };
 
 template<typename T>
 inline bool
-IsMulValid(T x, T y)
+IsMulValid(T aX, T aY)
 {
-  return IsMulValidImpl<T>::run(x, y);
+  return IsMulValidImpl<T>::run(aX, aY);
 }
 
 template<typename T>
 inline bool
-IsDivValid(T x, T y)
+IsDivValid(T aX, T aY)
 {
-  // Keep in mind that in the signed case, min/-1 is invalid because abs(min)>max.
-  return y != 0 &&
-         !(IsSigned<T>::value && x == MinValue<T>::value && y == T(-1));
+  // Keep in mind that in the signed case, min/-1 is invalid because
+  // abs(min)>max.
+  return aY != 0 &&
+         !(IsSigned<T>::value && aX == MinValue<T>::value && aY == T(-1));
 }
 
 template<typename T, bool IsTSigned = IsSigned<T>::value>
 struct IsModValidImpl;
 
 template<typename T>
 inline bool
-IsModValid(T x, T y)
+IsModValid(T aX, T aY)
 {
-  return IsModValidImpl<T>::run(x, y);
+  return IsModValidImpl<T>::run(aX, aY);
 }
 
 /*
  * Mod is pretty simple.
  * For now, let's just use the ANSI C definition:
- * If x or y are negative, the results are implementation defined.
+ * If aX or aY are negative, the results are implementation defined.
  *   Consider these invalid.
- * Undefined for y=0.
- * The result will never exceed either x or y.
+ * Undefined for aY=0.
+ * The result will never exceed either aX or aY.
  *
- * Checking that x>=0 is a warning when T is unsigned.
+ * Checking that aX>=0 is a warning when T is unsigned.
  */
 
 template<typename T>
-struct IsModValidImpl<T, false> {
-  static inline bool run(T x, T y) {
-    return y >= 1;
+struct IsModValidImpl<T, false>
+{
+  static inline bool run(T aX, T aY)
+  {
+    return aY >= 1;
   }
 };
 
 template<typename T>
-struct IsModValidImpl<T, true> {
-  static inline bool run(T x, T y) {
-    if (x < 0)
+struct IsModValidImpl<T, true>
+{
+  static inline bool run(T aX, T aY)
+  {
+    if (aX < 0) {
       return false;
-
-    return y >= 1;
+    }
+    return aY >= 1;
   }
 };
 
 template<typename T, bool IsSigned = IsSigned<T>::value>
 struct NegateImpl;
 
 template<typename T>
 struct NegateImpl<T, false>
 {
-    static CheckedInt<T> negate(const CheckedInt<T>& val)
-    {
-      // Handle negation separately for signed/unsigned, for simpler code and to
-      // avoid an MSVC warning negating an unsigned value.
-      return CheckedInt<T>(0, val.isValid() && val.mValue == 0);
-    }
+  static CheckedInt<T> negate(const CheckedInt<T>& aVal)
+  {
+    // Handle negation separately for signed/unsigned, for simpler code and to
+    // avoid an MSVC warning negating an unsigned value.
+    return CheckedInt<T>(0, aVal.isValid() && aVal.mValue == 0);
+  }
 };
 
 template<typename T>
 struct NegateImpl<T, true>
 {
-    static CheckedInt<T> negate(const CheckedInt<T>& val)
-    {
-      // Watch out for the min-value, which (with twos-complement) can't be
-      // negated as -min-value is then (max-value + 1).
-      if (!val.isValid() || val.mValue == MinValue<T>::value)
-        return CheckedInt<T>(val.mValue, false);
-      return CheckedInt<T>(-val.mValue, true);
+  static CheckedInt<T> negate(const CheckedInt<T>& aVal)
+  {
+    // Watch out for the min-value, which (with twos-complement) can't be
+    // negated as -min-value is then (max-value + 1).
+    if (!aVal.isValid() || aVal.mValue == MinValue<T>::value) {
+      return CheckedInt<T>(aVal.mValue, false);
     }
+    return CheckedInt<T>(-aVal.mValue, true);
+  }
 };
 
 } // namespace detail
 
 
 /*
  * Step 3: Now define the CheckedInt class.
  */
@@ -432,28 +439,28 @@ struct NegateImpl<T, true>
  * that isValid() returns true, you then have a guarantee that no problem, such
  * as integer overflow, happened during this computation, and you can call
  * value() to get the plain integer value.
  *
  * The arithmetic operators in this class are guaranteed not to raise a signal
  * (e.g. in case of a division by zero).
  *
  * For example, suppose that you want to implement a function that computes
- * (x+y)/z, that doesn't crash if z==0, and that reports on error (divide by
+ * (aX+aY)/aZ, that doesn't crash if aZ==0, and that reports on error (divide by
  * zero or integer overflow). You could code it as follows:
    @code
-   bool computeXPlusYOverZ(int x, int y, int z, int *result)
+   bool computeXPlusYOverZ(int aX, int aY, int aZ, int *aResult)
    {
-       CheckedInt<int> checkedResult = (CheckedInt<int>(x) + y) / z;
-       if (checkedResult.isValid()) {
-           *result = checkedResult.value();
-           return true;
-       } else {
-           return false;
-       }
+     CheckedInt<int> checkedResult = (CheckedInt<int>(aX) + aY) / aZ;
+     if (checkedResult.isValid()) {
+       *aResult = checkedResult.value();
+       return true;
+     } else {
+       return false;
+     }
    }
    @endcode
  *
  * Implicit conversion from plain integers to checked integers is allowed. The
  * plain integer is checked to be in range before being casted to the
  * destination type. This means that the following lines all compile, and the
  * resulting CheckedInts are correctly detected as valid or invalid:
  * @code
@@ -486,203 +493,198 @@ struct NegateImpl<T, true>
    @code
    typedef CheckedInt<int32_t> CheckedInt32;
    typedef CheckedInt<uint16_t> CheckedUint16;
    @endcode
  */
 template<typename T>
 class CheckedInt
 {
-  protected:
-    T mValue;
-    bool mIsValid;
+protected:
+  T mValue;
+  bool mIsValid;
 
-    template<typename U>
-    CheckedInt(U aValue, bool aIsValid) : mValue(aValue), mIsValid(aIsValid)
-    {
-      static_assert(detail::IsSupported<T>::value &&
-                    detail::IsSupported<U>::value,
-                    "This type is not supported by CheckedInt");
-    }
+  template<typename U>
+  CheckedInt(U aValue, bool aIsValid) : mValue(aValue), mIsValid(aIsValid)
+  {
+    static_assert(detail::IsSupported<T>::value &&
+                  detail::IsSupported<U>::value,
+                  "This type is not supported by CheckedInt");
+  }
 
-    friend struct detail::NegateImpl<T>;
+  friend struct detail::NegateImpl<T>;
 
-  public:
-    /**
-     * Constructs a checked integer with given @a value. The checked integer is
-     * initialized as valid or invalid depending on whether the @a value
-     * is in range.
-     *
-     * This constructor is not explicit. Instead, the type of its argument is a
-     * separate template parameter, ensuring that no conversion is performed
-     * before this constructor is actually called. As explained in the above
-     * documentation for class CheckedInt, this constructor checks that its
-     * argument is valid.
-     */
-    template<typename U>
-    CheckedInt(U aValue)
-      : mValue(T(aValue)),
-        mIsValid(detail::IsInRange<T>(aValue))
-    {
-      static_assert(detail::IsSupported<T>::value &&
-                    detail::IsSupported<U>::value,
-                    "This type is not supported by CheckedInt");
-    }
+public:
+  /**
+   * Constructs a checked integer with given @a value. The checked integer is
+   * initialized as valid or invalid depending on whether the @a value
+   * is in range.
+   *
+   * This constructor is not explicit. Instead, the type of its argument is a
+   * separate template parameter, ensuring that no conversion is performed
+   * before this constructor is actually called. As explained in the above
+   * documentation for class CheckedInt, this constructor checks that its
+   * argument is valid.
+   */
+  template<typename U>
+  CheckedInt(U aValue)
+    : mValue(T(aValue)),
+      mIsValid(detail::IsInRange<T>(aValue))
+  {
+    static_assert(detail::IsSupported<T>::value &&
+                  detail::IsSupported<U>::value,
+                  "This type is not supported by CheckedInt");
+  }
 
-    template<typename U>
-    friend class CheckedInt;
+  template<typename U>
+  friend class CheckedInt;
 
-    template<typename U>
-    CheckedInt<U> toChecked() const
-    {
-      CheckedInt<U> ret(mValue);
-      ret.mIsValid = ret.mIsValid && mIsValid;
-      return ret;
-    }
+  template<typename U>
+  CheckedInt<U> toChecked() const
+  {
+    CheckedInt<U> ret(mValue);
+    ret.mIsValid = ret.mIsValid && mIsValid;
+    return ret;
+  }
 
-    /** Constructs a valid checked integer with initial value 0 */
-    CheckedInt() : mValue(0), mIsValid(true)
-    {
-      static_assert(detail::IsSupported<T>::value,
-                    "This type is not supported by CheckedInt");
-    }
+  /** Constructs a valid checked integer with initial value 0 */
+  CheckedInt() : mValue(0), mIsValid(true)
+  {
+    static_assert(detail::IsSupported<T>::value,
+                  "This type is not supported by CheckedInt");
+  }
 
-    /** @returns the actual value */
-    T value() const
-    {
-      MOZ_ASSERT(mIsValid, "Invalid checked integer (division by zero or integer overflow)");
-      return mValue;
-    }
+  /** @returns the actual value */
+  T value() const
+  {
+    MOZ_ASSERT(mIsValid, "Invalid checked integer (division by zero or integer overflow)");
+    return mValue;
+  }
 
-    /**
-     * @returns true if the checked integer is valid, i.e. is not the result
-     * of an invalid operation or of an operation involving an invalid checked
-     * integer
-     */
-    bool isValid() const
-    {
-      return mIsValid;
-    }
+  /**
+   * @returns true if the checked integer is valid, i.e. is not the result
+   * of an invalid operation or of an operation involving an invalid checked
+   * integer
+   */
+  bool isValid() const
+  {
+    return mIsValid;
+  }
 
-    template<typename U>
-    friend CheckedInt<U> operator +(const CheckedInt<U>& lhs,
-                                    const CheckedInt<U>& rhs);
-    template<typename U>
-    CheckedInt& operator +=(U rhs);
+  template<typename U>
+  friend CheckedInt<U> operator +(const CheckedInt<U>& aLhs,
+                                  const CheckedInt<U>& aRhs);
+  template<typename U>
+  CheckedInt& operator +=(U aRhs);
 
-    template<typename U>
-    friend CheckedInt<U> operator -(const CheckedInt<U>& lhs,
-                                    const CheckedInt<U>& rhs);
-    template<typename U>
-    CheckedInt& operator -=(U rhs);
+  template<typename U>
+  friend CheckedInt<U> operator -(const CheckedInt<U>& aLhs,
+                                  const CheckedInt<U>& aRhs);
+  template<typename U>
+  CheckedInt& operator -=(U aRhs);
 
-    template<typename U>
-    friend CheckedInt<U> operator *(const CheckedInt<U>& lhs,
-                                    const CheckedInt<U>& rhs);
-    template<typename U>
-    CheckedInt& operator *=(U rhs);
-
-    template<typename U>
-    friend CheckedInt<U> operator /(const CheckedInt<U>& lhs,
-                                    const CheckedInt<U>& rhs);
-    template<typename U>
-    CheckedInt& operator /=(U rhs);
-
-    template<typename U>
-    friend CheckedInt<U> operator %(const CheckedInt<U>& lhs,
-                                    const CheckedInt<U>& rhs);
-    template<typename U>
-    CheckedInt& operator %=(U rhs);
-
-    CheckedInt operator -() const
-    {
-      return detail::NegateImpl<T>::negate(*this);
-    }
+  template<typename U>
+  friend CheckedInt<U> operator *(const CheckedInt<U>& aLhs,
+                                  const CheckedInt<U>& aRhs);
+  template<typename U>
+  CheckedInt& operator *=(U aRhs);
 
-    /**
-     * @returns true if the left and right hand sides are valid
-     * and have the same value.
-     *
-     * Note that these semantics are the reason why we don't offer
-     * a operator!=. Indeed, we'd want to have a!=b be equivalent to !(a==b)
-     * but that would mean that whenever a or b is invalid, a!=b
-     * is always true, which would be very confusing.
-     *
-     * For similar reasons, operators <, >, <=, >= would be very tricky to
-     * specify, so we just avoid offering them.
-     *
-     * Notice that these == semantics are made more reasonable by these facts:
-     *  1. a==b implies equality at the raw data level
-     *     (the converse is false, as a==b is never true among invalids)
-     *  2. This is similar to the behavior of IEEE floats, where a==b
-     *     means that a and b have the same value *and* neither is NaN.
-     */
-    bool operator ==(const CheckedInt& other) const
-    {
-      return mIsValid && other.mIsValid && mValue == other.mValue;
-    }
+  template<typename U>
+  friend CheckedInt<U> operator /(const CheckedInt<U>& aLhs,
+                                  const CheckedInt<U>& aRhs);
+  template<typename U>
+  CheckedInt& operator /=(U aRhs);
+
+  template<typename U>
+  friend CheckedInt<U> operator %(const CheckedInt<U>& aLhs,
+                                  const CheckedInt<U>& aRhs);
+  template<typename U>
+  CheckedInt& operator %=(U aRhs);
+
+  CheckedInt operator -() const
+  {
+    return detail::NegateImpl<T>::negate(*this);
+  }
 
-    /** prefix ++ */
-    CheckedInt& operator++()
-    {
-      *this += 1;
-      return *this;
-    }
+  /**
+   * @returns true if the left and right hand sides are valid
+   * and have the same value.
+   *
+   * Note that these semantics are the reason why we don't offer
+   * a operator!=. Indeed, we'd want to have a!=b be equivalent to !(a==b)
+   * but that would mean that whenever a or b is invalid, a!=b
+   * is always true, which would be very confusing.
+   *
+   * For similar reasons, operators <, >, <=, >= would be very tricky to
+   * specify, so we just avoid offering them.
+   *
+   * Notice that these == semantics are made more reasonable by these facts:
+   *  1. a==b implies equality at the raw data level
+   *     (the converse is false, as a==b is never true among invalids)
+   *  2. This is similar to the behavior of IEEE floats, where a==b
+   *     means that a and b have the same value *and* neither is NaN.
+   */
+  bool operator ==(const CheckedInt& aOther) const
+  {
+    return mIsValid && aOther.mIsValid && mValue == aOther.mValue;
+  }
 
-    /** postfix ++ */
-    CheckedInt operator++(int)
-    {
-      CheckedInt tmp = *this;
-      *this += 1;
-      return tmp;
-    }
-
-    /** prefix -- */
-    CheckedInt& operator--()
-    {
-      *this -= 1;
-      return *this;
-    }
+  /** prefix ++ */
+  CheckedInt& operator++()
+  {
+    *this += 1;
+    return *this;
+  }
 
-    /** postfix -- */
-    CheckedInt operator--(int)
-    {
-      CheckedInt tmp = *this;
-      *this -= 1;
-      return tmp;
-    }
+  /** postfix ++ */
+  CheckedInt operator++(int)
+  {
+    CheckedInt tmp = *this;
+    *this += 1;
+    return tmp;
+  }
+
+  /** prefix -- */
+  CheckedInt& operator--()
+  {
+    *this -= 1;
+    return *this;
+  }
 
-  private:
-    /**
-     * The !=, <, <=, >, >= operators are disabled:
-     * see the comment on operator==.
-     */
-    template<typename U>
-    bool operator !=(U other) const MOZ_DELETE;
-    template<typename U>
-    bool operator <(U other) const MOZ_DELETE;
-    template<typename U>
-    bool operator <=(U other) const MOZ_DELETE;
-    template<typename U>
-    bool operator >(U other) const MOZ_DELETE;
-    template<typename U>
-    bool operator >=(U other) const MOZ_DELETE;
+  /** postfix -- */
+  CheckedInt operator--(int)
+  {
+    CheckedInt tmp = *this;
+    *this -= 1;
+    return tmp;
+  }
+
+private:
+  /**
+   * The !=, <, <=, >, >= operators are disabled:
+   * see the comment on operator==.
+   */
+  template<typename U> bool operator !=(U aOther) const MOZ_DELETE;
+  template<typename U> bool operator < (U aOther) const MOZ_DELETE;
+  template<typename U> bool operator <=(U aOther) const MOZ_DELETE;
+  template<typename U> bool operator > (U aOther) const MOZ_DELETE;
+  template<typename U> bool operator >=(U aOther) const MOZ_DELETE;
 };
 
-#define MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(NAME, OP)                \
-template<typename T>                                                  \
-inline CheckedInt<T> operator OP(const CheckedInt<T> &lhs,            \
-                                 const CheckedInt<T> &rhs)            \
-{                                                                     \
-  if (!detail::Is##NAME##Valid(lhs.mValue, rhs.mValue))               \
-    return CheckedInt<T>(0, false);                                   \
-                                                                      \
-  return CheckedInt<T>(lhs.mValue OP rhs.mValue,                      \
-                       lhs.mIsValid && rhs.mIsValid);                 \
-}
+#define MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(NAME, OP)                        \
+  template<typename T>                                                        \
+  inline CheckedInt<T>                                                        \
+  operator OP(const CheckedInt<T> &aLhs, const CheckedInt<T> &aRhs)           \
+  {                                                                           \
+    if (!detail::Is##NAME##Valid(aLhs.mValue, aRhs.mValue)) {                 \
+      return CheckedInt<T>(0, false);                                         \
+    }                                                                         \
+    return CheckedInt<T>(aLhs.mValue OP aRhs.mValue,                          \
+                         aLhs.mIsValid && aRhs.mIsValid);                     \
+  }
 
 MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Add, +)
 MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Sub, -)
 MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mul, *)
 MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Div, /)
 MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mod, %)
 
 #undef MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR
@@ -693,78 +695,78 @@ MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mod
 //  - if x is already a CheckedInt<T>, we just return a reference to it,
 //    instead of copying it (optimization)
 
 namespace detail {
 
 template<typename T, typename U>
 struct CastToCheckedIntImpl
 {
-    typedef CheckedInt<T> ReturnType;
-    static CheckedInt<T> run(U u) { return u; }
+  typedef CheckedInt<T> ReturnType;
+  static CheckedInt<T> run(U aU) { return aU; }
 };
 
 template<typename T>
 struct CastToCheckedIntImpl<T, CheckedInt<T> >
 {
-    typedef const CheckedInt<T>& ReturnType;
-    static const CheckedInt<T>& run(const CheckedInt<T>& u) { return u; }
+  typedef const CheckedInt<T>& ReturnType;
+  static const CheckedInt<T>& run(const CheckedInt<T>& aU) { return aU; }
 };
 
 } // namespace detail
 
 template<typename T, typename U>
 inline typename detail::CastToCheckedIntImpl<T, U>::ReturnType
-castToCheckedInt(U u)
+castToCheckedInt(U aU)
 {
   static_assert(detail::IsSupported<T>::value &&
                 detail::IsSupported<U>::value,
                 "This type is not supported by CheckedInt");
-  return detail::CastToCheckedIntImpl<T, U>::run(u);
+  return detail::CastToCheckedIntImpl<T, U>::run(aU);
 }
 
-#define MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(OP, COMPOUND_OP)  \
-template<typename T>                                              \
-template<typename U>                                              \
-CheckedInt<T>& CheckedInt<T>::operator COMPOUND_OP(U rhs)         \
-{                                                                 \
-  *this = *this OP castToCheckedInt<T>(rhs);                      \
-  return *this;                                                   \
-}                                                                 \
-template<typename T, typename U>                                  \
-inline CheckedInt<T> operator OP(const CheckedInt<T> &lhs, U rhs) \
-{                                                                 \
-  return lhs OP castToCheckedInt<T>(rhs);                         \
-}                                                                 \
-template<typename T, typename U>                                  \
-inline CheckedInt<T> operator OP(U lhs, const CheckedInt<T> &rhs) \
-{                                                                 \
-  return castToCheckedInt<T>(lhs) OP rhs;                         \
-}
+#define MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(OP, COMPOUND_OP)          \
+  template<typename T>                                                        \
+  template<typename U>                                                        \
+  CheckedInt<T>& CheckedInt<T>::operator COMPOUND_OP(U aRhs)                  \
+  {                                                                           \
+    *this = *this OP castToCheckedInt<T>(aRhs);                               \
+    return *this;                                                             \
+  }                                                                           \
+  template<typename T, typename U>                                            \
+  inline CheckedInt<T> operator OP(const CheckedInt<T> &aLhs, U aRhs)         \
+  {                                                                           \
+    return aLhs OP castToCheckedInt<T>(aRhs);                                 \
+  }                                                                           \
+  template<typename T, typename U>                                            \
+  inline CheckedInt<T> operator OP(U aLhs, const CheckedInt<T> &aRhs)         \
+  {                                                                           \
+    return castToCheckedInt<T>(aLhs) OP aRhs;                                 \
+  }
 
 MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(+, +=)
 MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(*, *=)
 MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(-, -=)
 MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(/, /=)
 MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(%, %=)
 
 #undef MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS
 
 template<typename T, typename U>
 inline bool
-operator ==(const CheckedInt<T> &lhs, U rhs)
+operator ==(const CheckedInt<T> &aLhs, U aRhs)
 {
-  return lhs == castToCheckedInt<T>(rhs);
+  return aLhs == castToCheckedInt<T>(aRhs);
 }
 
 template<typename T, typename U>
 inline bool
-operator ==(U  lhs, const CheckedInt<T> &rhs)
+operator ==(U aLhs, const CheckedInt<T> &aRhs)
 {
-  return castToCheckedInt<T>(lhs) == rhs;
+  return castToCheckedInt<T>(aLhs) == aRhs;
 }
 
 // Convenience typedefs.
 typedef CheckedInt<int8_t>   CheckedInt8;
 typedef CheckedInt<uint8_t>  CheckedUint8;
 typedef CheckedInt<int16_t>  CheckedInt16;
 typedef CheckedInt<uint16_t> CheckedUint16;
 typedef CheckedInt<int32_t>  CheckedInt32;
--- a/mfbt/Compression.cpp
+++ b/mfbt/Compression.cpp
@@ -1,64 +1,68 @@
+/* -*- Mode: C++; tab-width: 8; 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/Compression.h"
 #include "mozilla/CheckedInt.h"
+
 using namespace mozilla::Compression;
 
 namespace {
 
 #include "lz4.c"
 
 }/* anonymous namespace */
 
 /* Our wrappers */
 
 size_t
-LZ4::compress(const char* source, size_t inputSize, char* dest)
+LZ4::compress(const char* aSource, size_t aInputSize, char* aDest)
 {
-    CheckedInt<int> inputSizeChecked = inputSize;
-    MOZ_ASSERT(inputSizeChecked.isValid());
-    return LZ4_compress(source, dest, inputSizeChecked.value());
+  CheckedInt<int> inputSizeChecked = aInputSize;
+  MOZ_ASSERT(inputSizeChecked.isValid());
+  return LZ4_compress(aSource, aDest, inputSizeChecked.value());
 }
 
 size_t
-LZ4::compressLimitedOutput(const char* source, size_t inputSize, char* dest, size_t maxOutputSize)
+LZ4::compressLimitedOutput(const char* aSource, size_t aInputSize, char* aDest,
+                           size_t aMaxOutputSize)
 {
-    CheckedInt<int> inputSizeChecked = inputSize;
-    MOZ_ASSERT(inputSizeChecked.isValid());
-    CheckedInt<int> maxOutputSizeChecked = maxOutputSize;
-    MOZ_ASSERT(maxOutputSizeChecked.isValid());
-    return LZ4_compress_limitedOutput(source, dest, inputSizeChecked.value(),
-                                      maxOutputSizeChecked.value());
+  CheckedInt<int> inputSizeChecked = aInputSize;
+  MOZ_ASSERT(inputSizeChecked.isValid());
+  CheckedInt<int> maxOutputSizeChecked = aMaxOutputSize;
+  MOZ_ASSERT(maxOutputSizeChecked.isValid());
+  return LZ4_compress_limitedOutput(aSource, aDest, inputSizeChecked.value(),
+                                    maxOutputSizeChecked.value());
 }
 
 bool
-LZ4::decompress(const char* source, char* dest, size_t outputSize)
+LZ4::decompress(const char* aSource, char* aDest, size_t aOutputSize)
 {
-    CheckedInt<int> outputSizeChecked = outputSize;
-    MOZ_ASSERT(outputSizeChecked.isValid());
-    int ret = LZ4_decompress_fast(source, dest, outputSizeChecked.value());
-    return ret >= 0;
+  CheckedInt<int> outputSizeChecked = aOutputSize;
+  MOZ_ASSERT(outputSizeChecked.isValid());
+  int ret = LZ4_decompress_fast(aSource, aDest, outputSizeChecked.value());
+  return ret >= 0;
 }
 
 bool
-LZ4::decompress(const char* source, size_t inputSize, char* dest, size_t maxOutputSize,
-                size_t *outputSize)
+LZ4::decompress(const char* aSource, size_t aInputSize, char* aDest,
+                size_t aMaxOutputSize, size_t *aOutputSize)
 {
-    CheckedInt<int> maxOutputSizeChecked = maxOutputSize;
-    MOZ_ASSERT(maxOutputSizeChecked.isValid());
-    CheckedInt<int> inputSizeChecked = inputSize;
-    MOZ_ASSERT(inputSizeChecked.isValid());
+  CheckedInt<int> maxOutputSizeChecked = aMaxOutputSize;
+  MOZ_ASSERT(maxOutputSizeChecked.isValid());
+  CheckedInt<int> inputSizeChecked = aInputSize;
+  MOZ_ASSERT(inputSizeChecked.isValid());
 
-    int ret = LZ4_decompress_safe(source, dest, inputSizeChecked.value(),
-                                  maxOutputSizeChecked.value());
-    if (ret >= 0) {
-        *outputSize = ret;
-        return true;
-    } else {
-        *outputSize = 0;
-        return false;
-    }
+  int ret = LZ4_decompress_safe(aSource, aDest, inputSizeChecked.value(),
+                                maxOutputSizeChecked.value());
+  if (ret >= 0) {
+    *aOutputSize = ret;
+    return true;
+  }
+
+  *aOutputSize = 0;
+  return false;
 }
 
--- a/mfbt/Compression.h
+++ b/mfbt/Compression.h
@@ -1,9 +1,10 @@
-/* -*- 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 -*- */
+/* 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/. */
 
 /* Various simple compression/decompression functions. */
 
 #ifndef mozilla_Compression_h_
 #define mozilla_Compression_h_
@@ -17,100 +18,102 @@ namespace Compression {
 /**
  * LZ4 is a very fast byte-wise compression algorithm.
  *
  * Compared to Google's Snappy it is faster to compress and decompress and
  * generally produces output of about the same size.
  *
  * Compared to zlib it compresses at about 10x the speed, decompresses at about
  * 4x the speed and produces output of about 1.5x the size.
- *
  */
 
 class LZ4
 {
-
 public:
+  /**
+   * Compresses |aInputSize| bytes from |aSource| into |aDest|. Destination
+   * buffer must be already allocated, and must be sized to handle worst cases
+   * situations (input data not compressible). Worst case size evaluation is
+   * provided by function maxCompressedSize()
+   *
+   * @param aInputSize is the input size. Max supported value is ~1.9GB
+   * @return the number of bytes written in buffer |aDest|
+   */
+  static MFBT_API size_t
+  compress(const char* aSource, size_t aInputSize, char* aDest);
 
   /**
-   * Compresses 'inputSize' bytes from 'source' into 'dest'.
-   * Destination buffer must be already allocated,
-   * and must be sized to handle worst cases situations (input data not compressible)
-   * Worst case size evaluation is provided by function maxCompressedSize()
-   *
-   * @param inputSize is the input size. Max supported value is ~1.9GB
-   * @param return the number of bytes written in buffer dest
-   */
-  static MFBT_API size_t compress(const char* source, size_t inputSize, char* dest);
-
-  /**
-   * Compress 'inputSize' bytes from 'source' into an output buffer
-   * 'dest' of maximum size 'maxOutputSize'.  If it cannot achieve it,
+   * Compress |aInputSize| bytes from |aSource| into an output buffer
+   * |aDest| of maximum size |aMaxOutputSize|.  If it cannot achieve it,
    * compression will stop, and result of the function will be zero,
-   * 'dest' will still be written to, but since the number of input
+   * |aDest| will still be written to, but since the number of input
    * bytes consumed is not returned the result is not usable.
    *
    * This function never writes outside of provided output buffer.
    *
-   * @param inputSize is the input size. Max supported value is ~1.9GB
-   * @param maxOutputSize is the size of the destination buffer (which must be already allocated)
-   * @return the number of bytes written in buffer 'dest'
-             or 0 if the compression fails
-  */
-  static MFBT_API size_t compressLimitedOutput(const char* source, size_t inputSize, char* dest,
-                                               size_t maxOutputSize);
+   * @param aInputSize is the input size. Max supported value is ~1.9GB
+   * @param aMaxOutputSize is the size of the destination buffer (which must
+   *   be already allocated)
+   * @return the number of bytes written in buffer |aDest| or 0 if the
+   *   compression fails
+   */
+  static MFBT_API size_t
+  compressLimitedOutput(const char* aSource, size_t aInputSize, char* aDest,
+                        size_t aMaxOutputSize);
 
   /**
    * If the source stream is malformed, the function will stop decoding
    * and return a negative result, indicating the byte position of the
    * faulty instruction
    *
    * This function never writes outside of provided buffers, and never
    * modifies input buffer.
    *
-   * note : destination buffer must be already allocated.
-   *        its size must be a minimum of 'outputSize' bytes.
-   * @param outputSize is the output size, therefore the original size
+   * Note: destination buffer must be already allocated, and its size must be a
+   *       minimum of |aOutputSize| bytes.
+   *
+   * @param aOutputSize is the output size, therefore the original size
    * @return the number of bytes read in the source buffer
-  */
-  static MFBT_API bool decompress(const char* source, char* dest, size_t outputSize);
+   */
+  static MFBT_API bool
+  decompress(const char* aSource, char* aDest, size_t aOutputSize);
 
   /**
    * If the source stream is malformed, the function will stop decoding
    * and return false.
    *
-   * This function never writes beyond dest + maxOutputSize, and is
+   * This function never writes beyond aDest + aMaxOutputSize, and is
    * therefore protected against malicious data packets.
    *
-   * note   : Destination buffer must be already allocated.
-   *          This version is slightly slower than the decompress
-   *          without the maxOutputSize
+   * Note: Destination buffer must be already allocated.  This version is
+   *       slightly slower than the decompress without the aMaxOutputSize.
    *
-   * @param inputSize is the length of the input compressed data
-   * @param maxOutputSize is the size of the destination buffer (which must be already allocated)
-   * @param outputSize the actual number of bytes decoded in the destination buffer (necessarily <= maxOutputSize)
-
-  */
-  static MFBT_API bool decompress(const char* source, size_t inputSize, char* dest,
-                                  size_t maxOutputSize, size_t *outputSize);
+   * @param aInputSize is the length of the input compressed data
+   * @param aMaxOutputSize is the size of the destination buffer (which must be
+   *   already allocated)
+   * @param aOutputSize the actual number of bytes decoded in the destination
+   *   buffer (necessarily <= aMaxOutputSize)
+   */
+  static MFBT_API bool
+  decompress(const char* aSource, size_t aInputSize, char* aDest,
+             size_t aMaxOutputSize, size_t *aOutputSize);
 
   /*
-    Provides the maximum size that LZ4 may output in a "worst case"
-    scenario (input data not compressible) primarily useful for memory
-    allocation of output buffer.
-    note : this function is limited by "int" range (2^31-1)
-
-    @param inputSize is the input size. Max supported value is ~1.9GB
-    @return maximum output size in a "worst case" scenario
-  */
-  static inline size_t maxCompressedSize(size_t inputSize)
+   * Provides the maximum size that LZ4 may output in a "worst case"
+   * scenario (input data not compressible) primarily useful for memory
+   * allocation of output buffer.
+   * note : this function is limited by "int" range (2^31-1)
+   *
+   * @param aInputSize is the input size. Max supported value is ~1.9GB
+   * @return maximum output size in a "worst case" scenario
+   */
+  static inline size_t maxCompressedSize(size_t aInputSize)
   {
-      size_t max = ((inputSize) + ((inputSize)/255) + 16);
-      MOZ_ASSERT(max > inputSize);
-      return max;
+    size_t max = (aInputSize + (aInputSize / 255) + 16);
+    MOZ_ASSERT(max > aInputSize);
+    return max;
   }
-
 };
 
 } /* namespace Compression */
 } /* namespace mozilla */
 
 #endif /* mozilla_Compression_h_ */
--- a/mfbt/DebugOnly.h
+++ b/mfbt/DebugOnly.h
@@ -29,54 +29,51 @@ namespace mozilla {
  * builds they don't have a value, so type coercion is not well defined.
  *
  * Note that DebugOnly instances still take up one byte of space, plus padding,
  * when used as members of structs.
  */
 template<typename T>
 class DebugOnly
 {
-  public:
+public:
 #ifdef DEBUG
-    T value;
+  T value;
 
-    DebugOnly() { }
-    DebugOnly(const T& other) : value(other) { }
-    DebugOnly(const DebugOnly& other) : value(other.value) { }
-    DebugOnly& operator=(const T& rhs) {
-      value = rhs;
-      return *this;
-    }
-    void operator++(int) {
-      value++;
-    }
-    void operator--(int) {
-      value--;
-    }
+  DebugOnly() { }
+  DebugOnly(const T& aOther) : value(aOther) { }
+  DebugOnly(const DebugOnly& aOther) : value(aOther.value) { }
+  DebugOnly& operator=(const T& aRhs) {
+    value = aRhs;
+    return *this;
+  }
 
-    T* operator&() { return &value; }
+  void operator++(int) { value++; }
+  void operator--(int) { value--; }
+
+  T* operator&() { return &value; }
 
-    operator T&() { return value; }
-    operator const T&() const { return value; }
+  operator T&() { return value; }
+  operator const T&() const { return value; }
 
-    T& operator->() { return value; }
-    const T& operator->() const { return value; }
+  T& operator->() { return value; }
+  const T& operator->() const { return value; }
 
 #else
-    DebugOnly() { }
-    DebugOnly(const T&) { }
-    DebugOnly(const DebugOnly&) { }
-    DebugOnly& operator=(const T&) { return *this; }
-    void operator++(int) { }
-    void operator--(int) { }
+  DebugOnly() { }
+  DebugOnly(const T&) { }
+  DebugOnly(const DebugOnly&) { }
+  DebugOnly& operator=(const T&) { return *this; }
+  void operator++(int) { }
+  void operator--(int) { }
 #endif
 
-    /*
-     * DebugOnly must always have a destructor or else it will
-     * generate "unused variable" warnings, exactly what it's intended
-     * to avoid!
-     */
-    ~DebugOnly() {}
+  /*
+   * DebugOnly must always have a destructor or else it will
+   * generate "unused variable" warnings, exactly what it's intended
+   * to avoid!
+   */
+  ~DebugOnly() {}
 };
 
 }
 
 #endif /* mozilla_DebugOnly_h */