Bug 1273190, part 1 - Fix indentation and mode lines for various xpcom/ files. r=froydnj
authorAndrew McCreight <continuation@gmail.com>
Tue, 24 May 2016 14:45:44 -0700
changeset 337829 ecd5857dc829b186767d2a3f33df3b577cb6c6e4
parent 337828 2f3fc8f9ec43faf0c41be3a55d51f9d604be0e0d
child 337830 9dd2d692865b186be66985995ba4b0f4d8182ba3
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1273190
milestone49.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 1273190, part 1 - Fix indentation and mode lines for various xpcom/ files. r=froydnj
xpcom/components/ModuleUtils.h
xpcom/glue/tests/gtest/TestFileUtils.cpp
xpcom/tests/gtest/TestSynchronization.cpp
xpcom/tests/gtest/TestTimeStamp.cpp
xpcom/tests/gtest/TestXPIDLString.cpp
xpcom/windbgdlg/windbgdlg.cpp
--- a/xpcom/components/ModuleUtils.h
+++ b/xpcom/components/ModuleUtils.h
@@ -1,77 +1,78 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- 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/. */
 
 #ifndef mozilla_GenericModule_h
 #define mozilla_GenericModule_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/Module.h"
 
 #define NS_GENERIC_FACTORY_CONSTRUCTOR(_InstanceClass)                        \
 static nsresult                                                               \
 _InstanceClass##Constructor(nsISupports *aOuter, REFNSIID aIID,               \
                             void **aResult)                                   \
 {                                                                             \
-    RefPtr<_InstanceClass> inst;                                            \
+  RefPtr<_InstanceClass> inst;                                                \
                                                                               \
-    *aResult = nullptr;                                                       \
-    if (nullptr != aOuter) {                                                  \
-        return NS_ERROR_NO_AGGREGATION;                                       \
-    }                                                                         \
+  *aResult = nullptr;                                                         \
+  if (nullptr != aOuter) {                                                    \
+    return NS_ERROR_NO_AGGREGATION;                                           \
+  }                                                                           \
                                                                               \
-    inst = new _InstanceClass();                                              \
-    return inst->QueryInterface(aIID, aResult);                               \
+  inst = new _InstanceClass();                                                \
+  return inst->QueryInterface(aIID, aResult);                                 \
 }
 
 #define NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(_InstanceClass, _InitMethod)      \
 static nsresult                                                               \
 _InstanceClass##Constructor(nsISupports *aOuter, REFNSIID aIID,               \
                             void **aResult)                                   \
 {                                                                             \
-    nsresult rv;                                                              \
+  nsresult rv;                                                                \
                                                                               \
-    RefPtr<_InstanceClass> inst;                                            \
+  RefPtr<_InstanceClass> inst;                                                \
                                                                               \
-    *aResult = nullptr;                                                       \
-    if (nullptr != aOuter) {                                                  \
-        return NS_ERROR_NO_AGGREGATION;                                       \
-    }                                                                         \
+  *aResult = nullptr;                                                         \
+  if (nullptr != aOuter) {                                                    \
+    return NS_ERROR_NO_AGGREGATION;                                           \
+  }                                                                           \
                                                                               \
-    inst = new _InstanceClass();                                              \
-    rv = inst->_InitMethod();                                                 \
-    if(NS_SUCCEEDED(rv)) {                                                    \
-        rv = inst->QueryInterface(aIID, aResult);                             \
-    }                                                                         \
+  inst = new _InstanceClass();                                                \
+  rv = inst->_InitMethod();                                                   \
+  if (NS_SUCCEEDED(rv)) {                                                     \
+    rv = inst->QueryInterface(aIID, aResult);                                 \
+  }                                                                           \
                                                                               \
-    return rv;                                                                \
+  return rv;                                                                  \
 }
 
 // 'Constructor' that uses an existing getter function that gets a singleton.
 // NOTE: assumes that getter does an AddRef - so additional AddRef is not done.
 #define NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(_InstanceClass, _GetterProc) \
 static nsresult                                                               \
 _InstanceClass##Constructor(nsISupports *aOuter, REFNSIID aIID,               \
                             void **aResult)                                   \
 {                                                                             \
-    RefPtr<_InstanceClass> inst;                                            \
+  RefPtr<_InstanceClass> inst;                                                \
                                                                               \
-    *aResult = nullptr;                                                       \
-    if (nullptr != aOuter) {                                                  \
-        return NS_ERROR_NO_AGGREGATION;                                       \
-    }                                                                         \
+  *aResult = nullptr;                                                         \
+  if (nullptr != aOuter) {                                                    \
+    return NS_ERROR_NO_AGGREGATION;                                           \
+  }                                                                           \
                                                                               \
-    inst = already_AddRefed<_InstanceClass>(_GetterProc());                   \
-    if (nullptr == inst) {                                                    \
-        return NS_ERROR_OUT_OF_MEMORY;                                        \
-    }                                                                         \
-    return inst->QueryInterface(aIID, aResult);                               \
+  inst = already_AddRefed<_InstanceClass>(_GetterProc());                     \
+  if (nullptr == inst) {                                                      \
+    return NS_ERROR_OUT_OF_MEMORY;                                            \
+  }                                                                           \
+  return inst->QueryInterface(aIID, aResult);                                 \
 }
 
 #ifndef MOZILLA_INTERNAL_API
 
 #include "nsIModule.h"
 #include "nsISupportsUtils.h"
 
 namespace mozilla {
--- a/xpcom/glue/tests/gtest/TestFileUtils.cpp
+++ b/xpcom/glue/tests/gtest/TestFileUtils.cpp
@@ -1,9 +1,10 @@
-/* vim:set ts=2 sw=2 sts=2 et: */
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* Test ReadSysFile() */
 
 #include <sys/types.h>
 #include <sys/stat.h>
--- a/xpcom/tests/gtest/TestSynchronization.cpp
+++ b/xpcom/tests/gtest/TestSynchronization.cpp
@@ -1,313 +1,313 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: sw=4 ts=4 et :
- * This Source Code Form is subject to the terms of the Mozilla Public
+/* -*- 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/CondVar.h"
 #include "mozilla/Monitor.h"
 #include "mozilla/ReentrantMonitor.h"
 #include "mozilla/Mutex.h"
 #include "gtest/gtest.h"
 
 using namespace mozilla;
 
 static PRThread*
 spawn(void (*run)(void*), void* arg)
 {
-    return PR_CreateThread(PR_SYSTEM_THREAD,
-                           run,
-                           arg,
-                           PR_PRIORITY_NORMAL,
-                           PR_GLOBAL_THREAD,
-                           PR_JOINABLE_THREAD,
-                           0);
+  return PR_CreateThread(PR_SYSTEM_THREAD,
+                         run,
+                         arg,
+                         PR_PRIORITY_NORMAL,
+                         PR_GLOBAL_THREAD,
+                         PR_JOINABLE_THREAD,
+                         0);
 }
 
 //-----------------------------------------------------------------------------
 // Sanity check: tests that can be done on a single thread
 //
 TEST(Synchronization, Sanity)
 {
-    Mutex lock("sanity::lock");
-    lock.Lock();
-    lock.AssertCurrentThreadOwns();
-    lock.Unlock();
+  Mutex lock("sanity::lock");
+  lock.Lock();
+  lock.AssertCurrentThreadOwns();
+  lock.Unlock();
 
-    {
-        MutexAutoLock autolock(lock);
-        lock.AssertCurrentThreadOwns();
-    }
-
-    lock.Lock();
-    lock.AssertCurrentThreadOwns();
-    {
-        MutexAutoUnlock autounlock(lock);
-    }
+  {
+    MutexAutoLock autolock(lock);
     lock.AssertCurrentThreadOwns();
-    lock.Unlock();
+  }
+
+  lock.Lock();
+  lock.AssertCurrentThreadOwns();
+  {
+    MutexAutoUnlock autounlock(lock);
+  }
+  lock.AssertCurrentThreadOwns();
+  lock.Unlock();
 
-    ReentrantMonitor mon("sanity::monitor");
-    mon.Enter();
-    mon.AssertCurrentThreadIn();
-    mon.Enter();
+  ReentrantMonitor mon("sanity::monitor");
+  mon.Enter();
+  mon.AssertCurrentThreadIn();
+  mon.Enter();
+  mon.AssertCurrentThreadIn();
+  mon.Exit();
+  mon.AssertCurrentThreadIn();
+  mon.Exit();
+
+  {
+    ReentrantMonitorAutoEnter automon(mon);
     mon.AssertCurrentThreadIn();
-    mon.Exit();
-    mon.AssertCurrentThreadIn();
-    mon.Exit();
-
-    {
-        ReentrantMonitorAutoEnter automon(mon);
-        mon.AssertCurrentThreadIn();
-    }
+  }
 }
 
 //-----------------------------------------------------------------------------
 // Mutex contention tests
 //
 static Mutex* gLock1;
 
 static void
 MutexContention_thread(void* /*arg*/)
 {
-    for (int i = 0; i < 100000; ++i) {
-        gLock1->Lock();
-        gLock1->AssertCurrentThreadOwns();
-        gLock1->Unlock();
-    }
+  for (int i = 0; i < 100000; ++i) {
+    gLock1->Lock();
+    gLock1->AssertCurrentThreadOwns();
+    gLock1->Unlock();
+  }
 }
 
 TEST(Synchronization, MutexContention)
 {
-    gLock1 = new Mutex("lock1");
-    // PURPOSELY not checking for OOM.  YAY!
+  gLock1 = new Mutex("lock1");
+  // PURPOSELY not checking for OOM.  YAY!
 
-    PRThread* t1 = spawn(MutexContention_thread, nullptr);
-    PRThread* t2 = spawn(MutexContention_thread, nullptr);
-    PRThread* t3 = spawn(MutexContention_thread, nullptr);
+  PRThread* t1 = spawn(MutexContention_thread, nullptr);
+  PRThread* t2 = spawn(MutexContention_thread, nullptr);
+  PRThread* t3 = spawn(MutexContention_thread, nullptr);
 
-    PR_JoinThread(t1);
-    PR_JoinThread(t2);
-    PR_JoinThread(t3);
+  PR_JoinThread(t1);
+  PR_JoinThread(t2);
+  PR_JoinThread(t3);
 
-    delete gLock1;
+  delete gLock1;
 }
 
 //-----------------------------------------------------------------------------
 // Monitor tests
 //
 static Monitor* gMon1;
 
 static void
 MonitorContention_thread(void* /*arg*/)
 {
-    for (int i = 0; i < 100000; ++i) {
-        gMon1->Lock();
-        gMon1->AssertCurrentThreadOwns();
-        gMon1->Unlock();
-    }
+  for (int i = 0; i < 100000; ++i) {
+    gMon1->Lock();
+    gMon1->AssertCurrentThreadOwns();
+    gMon1->Unlock();
+  }
 }
 
 TEST(Synchronization, MonitorContention)
 {
-    gMon1 = new Monitor("mon1");
+  gMon1 = new Monitor("mon1");
 
-    PRThread* t1 = spawn(MonitorContention_thread, nullptr);
-    PRThread* t2 = spawn(MonitorContention_thread, nullptr);
-    PRThread* t3 = spawn(MonitorContention_thread, nullptr);
+  PRThread* t1 = spawn(MonitorContention_thread, nullptr);
+  PRThread* t2 = spawn(MonitorContention_thread, nullptr);
+  PRThread* t3 = spawn(MonitorContention_thread, nullptr);
 
-    PR_JoinThread(t1);
-    PR_JoinThread(t2);
-    PR_JoinThread(t3);
+  PR_JoinThread(t1);
+  PR_JoinThread(t2);
+  PR_JoinThread(t3);
 
-    delete gMon1;
+  delete gMon1;
 }
 
 
 static ReentrantMonitor* gMon2;
 
 static void
 MonitorContention2_thread(void* /*arg*/)
 {
-    for (int i = 0; i < 100000; ++i) {
-        gMon2->Enter();
-        gMon2->AssertCurrentThreadIn();
-        {
-            gMon2->Enter();
-            gMon2->AssertCurrentThreadIn();
-            gMon2->Exit();
-        }
-        gMon2->AssertCurrentThreadIn();
-        gMon2->Exit();
+  for (int i = 0; i < 100000; ++i) {
+    gMon2->Enter();
+    gMon2->AssertCurrentThreadIn();
+    {
+      gMon2->Enter();
+      gMon2->AssertCurrentThreadIn();
+      gMon2->Exit();
     }
+    gMon2->AssertCurrentThreadIn();
+    gMon2->Exit();
+  }
 }
 
 TEST(Synchronization, MonitorContention2)
 {
-    gMon2 = new ReentrantMonitor("mon1");
+  gMon2 = new ReentrantMonitor("mon1");
 
-    PRThread* t1 = spawn(MonitorContention2_thread, nullptr);
-    PRThread* t2 = spawn(MonitorContention2_thread, nullptr);
-    PRThread* t3 = spawn(MonitorContention2_thread, nullptr);
+  PRThread* t1 = spawn(MonitorContention2_thread, nullptr);
+  PRThread* t2 = spawn(MonitorContention2_thread, nullptr);
+  PRThread* t3 = spawn(MonitorContention2_thread, nullptr);
 
-    PR_JoinThread(t1);
-    PR_JoinThread(t2);
-    PR_JoinThread(t3);
+  PR_JoinThread(t1);
+  PR_JoinThread(t2);
+  PR_JoinThread(t3);
 
-    delete gMon2;
+  delete gMon2;
 }
 
 
 static ReentrantMonitor* gMon3;
 static int32_t gMonFirst;
 
 static void
 MonitorSyncSanity_thread(void* /*arg*/)
 {
+  gMon3->Enter();
+  gMon3->AssertCurrentThreadIn();
+  if (gMonFirst) {
+    gMonFirst = 0;
+    gMon3->Wait();
     gMon3->Enter();
-    gMon3->AssertCurrentThreadIn();
-    if (gMonFirst) {
-        gMonFirst = 0;
-        gMon3->Wait();
-        gMon3->Enter();
-    } else {
-        gMon3->Notify();
-        gMon3->Enter();
-    }
-    gMon3->AssertCurrentThreadIn();
-    gMon3->Exit();
-    gMon3->AssertCurrentThreadIn();
-    gMon3->Exit();
+  } else {
+    gMon3->Notify();
+    gMon3->Enter();
+  }
+  gMon3->AssertCurrentThreadIn();
+  gMon3->Exit();
+  gMon3->AssertCurrentThreadIn();
+  gMon3->Exit();
 }
 
 TEST(Synchronization, MonitorSyncSanity)
 {
-    gMon3 = new ReentrantMonitor("monitor::syncsanity");
+  gMon3 = new ReentrantMonitor("monitor::syncsanity");
 
-    for (int32_t i = 0; i < 10000; ++i) {
-        gMonFirst = 1;
-        PRThread* ping = spawn(MonitorSyncSanity_thread, nullptr);
-        PRThread* pong = spawn(MonitorSyncSanity_thread, nullptr);
-        PR_JoinThread(ping);
-        PR_JoinThread(pong);
-    }
+  for (int32_t i = 0; i < 10000; ++i) {
+    gMonFirst = 1;
+    PRThread* ping = spawn(MonitorSyncSanity_thread, nullptr);
+    PRThread* pong = spawn(MonitorSyncSanity_thread, nullptr);
+    PR_JoinThread(ping);
+    PR_JoinThread(pong);
+  }
 
-    delete gMon3;
+  delete gMon3;
 }
 
 //-----------------------------------------------------------------------------
 // Condvar tests
 //
 static Mutex* gCvlock1;
 static CondVar* gCv1;
 static int32_t gCvFirst;
 
 static void
 CondVarSanity_thread(void* /*arg*/)
 {
-    gCvlock1->Lock();
-    gCvlock1->AssertCurrentThreadOwns();
-    if (gCvFirst) {
-        gCvFirst = 0;
-        gCv1->Wait();
-    } else {
-        gCv1->Notify();
-    }
-    gCvlock1->AssertCurrentThreadOwns();
-    gCvlock1->Unlock();
+  gCvlock1->Lock();
+  gCvlock1->AssertCurrentThreadOwns();
+  if (gCvFirst) {
+    gCvFirst = 0;
+    gCv1->Wait();
+  } else {
+    gCv1->Notify();
+  }
+  gCvlock1->AssertCurrentThreadOwns();
+  gCvlock1->Unlock();
 }
 
 TEST(Synchronization, CondVarSanity)
 {
-    gCvlock1 = new Mutex("cvlock1");
-    gCv1 = new CondVar(*gCvlock1, "cvlock1");
+  gCvlock1 = new Mutex("cvlock1");
+  gCv1 = new CondVar(*gCvlock1, "cvlock1");
 
-    for (int32_t i = 0; i < 10000; ++i) {
-        gCvFirst = 1;
-        PRThread* ping = spawn(CondVarSanity_thread, nullptr);
-        PRThread* pong = spawn(CondVarSanity_thread, nullptr);
-        PR_JoinThread(ping);
-        PR_JoinThread(pong);
-    }
+  for (int32_t i = 0; i < 10000; ++i) {
+    gCvFirst = 1;
+    PRThread* ping = spawn(CondVarSanity_thread, nullptr);
+    PRThread* pong = spawn(CondVarSanity_thread, nullptr);
+    PR_JoinThread(ping);
+    PR_JoinThread(pong);
+  }
 
-    delete gCv1;
-    delete gCvlock1;
+  delete gCv1;
+  delete gCvlock1;
 }
 
 //-----------------------------------------------------------------------------
 // AutoLock tests
 //
 TEST(Synchronization, AutoLock)
 {
-    Mutex l1("autolock");
-    MutexAutoLock autol1(l1);
+  Mutex l1("autolock");
+  MutexAutoLock autol1(l1);
+
+  l1.AssertCurrentThreadOwns();
+
+  {
+    Mutex l2("autolock2");
+    MutexAutoLock autol2(l2);
 
     l1.AssertCurrentThreadOwns();
-
-    {
-        Mutex l2("autolock2");
-        MutexAutoLock autol2(l2);
+    l2.AssertCurrentThreadOwns();
+  }
 
-        l1.AssertCurrentThreadOwns();
-        l2.AssertCurrentThreadOwns();
-    }
-
-    l1.AssertCurrentThreadOwns();
+  l1.AssertCurrentThreadOwns();
 }
 
 //-----------------------------------------------------------------------------
 // AutoUnlock tests
 //
 TEST(Synchronization, AutoUnlock)
 {
-    Mutex l1("autounlock");
-    Mutex l2("autounlock2");
+  Mutex l1("autounlock");
+  Mutex l2("autounlock2");
 
-    l1.Lock();
-    l1.AssertCurrentThreadOwns();
+  l1.Lock();
+  l1.AssertCurrentThreadOwns();
 
+  {
+    MutexAutoUnlock autol1(l1);
     {
-        MutexAutoUnlock autol1(l1);
-        {
-            l2.Lock();
-            l2.AssertCurrentThreadOwns();
+      l2.Lock();
+      l2.AssertCurrentThreadOwns();
 
-            MutexAutoUnlock autol2(l2);
-        }
-        l2.AssertCurrentThreadOwns();
-        l2.Unlock();
+      MutexAutoUnlock autol2(l2);
     }
-    l1.AssertCurrentThreadOwns();
+    l2.AssertCurrentThreadOwns();
+    l2.Unlock();
+  }
+  l1.AssertCurrentThreadOwns();
 
-    l1.Unlock();
+  l1.Unlock();
 }
 
 //-----------------------------------------------------------------------------
 // AutoMonitor tests
 //
 TEST(Synchronization, AutoMonitor)
 {
-    ReentrantMonitor m1("automonitor");
-    ReentrantMonitor m2("automonitor2");
+  ReentrantMonitor m1("automonitor");
+  ReentrantMonitor m2("automonitor2");
 
-    m1.Enter();
+  m1.Enter();
+  m1.AssertCurrentThreadIn();
+  {
+    ReentrantMonitorAutoEnter autom1(m1);
     m1.AssertCurrentThreadIn();
-    {
-        ReentrantMonitorAutoEnter autom1(m1);
-        m1.AssertCurrentThreadIn();
 
-        m2.Enter();
-        m2.AssertCurrentThreadIn();
-        {
-            ReentrantMonitorAutoEnter autom2(m2);
-            m1.AssertCurrentThreadIn();
-            m2.AssertCurrentThreadIn();
-        }
-        m2.AssertCurrentThreadIn();
-        m2.Exit();
+    m2.Enter();
+    m2.AssertCurrentThreadIn();
+    {
+      ReentrantMonitorAutoEnter autom2(m2);
+      m1.AssertCurrentThreadIn();
+      m2.AssertCurrentThreadIn();
+    }
+    m2.AssertCurrentThreadIn();
+    m2.Exit();
 
-        m1.AssertCurrentThreadIn();
-    }
     m1.AssertCurrentThreadIn();
-    m1.Exit();
+  }
+  m1.AssertCurrentThreadIn();
+  m1.Exit();
 }
--- a/xpcom/tests/gtest/TestTimeStamp.cpp
+++ b/xpcom/tests/gtest/TestTimeStamp.cpp
@@ -1,69 +1,70 @@
-/* -*- 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/. */
 
 #include "mozilla/TimeStamp.h"
 
 #include "prinrval.h"
 #include "prthread.h"
 
 #include "gtest/gtest.h"
 
 using mozilla::TimeStamp;
 using mozilla::TimeDuration;
 
 TEST(TimeStamp, Main)
 {
-    TimeDuration td;
-    EXPECT_TRUE(td.ToSeconds() == 0.0);
-    EXPECT_TRUE(TimeDuration::FromSeconds(5).ToSeconds() == 5.0);
-    EXPECT_TRUE(TimeDuration::FromMilliseconds(5000).ToSeconds() == 5.0);
-    EXPECT_TRUE(TimeDuration::FromSeconds(1) < TimeDuration::FromSeconds(2));
-    EXPECT_FALSE(TimeDuration::FromSeconds(1) < TimeDuration::FromSeconds(1));
-    EXPECT_TRUE(TimeDuration::FromSeconds(2) > TimeDuration::FromSeconds(1));
-    EXPECT_FALSE(TimeDuration::FromSeconds(1) > TimeDuration::FromSeconds(1));
-    EXPECT_TRUE(TimeDuration::FromSeconds(1) <= TimeDuration::FromSeconds(2));
-    EXPECT_TRUE(TimeDuration::FromSeconds(1) <= TimeDuration::FromSeconds(1));
-    EXPECT_FALSE(TimeDuration::FromSeconds(2) <= TimeDuration::FromSeconds(1));
-    EXPECT_TRUE(TimeDuration::FromSeconds(2) >= TimeDuration::FromSeconds(1));
-    EXPECT_TRUE(TimeDuration::FromSeconds(1) >= TimeDuration::FromSeconds(1));
-    EXPECT_FALSE(TimeDuration::FromSeconds(1) >= TimeDuration::FromSeconds(2));
+  TimeDuration td;
+  EXPECT_TRUE(td.ToSeconds() == 0.0);
+  EXPECT_TRUE(TimeDuration::FromSeconds(5).ToSeconds() == 5.0);
+  EXPECT_TRUE(TimeDuration::FromMilliseconds(5000).ToSeconds() == 5.0);
+  EXPECT_TRUE(TimeDuration::FromSeconds(1) < TimeDuration::FromSeconds(2));
+  EXPECT_FALSE(TimeDuration::FromSeconds(1) < TimeDuration::FromSeconds(1));
+  EXPECT_TRUE(TimeDuration::FromSeconds(2) > TimeDuration::FromSeconds(1));
+  EXPECT_FALSE(TimeDuration::FromSeconds(1) > TimeDuration::FromSeconds(1));
+  EXPECT_TRUE(TimeDuration::FromSeconds(1) <= TimeDuration::FromSeconds(2));
+  EXPECT_TRUE(TimeDuration::FromSeconds(1) <= TimeDuration::FromSeconds(1));
+  EXPECT_FALSE(TimeDuration::FromSeconds(2) <= TimeDuration::FromSeconds(1));
+  EXPECT_TRUE(TimeDuration::FromSeconds(2) >= TimeDuration::FromSeconds(1));
+  EXPECT_TRUE(TimeDuration::FromSeconds(1) >= TimeDuration::FromSeconds(1));
+  EXPECT_FALSE(TimeDuration::FromSeconds(1) >= TimeDuration::FromSeconds(2));
 
-    TimeStamp ts;
-    EXPECT_TRUE(ts.IsNull());
+  TimeStamp ts;
+  EXPECT_TRUE(ts.IsNull());
 
-    ts = TimeStamp::Now();
-    EXPECT_TRUE(!ts.IsNull());
-    EXPECT_TRUE((ts - ts).ToSeconds() == 0.0);
+  ts = TimeStamp::Now();
+  EXPECT_TRUE(!ts.IsNull());
+  EXPECT_TRUE((ts - ts).ToSeconds() == 0.0);
 
-    PR_Sleep(PR_SecondsToInterval(2));
+  PR_Sleep(PR_SecondsToInterval(2));
 
-    TimeStamp ts2(TimeStamp::Now());
-    EXPECT_TRUE(ts2 > ts);
-    EXPECT_FALSE(ts > ts);
-    EXPECT_TRUE(ts < ts2);
-    EXPECT_FALSE(ts < ts);
-    EXPECT_TRUE(ts <= ts2);
-    EXPECT_TRUE(ts <= ts);
-    EXPECT_FALSE(ts2 <= ts);
-    EXPECT_TRUE(ts2 >= ts);
-    EXPECT_TRUE(ts2 >= ts);
-    EXPECT_FALSE(ts >= ts2);
+  TimeStamp ts2(TimeStamp::Now());
+  EXPECT_TRUE(ts2 > ts);
+  EXPECT_FALSE(ts > ts);
+  EXPECT_TRUE(ts < ts2);
+  EXPECT_FALSE(ts < ts);
+  EXPECT_TRUE(ts <= ts2);
+  EXPECT_TRUE(ts <= ts);
+  EXPECT_FALSE(ts2 <= ts);
+  EXPECT_TRUE(ts2 >= ts);
+  EXPECT_TRUE(ts2 >= ts);
+  EXPECT_FALSE(ts >= ts2);
 
-    // We can't be sure exactly how long PR_Sleep slept for. It should have
-    // slept for at least one second. We might have slept a lot longer due
-    // to process scheduling, but hopefully not more than 10 seconds.
-    td = ts2 - ts;
-    EXPECT_TRUE(td.ToSeconds() > 1.0);
-    EXPECT_TRUE(td.ToSeconds() < 20.0);
-    td = ts - ts2;
-    EXPECT_TRUE(td.ToSeconds() < -1.0);
-    EXPECT_TRUE(td.ToSeconds() > -20.0);
+  // We can't be sure exactly how long PR_Sleep slept for. It should have
+  // slept for at least one second. We might have slept a lot longer due
+  // to process scheduling, but hopefully not more than 10 seconds.
+  td = ts2 - ts;
+  EXPECT_TRUE(td.ToSeconds() > 1.0);
+  EXPECT_TRUE(td.ToSeconds() < 20.0);
+  td = ts - ts2;
+  EXPECT_TRUE(td.ToSeconds() < -1.0);
+  EXPECT_TRUE(td.ToSeconds() > -20.0);
 
-    double resolution = TimeDuration::Resolution().ToSecondsSigDigits();
-    printf(" (platform timer resolution is ~%g s)\n", resolution);
-    EXPECT_TRUE(1e-10 < resolution);
-    // Don't upper-bound sanity check ... although NSPR reports 1ms
-    // resolution, it might be lying, so we shouldn't compare with it
+  double resolution = TimeDuration::Resolution().ToSecondsSigDigits();
+  printf(" (platform timer resolution is ~%g s)\n", resolution);
+  EXPECT_TRUE(1e-10 < resolution);
+  // Don't upper-bound sanity check ... although NSPR reports 1ms
+  // resolution, it might be lying, so we shouldn't compare with it
 }
--- a/xpcom/tests/gtest/TestXPIDLString.cpp
+++ b/xpcom/tests/gtest/TestXPIDLString.cpp
@@ -1,18 +1,24 @@
+/* -*- 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 "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsXPIDLString.h"
 #include "gtest/gtest.h"
 
 static void
 nsXPIDLStringTest_Value(char16_t** aResult)
 {
-    *aResult = ToNewUnicode(NS_LITERAL_STRING("Hello, World"));
+  *aResult = ToNewUnicode(NS_LITERAL_STRING("Hello, World"));
 }
 
 TEST(XPIDLString, Main)
 {
-    nsXPIDLString s1;
-    nsXPIDLStringTest_Value(getter_Copies(s1));
-    EXPECT_TRUE(s1.EqualsLiteral("Hello, World"));
+  nsXPIDLString s1;
+  nsXPIDLStringTest_Value(getter_Copies(s1));
+  EXPECT_TRUE(s1.EqualsLiteral("Hello, World"));
 }
 
--- a/xpcom/windbgdlg/windbgdlg.cpp
+++ b/xpcom/windbgdlg/windbgdlg.cpp
@@ -1,11 +1,11 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
+/* -*- 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/. */
 
 /* Windows only app to show a modal debug dialog - launched by nsDebug.cpp */
 #include <windows.h>
 #include <stdlib.h>
 #ifdef _MSC_VER
 #include <strsafe.h>
@@ -66,56 +66,56 @@ WinMain(HINSTANCE hInstance, HINSTANCE h
 }
 #endif /* __MINGW32__ */
 
 
 int WINAPI
 wWinMain(HINSTANCE  hInstance, HINSTANCE  hPrevInstance,
          LPWSTR  lpszCmdLine, int  nCmdShow)
 {
-    /* support for auto answering based on words in the assertion.
-     * the assertion message is sent as a series of arguements (words) to the commandline.
-     * set a "word" to 0xffffffff to let the word not affect this code.
-     * set a "word" to 0xfffffffe to show the dialog.
-     * set a "word" to 0x5 to ignore (program should continue).
-     * set a "word" to 0x4 to retry (should fall into debugger).
-     * set a "word" to 0x3 to abort (die).
-     */
-    DWORD regType;
-    DWORD regValue = -1;
-    DWORD regLength = sizeof regValue;
-    HKEY hkeyCU, hkeyLM;
-    RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\mozilla.org\\windbgdlg", 0, KEY_READ, &hkeyCU);
-    RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\mozilla.org\\windbgdlg", 0, KEY_READ, &hkeyLM);
-    int argc =0;
-    for (int i = __argc - 1; regValue == (DWORD)-1 && i; --i) {
-        bool ok = false;
-        if (hkeyCU)
-            ok = RegQueryValueExW(hkeyCU, __wargv[i], 0, &regType, (LPBYTE)&regValue, &regLength) == ERROR_SUCCESS;
-        if (!ok && hkeyLM)
-            ok = RegQueryValueExW(hkeyLM, __wargv[i], 0, &regType, (LPBYTE)&regValue, &regLength) == ERROR_SUCCESS;
-        if (!ok)
-            regValue = -1;
-    }
+  /* support for auto answering based on words in the assertion.
+   * the assertion message is sent as a series of arguements (words) to the commandline.
+   * set a "word" to 0xffffffff to let the word not affect this code.
+   * set a "word" to 0xfffffffe to show the dialog.
+   * set a "word" to 0x5 to ignore (program should continue).
+   * set a "word" to 0x4 to retry (should fall into debugger).
+   * set a "word" to 0x3 to abort (die).
+   */
+  DWORD regType;
+  DWORD regValue = -1;
+  DWORD regLength = sizeof regValue;
+  HKEY hkeyCU, hkeyLM;
+  RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\mozilla.org\\windbgdlg", 0, KEY_READ, &hkeyCU);
+  RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\mozilla.org\\windbgdlg", 0, KEY_READ, &hkeyLM);
+  int argc =0;
+  for (int i = __argc - 1; regValue == (DWORD)-1 && i; --i) {
+    bool ok = false;
     if (hkeyCU)
-        RegCloseKey(hkeyCU);
-    if (hkeyLM)
-        RegCloseKey(hkeyLM);
-    if (regValue != (DWORD)-1 && regValue != (DWORD)-2)
-        return regValue;
-    static const int size = 4096;
-    static WCHAR msg[size];
+      ok = RegQueryValueExW(hkeyCU, __wargv[i], 0, &regType, (LPBYTE)&regValue, &regLength) == ERROR_SUCCESS;
+    if (!ok && hkeyLM)
+      ok = RegQueryValueExW(hkeyLM, __wargv[i], 0, &regType, (LPBYTE)&regValue, &regLength) == ERROR_SUCCESS;
+    if (!ok)
+      regValue = -1;
+  }
+  if (hkeyCU)
+    RegCloseKey(hkeyCU);
+  if (hkeyLM)
+    RegCloseKey(hkeyLM);
+  if (regValue != (DWORD)-1 && regValue != (DWORD)-2)
+    return regValue;
+  static const int size = 4096;
+  static WCHAR msg[size];
 
 #ifdef _MSC_VER
-    StringCchPrintfW(msg,
+  StringCchPrintfW(msg,
 #else
-    snwprintf(msg,
+  snwprintf(msg,
 #endif
-              size,
-              L"%s\n\nClick Abort to exit the Application.\n"
-              L"Click Retry to Debug the Application.\n"
-              L"Click Ignore to continue running the Application.",
-              lpszCmdLine);
-    msg[size - 1] = L'\0';
-    return MessageBoxW(nullptr, msg, L"NSGlue_Assertion",
-                       MB_ICONSTOP | MB_SYSTEMMODAL |
-                       MB_ABORTRETRYIGNORE | MB_DEFBUTTON3);
+            size,
+            L"%s\n\nClick Abort to exit the Application.\n"
+            L"Click Retry to Debug the Application.\n"
+            L"Click Ignore to continue running the Application.",
+            lpszCmdLine);
+  msg[size - 1] = L'\0';
+  return MessageBoxW(nullptr, msg, L"NSGlue_Assertion",
+                     MB_ICONSTOP | MB_SYSTEMMODAL |
+                     MB_ABORTRETRYIGNORE | MB_DEFBUTTON3);
 }