Bug 1267577 - Move nsRunnable to mozilla::Runnable. r=gsvelto
authorGregor Wagner <gwagner@mozilla.com>
Wed, 27 Apr 2016 12:05:40 +0200
changeset 295131 03b88e129a66b82605b0d450b6c221358d4cea1f
parent 295130 9892ac28ce0df4d20bb19c6cc882211e07ba355e
child 295132 c569dc7fca7001e33e6d45839166db1a15d4e4da
push id30220
push usercbook@mozilla.com
push dateThu, 28 Apr 2016 14:31:09 +0000
treeherdermozilla-central@4292da9df16b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgsvelto
bugs1267577
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 1267577 - Move nsRunnable to mozilla::Runnable. r=gsvelto
dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp
dom/bluetooth/bluedroid/BluetoothAvrcpManager.cpp
dom/bluetooth/bluedroid/BluetoothGattManager.cpp
dom/bluetooth/bluedroid/BluetoothHidManager.cpp
dom/bluetooth/bluedroid/BluetoothOppManager.cpp
dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
dom/bluetooth/bluez/BluetoothDBusService.cpp
dom/bluetooth/bluez/BluetoothHfpManager.cpp
dom/bluetooth/bluez/BluetoothOppManager.cpp
dom/bluetooth/common/BluetoothReplyRunnable.h
dom/bluetooth/common/BluetoothService.cpp
dom/bluetooth/common/BluetoothService.h
dom/bluetooth/common/webapi/BluetoothGattServer.cpp
dom/camera/TestGonkCameraHardware.cpp
dom/fmradio/FMRadioService.h
dom/ipc/NuwaChild.cpp
dom/nfc/gonk/NfcService.cpp
dom/system/gonk/AutoMounterSetting.cpp
dom/system/gonk/GonkGPSGeolocationProvider.cpp
dom/system/gonk/MozMtpDatabase.cpp
dom/system/gonk/MozMtpServer.cpp
dom/system/gonk/NetworkWorker.cpp
dom/system/gonk/VolumeServiceTest.cpp
dom/system/gonk/mozstumbler/MozStumbler.cpp
dom/system/gonk/mozstumbler/UploadStumbleRunnable.h
dom/system/gonk/mozstumbler/WriteStumbleOnThread.cpp
dom/system/gonk/mozstumbler/WriteStumbleOnThread.h
dom/system/gonk/nsVolumeService.cpp
dom/wifi/WifiProxyService.cpp
hal/gonk/GonkDiskSpaceWatcher.cpp
hal/gonk/GonkFMRadio.cpp
hal/gonk/GonkHal.cpp
hal/gonk/GonkSensor.cpp
hal/gonk/GonkSwitch.cpp
ipc/hal/DaemonRunnables.h
ipc/netd/Netd.cpp
netwerk/protocol/rtsp/RtspChannelChild.cpp
netwerk/protocol/rtsp/controller/RtspController.cpp
netwerk/protocol/rtsp/controller/RtspControllerChild.cpp
toolkit/xre/EventTracer.cpp
widget/gonk/GonkPermission.cpp
widget/gonk/HwcComposer2D.cpp
widget/gonk/WidgetTraceEvent.cpp
widget/gonk/nativewindow/FakeSurfaceComposer.cpp
widget/gonk/nsAppShell.cpp
widget/gonk/nsScreenManagerGonk.cpp
widget/gonk/nsScreenManagerGonk.h
widget/gonk/nsWindow.cpp
--- a/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp
@@ -124,17 +124,17 @@ public:
   }
 
 private:
   BluetoothA2dpInterface* mInterface;
   RefPtr<BluetoothProfileResultHandler> mRes;
 };
 
 class BluetoothA2dpManager::InitProfileResultHandlerRunnable final
-  : public nsRunnable
+  : public Runnable
 {
 public:
   InitProfileResultHandlerRunnable(BluetoothProfileResultHandler* aRes,
                                    nsresult aRv)
     : mRes(aRes)
     , mRv(aRv)
   {
     MOZ_ASSERT(mRes);
@@ -166,56 +166,56 @@ private:
 // static
 void
 BluetoothA2dpManager::InitA2dpInterface(BluetoothProfileResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (sBtA2dpInterface) {
     BT_LOGR("Bluetooth A2DP interface is already initalized.");
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_OK);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch A2DP Init runnable");
     }
     return;
   }
 
   auto btInf = BluetoothInterface::GetInstance();
 
   if (NS_WARN_IF(!btInf)) {
     // If there's no Bluetooth interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch A2DP OnError runnable");
     }
     return;
   }
 
   auto setupInterface = btInf->GetBluetoothSetupInterface();
 
   if (NS_WARN_IF(!setupInterface)) {
     // If there's no Setup interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch A2DP OnError runnable");
     }
     return;
   }
 
   auto a2dpInterface = btInf->GetBluetoothA2dpInterface();
 
   if (NS_WARN_IF(!a2dpInterface)) {
     // If there's no A2DP interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch A2DP OnError runnable");
     }
     return;
   }
 
   // Set notification handler _before_ registering the module. It could
@@ -324,17 +324,17 @@ public:
     }
   }
 
 private:
   RefPtr<BluetoothProfileResultHandler> mRes;
 };
 
 class BluetoothA2dpManager::DeinitProfileResultHandlerRunnable final
-  : public nsRunnable
+  : public Runnable
 {
 public:
   DeinitProfileResultHandlerRunnable(BluetoothProfileResultHandler* aRes,
                                      nsresult aRv)
     : mRes(aRes)
     , mRv(aRv)
   {
     MOZ_ASSERT(mRes);
@@ -360,43 +360,43 @@ private:
 // static
 void
 BluetoothA2dpManager::DeinitA2dpInterface(BluetoothProfileResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!sBtA2dpInterface) {
     BT_LOGR("Bluetooth A2DP interface has not been initalized.");
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_OK);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch A2DP Deinit runnable");
     }
     return;
   }
 
   auto btInf = BluetoothInterface::GetInstance();
 
   if (NS_WARN_IF(!btInf)) {
     // If there's no backend interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch A2DP OnError runnable");
     }
     return;
   }
 
   auto setupInterface = btInf->GetBluetoothSetupInterface();
 
   if (NS_WARN_IF(!setupInterface)) {
     // If there's no Setup interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch A2DP OnError runnable");
     }
     return;
   }
 
   setupInterface->UnregisterModule(
--- a/dom/bluetooth/bluedroid/BluetoothAvrcpManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothAvrcpManager.cpp
@@ -167,17 +167,17 @@ public:
   }
 
 private:
   BluetoothAvrcpInterface* mInterface;
   RefPtr<BluetoothProfileResultHandler> mRes;
 };
 
 class BluetoothAvrcpManager::InitProfileResultHandlerRunnable final
-  : public nsRunnable
+  : public Runnable
 {
 public:
   InitProfileResultHandlerRunnable(BluetoothProfileResultHandler* aRes,
                                    nsresult aRv)
     : mRes(aRes)
     , mRv(aRv)
   {
     MOZ_ASSERT(mRes);
@@ -206,56 +206,56 @@ private:
 // static
 void
 BluetoothAvrcpManager::InitAvrcpInterface(BluetoothProfileResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (sBtAvrcpInterface) {
     BT_LOGR("Bluetooth AVRCP interface is already initalized.");
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_OK);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch AVRCP Init runnable");
     }
     return;
   }
 
   auto btInf = BluetoothInterface::GetInstance();
 
   if (NS_WARN_IF(!btInf)) {
     // If there's no Bluetooth interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch AVRCP OnError runnable");
     }
     return;
   }
 
   auto setupInterface = btInf->GetBluetoothSetupInterface();
 
   if (NS_WARN_IF(!setupInterface)) {
     // If there's no Setup interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch AVRCP OnError runnable");
     }
     return;
   }
 
   auto avrcpInterface = btInf->GetBluetoothAvrcpInterface();
 
   if (NS_WARN_IF(!avrcpInterface)) {
     // If there's no AVRCP interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch AVRCP OnError runnable");
     }
     return;
   }
 
   // Set notification handler _before_ registering the module. It could
@@ -345,17 +345,17 @@ public:
     }
   }
 
 private:
   RefPtr<BluetoothProfileResultHandler> mRes;
 };
 
 class BluetoothAvrcpManager::DeinitProfileResultHandlerRunnable final
-  : public nsRunnable
+  : public Runnable
 {
 public:
   DeinitProfileResultHandlerRunnable(BluetoothProfileResultHandler* aRes,
                                      nsresult aRv)
     : mRes(aRes)
     , mRv(aRv)
   {
     MOZ_ASSERT(mRes);
@@ -381,43 +381,43 @@ private:
 // static
 void
 BluetoothAvrcpManager::DeinitAvrcpInterface(BluetoothProfileResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!sBtAvrcpInterface) {
     BT_LOGR("Bluetooth AVRCP interface has not been initalized.");
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_OK);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch AVRCP Deinit runnable");
     }
     return;
   }
 
   auto btInf = BluetoothInterface::GetInstance();
 
   if (NS_WARN_IF(!btInf)) {
     // If there's no backend interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch AVRCP OnError runnable");
     }
     return;
   }
 
   auto setupInterface = btInf->GetBluetoothSetupInterface();
 
   if (NS_WARN_IF(!setupInterface)) {
     // If there's no Setup interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch AVRCP OnError runnable");
     }
     return;
   }
 
   setupInterface->UnregisterModule(
@@ -429,17 +429,17 @@ void
 BluetoothAvrcpManager::HandleShutdown()
 {
   MOZ_ASSERT(NS_IsMainThread());
   sInShutdown = true;
   Disconnect(nullptr);
   sBluetoothAvrcpManager = nullptr;
 }
 
-class BluetoothAvrcpManager::ConnectRunnable final : public nsRunnable
+class BluetoothAvrcpManager::ConnectRunnable final : public Runnable
 {
 public:
   ConnectRunnable(BluetoothAvrcpManager* aManager)
     : mManager(aManager)
   {
     MOZ_ASSERT(mManager);
   }
   NS_METHOD Run() override
@@ -462,17 +462,17 @@ BluetoothAvrcpManager::Connect(const Blu
   // AVRCP doesn't require connecting. We just set the remote address here.
   mDeviceAddress = aDeviceAddress;
   mController = aController;
   SetConnected(true);
 
   NS_DispatchToMainThread(new ConnectRunnable(this));
 }
 
-class BluetoothAvrcpManager::DisconnectRunnable final : public nsRunnable
+class BluetoothAvrcpManager::DisconnectRunnable final : public Runnable
 {
 public:
   DisconnectRunnable(BluetoothAvrcpManager* aManager)
     : mManager(aManager)
   {
     MOZ_ASSERT(mManager);
   }
   NS_METHOD Run() override
--- a/dom/bluetooth/bluedroid/BluetoothGattManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothGattManager.cpp
@@ -460,17 +460,17 @@ public:
   }
 
 private:
   BluetoothGattInterface* mInterface;
   RefPtr<BluetoothProfileResultHandler> mRes;
 };
 
 class BluetoothGattManager::InitProfileResultHandlerRunnable final
-  : public nsRunnable
+  : public Runnable
 {
 public:
   InitProfileResultHandlerRunnable(BluetoothProfileResultHandler* aRes,
                                    nsresult aRv)
     : mRes(aRes)
     , mRv(aRv)
   {
     MOZ_ASSERT(mRes);
@@ -496,56 +496,56 @@ private:
 // static
 void
 BluetoothGattManager::InitGattInterface(BluetoothProfileResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (sBluetoothGattInterface) {
     BT_LOGR("Bluetooth GATT interface is already initalized.");
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_OK);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch GATT Init runnable");
     }
     return;
   }
 
   auto btInf = BluetoothInterface::GetInstance();
 
   if (NS_WARN_IF(!btInf)) {
     // If there's no Bluetooth interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch GATT OnError runnable");
     }
     return;
   }
 
   auto setupInterface = btInf->GetBluetoothSetupInterface();
 
   if (NS_WARN_IF(!setupInterface)) {
     // If there's no Setup interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch GATT OnError runnable");
     }
     return;
   }
 
   auto gattInterface = btInf->GetBluetoothGattInterface();
 
   if (NS_WARN_IF(!gattInterface)) {
     // If there's no GATT interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch GATT OnError runnable");
     }
     return;
   }
 
   if (!sClients) {
@@ -610,17 +610,17 @@ public:
     }
   }
 
 private:
   RefPtr<BluetoothProfileResultHandler> mRes;
 };
 
 class BluetoothGattManager::DeinitProfileResultHandlerRunnable final
-  : public nsRunnable
+  : public Runnable
 {
 public:
   DeinitProfileResultHandlerRunnable(BluetoothProfileResultHandler* aRes,
                                      nsresult aRv)
     : mRes(aRes)
     , mRv(aRv)
   {
     MOZ_ASSERT(mRes);
@@ -646,43 +646,43 @@ private:
 // static
 void
 BluetoothGattManager::DeinitGattInterface(BluetoothProfileResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!sBluetoothGattInterface) {
     BT_LOGR("Bluetooth GATT interface has not been initalized.");
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_OK);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch GATT Deinit runnable");
     }
     return;
   }
 
   auto btInf = BluetoothInterface::GetInstance();
 
   if (NS_WARN_IF(!btInf)) {
     // If there's no backend interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch GATT OnError runnable");
     }
     return;
   }
 
   auto setupInterface = btInf->GetBluetoothSetupInterface();
 
   if (NS_WARN_IF(!setupInterface)) {
     // If there's no Setup interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch GATT OnError runnable");
     }
     return;
   }
 
   setupInterface->UnregisterModule(
--- a/dom/bluetooth/bluedroid/BluetoothHidManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothHidManager.cpp
@@ -89,17 +89,17 @@ public:
   }
 
 private:
   BluetoothHidInterface* mInterface;
   RefPtr<BluetoothProfileResultHandler> mRes;
 };
 
 class BluetoothHidManager::InitProfileResultHandlerRunnable final
-  : public nsRunnable
+  : public Runnable
 {
 public:
   InitProfileResultHandlerRunnable(BluetoothProfileResultHandler* aRes,
                                    nsresult aRv)
     : mRes(aRes)
     , mRv(aRv)
   {
     MOZ_ASSERT(mRes);
@@ -125,56 +125,56 @@ private:
 // static
 void
 BluetoothHidManager::InitHidInterface(BluetoothProfileResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (sBluetoothHidInterface) {
     BT_LOGR("Bluetooth HID interface is already initialized.");
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_OK);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch HID Init runnable");
     }
     return;
   }
 
   auto btInf = BluetoothInterface::GetInstance();
 
   if (NS_WARN_IF(!btInf)) {
     // If there's no backend interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch HID OnError runnable");
     }
     return;
   }
 
   auto setupInterface = btInf->GetBluetoothSetupInterface();
 
   if (NS_WARN_IF(!setupInterface)) {
     // If there's no Setup interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch HID OnError runnable");
     }
     return;
   }
 
   auto hidinterface = btInf->GetBluetoothHidInterface();
 
   if (NS_WARN_IF(!hidinterface)) {
     // If there's no HID interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch HID OnError runnable");
     }
     return;
   }
 
   // Set notification handler _before_ registering the module. It could
@@ -241,17 +241,17 @@ public:
     }
   }
 
 private:
   RefPtr<BluetoothProfileResultHandler> mRes;
 };
 
 class BluetoothHidManager::DeinitProfileResultHandlerRunnable final
-  : public nsRunnable
+  : public Runnable
 {
 public:
   DeinitProfileResultHandlerRunnable(BluetoothProfileResultHandler* aRes,
                                      nsresult aRv)
     : mRes(aRes)
     , mRv(aRv)
   {
     MOZ_ASSERT(mRes);
@@ -277,43 +277,43 @@ private:
 // static
 void
 BluetoothHidManager::DeinitHidInterface(BluetoothProfileResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!sBluetoothHidInterface) {
     BT_LOGR("Bluetooth Hid interface has not been initialized.");
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_OK);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch HID Deinit runnable");
     }
     return;
   }
 
   auto btInf = BluetoothInterface::GetInstance();
 
   if (NS_WARN_IF(!btInf)) {
     // If there's no backend interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch HID OnError runnable");
     }
     return;
   }
 
   auto setupInterface = btInf->GetBluetoothSetupInterface();
 
   if (NS_WARN_IF(!setupInterface)) {
     // If there's no Setup interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch HID OnError runnable");
     }
     return;
   }
 
   setupInterface->UnregisterModule(
--- a/dom/bluetooth/bluedroid/BluetoothOppManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothOppManager.cpp
@@ -97,17 +97,17 @@ BluetoothOppManager::Observe(nsISupports
     HandleShutdown();
     return NS_OK;
   }
 
   MOZ_ASSERT(false, "BluetoothOppManager got unexpected topic!");
   return NS_ERROR_UNEXPECTED;
 }
 
-class BluetoothOppManager::SendSocketDataTask final : public nsRunnable
+class BluetoothOppManager::SendSocketDataTask final : public Runnable
 {
 public:
   SendSocketDataTask(UniquePtr<uint8_t[]> aStream, uint32_t aSize)
     : mStream(Move(aStream))
     , mSize(aSize)
   {
     MOZ_ASSERT(!NS_IsMainThread());
   }
@@ -121,17 +121,17 @@ public:
     return NS_OK;
   }
 
 private:
   UniquePtr<uint8_t[]> mStream;
   uint32_t mSize;
 };
 
-class BluetoothOppManager::ReadFileTask final : public nsRunnable
+class BluetoothOppManager::ReadFileTask final : public Runnable
 {
 public:
   ReadFileTask(nsIInputStream* aInputStream,
                uint32_t aRemoteMaxPacketSize) : mInputStream(aInputStream)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
     mAvailablePacketSize = aRemoteMaxPacketSize - kPutRequestHeaderSize;
--- a/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
@@ -113,17 +113,17 @@ class BluetoothHfpManager::CloseScoTask 
 private:
   void Run() override
   {
     MOZ_ASSERT(sBluetoothHfpManager);
     sBluetoothHfpManager->DisconnectSco();
   }
 };
 
-class BluetoothHfpManager::CloseScoRunnable : public nsRunnable
+class BluetoothHfpManager::CloseScoRunnable : public Runnable
 {
 public:
   NS_IMETHOD Run() override
   {
     MOZ_ASSERT(NS_IsMainThread());
 
     MessageLoop::current()->PostDelayedTask(
       FROM_HERE, new CloseScoTask(), sBusyToneInterval);
@@ -314,17 +314,17 @@ public:
   }
 
 private:
   BluetoothHandsfreeInterface* mInterface;
   RefPtr<BluetoothProfileResultHandler> mRes;
 };
 
 class BluetoothHfpManager::InitProfileResultHandlerRunnable final
-  : public nsRunnable
+  : public Runnable
 {
 public:
   InitProfileResultHandlerRunnable(BluetoothProfileResultHandler* aRes,
                                    nsresult aRv)
     : mRes(aRes)
     , mRv(aRv)
   {
     MOZ_ASSERT(mRes);
@@ -350,56 +350,56 @@ private:
 // static
 void
 BluetoothHfpManager::InitHfpInterface(BluetoothProfileResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (sBluetoothHfpInterface) {
     BT_LOGR("Bluetooth Handsfree interface is already initalized.");
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_OK);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch HFP Init runnable");
     }
     return;
   }
 
   auto btInf = BluetoothInterface::GetInstance();
 
   if (NS_WARN_IF(!btInf)) {
     // If there's no backend interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch HFP OnError runnable");
     }
     return;
   }
 
   auto setupInterface = btInf->GetBluetoothSetupInterface();
 
   if (NS_WARN_IF(!setupInterface)) {
     // If there's no Setup interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch HFP OnError runnable");
     }
     return;
   }
 
   auto interface = btInf->GetBluetoothHandsfreeInterface();
 
   if (NS_WARN_IF(!interface)) {
     // If there's no HFP interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new InitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch HFP OnError runnable");
     }
     return;
   }
 
   // Set notification handler _before_ registering the module. It could
@@ -466,17 +466,17 @@ public:
     }
   }
 
 private:
   RefPtr<BluetoothProfileResultHandler> mRes;
 };
 
 class BluetoothHfpManager::DeinitProfileResultHandlerRunnable final
-  : public nsRunnable
+  : public Runnable
 {
 public:
   DeinitProfileResultHandlerRunnable(BluetoothProfileResultHandler* aRes,
                                      nsresult aRv)
     : mRes(aRes)
     , mRv(aRv)
   {
     MOZ_ASSERT(mRes);
@@ -502,43 +502,43 @@ private:
 // static
 void
 BluetoothHfpManager::DeinitHfpInterface(BluetoothProfileResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!sBluetoothHfpInterface) {
     BT_LOGR("Bluetooth Handsfree interface has not been initialized.");
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_OK);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch HFP Deinit runnable");
     }
     return;
   }
 
   auto btInf = BluetoothInterface::GetInstance();
 
   if (NS_WARN_IF(!btInf)) {
     // If there's no backend interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch HFP OnError runnable");
     }
     return;
   }
 
   auto setupInterface = btInf->GetBluetoothSetupInterface();
 
   if (NS_WARN_IF(!setupInterface)) {
     // If there's no Setup interface, we dispatch a runnable
     // that calls the profile result handler.
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new DeinitProfileResultHandlerRunnable(aRes, NS_ERROR_FAILURE);
     if (NS_FAILED(NS_DispatchToMainThread(r))) {
       BT_LOGR("Failed to dispatch HFP OnError runnable");
     }
     return;
   }
 
   setupInterface->UnregisterModule(
--- a/dom/bluetooth/bluez/BluetoothDBusService.cpp
+++ b/dom/bluetooth/bluez/BluetoothDBusService.cpp
@@ -508,17 +508,17 @@ GetPairedDevicesFilter(const BluetoothVa
     if (deviceProperties[p].name().EqualsLiteral("Paired")) {
       return deviceProperties[p].value().get_bool();
     }
   }
 
   return false;
 }
 
-class DistributeBluetoothSignalTask : public nsRunnable
+class DistributeBluetoothSignalTask : public Runnable
 {
 public:
   DistributeBluetoothSignalTask(const BluetoothSignal& aSignal)
     : mSignal(aSignal)
   {
   }
 
   nsresult Run()
@@ -531,17 +531,17 @@ public:
 
     return NS_OK;
   }
 
 private:
   BluetoothSignal mSignal;
 };
 
-class ControlPropertyChangedHandler : public nsRunnable
+class ControlPropertyChangedHandler : public Runnable
 {
 public:
   ControlPropertyChangedHandler(const BluetoothSignal& aSignal)
     : mSignal(aSignal)
   {
   }
 
   nsresult Run()
@@ -563,17 +563,17 @@ public:
     avrcp->SetConnected(connected);
     return NS_OK;
   }
 
 private:
   BluetoothSignal mSignal;
 };
 
-class SinkPropertyChangedHandler : public nsRunnable
+class SinkPropertyChangedHandler : public Runnable
 {
 public:
   SinkPropertyChangedHandler(const BluetoothSignal& aSignal)
     : mSignal(aSignal)
   {
   }
 
   NS_IMETHOD
@@ -593,17 +593,17 @@ public:
     a2dp->HandleSinkPropertyChanged(mSignal);
     return NS_OK;
   }
 
 private:
   BluetoothSignal mSignal;
 };
 
-class InputPropertyChangedHandler : public nsRunnable
+class InputPropertyChangedHandler : public Runnable
 {
 public:
   InputPropertyChangedHandler(const BluetoothSignal& aSignal)
     : mSignal(aSignal)
   {
   }
 
   NS_IMETHOD
@@ -632,17 +632,17 @@ class TryFiringAdapterAddedTask : public
 {
 public:
   void Run() override
   {
     MOZ_ASSERT(NS_IsMainThread());
   }
 };
 
-class TryFiringAdapterAddedRunnable : public nsRunnable
+class TryFiringAdapterAddedRunnable : public Runnable
 {
 public:
   TryFiringAdapterAddedRunnable(bool aDelay)
     : mDelay(aDelay)
   { }
 
   nsresult Run()
   {
@@ -714,17 +714,17 @@ UnpackObjectPathMessage(DBusMessage* aMs
         LOG_AND_FREE_DBUS_ERROR(&err);
       }
     } else {
       aValue = NS_ConvertUTF8toUTF16(object_path);
     }
   }
 }
 
-class PrepareProfileManagersRunnable : public nsRunnable
+class PrepareProfileManagersRunnable : public Runnable
 {
 public:
   nsresult Run()
   {
     BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
     if (!hfp || !hfp->Listen()) {
       BT_WARNING("Failed to start listening for BluetoothHfpManager!");
       return NS_ERROR_FAILURE;
@@ -803,17 +803,17 @@ UnpackVoidMessage(DBusMessage* aMsg, DBu
 
 static void
 GetVoidCallback(DBusMessage* aMsg, void* aBluetoothReplyRunnable)
 {
   RunDBusCallback(aMsg, aBluetoothReplyRunnable,
                   UnpackVoidMessage);
 }
 
-class ReplyErrorToProfileManager : public nsRunnable
+class ReplyErrorToProfileManager : public Runnable
 {
 public:
   ReplyErrorToProfileManager(BluetoothServiceClass aServiceClass,
                              bool aConnect,
                              const nsAString& aErrorString)
     : mServiceClass(aServiceClass)
     , mConnect(aConnect)
     , mErrorString(aErrorString)
@@ -1721,34 +1721,34 @@ public:
       &services, ArrayLength(sServices), DBUS_TYPE_INVALID);
 
     NS_ENSURE_TRUE_VOID(success);
 
     Unused << handler.forget(); /* picked up by callback handler */
   }
 };
 
-class PrepareAdapterRunnable : public nsRunnable
+class PrepareAdapterRunnable : public Runnable
 {
 public:
   PrepareAdapterRunnable()
   { }
 
   NS_IMETHOD Run()
   {
     MOZ_ASSERT(NS_IsMainThread());
 
     Task* task = new AddReservedServiceRecordsTask();
     DispatchToDBusThread(task);
 
     return NS_OK;
   }
 };
 
-class RequestPlayStatusTask : public nsRunnable
+class RequestPlayStatusTask : public Runnable
 {
 public:
   RequestPlayStatusTask()
   {
     MOZ_ASSERT(!NS_IsMainThread()); // I/O thread
   }
 
   nsresult Run()
@@ -2011,17 +2011,17 @@ EventFilter(DBusConnection* aConn, DBusM
   }
 
   if (!errorStr.IsEmpty()) {
     BT_WARNING(NS_ConvertUTF16toUTF8(errorStr).get());
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
   }
 
   BluetoothSignal signal(signalName, signalPath, v);
-  RefPtr<nsRunnable> task;
+  RefPtr<Runnable> task;
   if (signalInterface.EqualsLiteral(DBUS_SINK_IFACE)) {
     task = new SinkPropertyChangedHandler(signal);
   } else if (signalInterface.EqualsLiteral(DBUS_CTL_IFACE)) {
     task = new ControlPropertyChangedHandler(signal);
   } else if (signalInterface.EqualsLiteral(DBUS_INPUT_IFACE)) {
     task = new InputPropertyChangedHandler(signal);
   } else {
     task = new DistributeBluetoothSignalTask(signal);
@@ -2081,43 +2081,43 @@ public:
   }
 
   void Run()
   {
     MOZ_ASSERT(!NS_IsMainThread()); // I/O thread
 
     if (sDBusConnection) {
       BT_WARNING("DBus connection has already been established.");
-      RefPtr<nsRunnable> runnable = new BluetoothService::ToggleBtAck(true);
+      RefPtr<Runnable> runnable = new BluetoothService::ToggleBtAck(true);
       if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
         BT_WARNING("Failed to dispatch to main thread!");
       }
       return;
     }
 
     // Add a filter for all incoming messages_base
     if (!dbus_connection_add_filter(mConnection->GetConnection(),
                                     EventFilter, nullptr, nullptr)) {
       BT_WARNING("Cannot create DBus Event Filter for DBus Thread!");
-      RefPtr<nsRunnable> runnable = new BluetoothService::ToggleBtAck(false);
+      RefPtr<Runnable> runnable = new BluetoothService::ToggleBtAck(false);
       if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
         BT_WARNING("Failed to dispatch to main thread!");
       }
       return;
     }
 
     mConnection->Watch();
 
     if (!sPairingReqTable) {
       sPairingReqTable = new nsDataHashtable<BluetoothAddressHashKey, DBusMessage* >;
     }
 
     sDBusConnection = mConnection.release();
 
-    RefPtr<nsRunnable> runnable =
+    RefPtr<Runnable> runnable =
       new BluetoothService::ToggleBtAck(true);
     if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
       BT_WARNING("Failed to dispatch to main thread!");
       return;
     }
 
     /* Normally we'll receive the signal 'AdapterAdded' with the adapter object
      * path from the DBus daemon during start up. So, there's no need to query
@@ -2137,40 +2137,40 @@ public:
       }
     }
   }
 
 private:
   UniquePtr<RawDBusConnection> mConnection;
 };
 
-class StartBluetoothRunnable final : public nsRunnable
+class StartBluetoothRunnable final : public Runnable
 {
 public:
   NS_IMETHOD Run()
   {
     // This could block. It should never be run on the main thread.
     MOZ_ASSERT(!NS_IsMainThread()); // BT thread
 
 #ifdef MOZ_WIDGET_GONK
     if (!sBluedroid.Enable()) {
       BT_WARNING("Bluetooth not available.");
-      RefPtr<nsRunnable> runnable = new BluetoothService::ToggleBtAck(false);
+      RefPtr<Runnable> runnable = new BluetoothService::ToggleBtAck(false);
       if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
         BT_WARNING("Failed to dispatch to main thread!");
       }
       return NS_ERROR_FAILURE;
     }
 #endif
 
     RawDBusConnection* connection = new RawDBusConnection();
     nsresult rv = connection->EstablishDBusConnection();
     if (NS_FAILED(rv)) {
       BT_WARNING("Failed to establish connection to BlueZ daemon");
-      RefPtr<nsRunnable> runnable = new BluetoothService::ToggleBtAck(false);
+      RefPtr<Runnable> runnable = new BluetoothService::ToggleBtAck(false);
       if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
         BT_WARNING("Failed to dispatch to main thread!");
       }
       return NS_ERROR_FAILURE;
     }
 
     DBusError err;
     dbus_error_init(&err);
@@ -2197,25 +2197,25 @@ public:
   }
 };
 
 nsresult
 BluetoothDBusService::StartInternal(BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(!aRunnable);
 
-  RefPtr<nsRunnable> runnable = new StartBluetoothRunnable();
+  RefPtr<Runnable> runnable = new StartBluetoothRunnable();
   nsresult rv = DispatchToBtThread(runnable);
   if (NS_FAILED(rv)) {
     BT_WARNING("Failed to dispatch to BT thread!");
   }
   return rv;
 }
 
-class DisableBluetoothRunnable final : public nsRunnable
+class DisableBluetoothRunnable final : public Runnable
 {
 public:
   NS_IMETHOD Run()
   {
     if (NS_IsMainThread()) {
       // Clear |sControllerArray| here while we're on the main thread
       sControllerArray.Clear();
       // Forward this runnable to BT thread
@@ -2225,17 +2225,17 @@ public:
 #ifdef MOZ_WIDGET_GONK
     MOZ_ASSERT(sBluedroid.IsEnabled());
     // Disable() return true on success, so we need to invert it
     bool isEnabled = !sBluedroid.Disable();
 #else
     bool isEnabled = false;
 #endif
 
-    RefPtr<nsRunnable> runnable =
+    RefPtr<Runnable> runnable =
       new BluetoothService::ToggleBtAck(isEnabled);
     nsresult rv = NS_DispatchToMainThread(runnable);
     if (NS_FAILED(rv)) {
       BT_WARNING("Failed to dispatch to main thread!");
     }
     return rv;
   }
 };
@@ -2247,17 +2247,17 @@ public:
   { }
 
   void Run()
   {
     MOZ_ASSERT(!NS_IsMainThread()); // I/O thread
 
     if (!sDBusConnection) {
       BT_WARNING("DBus connection has not been established.");
-      RefPtr<nsRunnable> runnable = new BluetoothService::ToggleBtAck(false);
+      RefPtr<Runnable> runnable = new BluetoothService::ToggleBtAck(false);
       if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
         BT_WARNING("Failed to dispatch to main thread!");
       }
       return;
     }
 
     for (uint32_t i = 0; i < ArrayLength(sBluetoothDBusSignals); ++i) {
       dbus_bus_remove_match(sDBusConnection->GetConnection(),
@@ -2290,24 +2290,24 @@ public:
 
     // This command closes the DBus connection and all its instances
     // of DBusWatch will be removed and free'd.
     sDBusConnection = nullptr;
 
     // We can only dispatch to the BT thread if we're on the main
     // thread. Thus we dispatch our runnable to the main thread
     // from where it will forward itself to the BT thread.
-    RefPtr<nsRunnable> runnable = new DisableBluetoothRunnable();
+    RefPtr<Runnable> runnable = new DisableBluetoothRunnable();
     if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
       BT_WARNING("Failed to dispatch to BT thread!");
     }
   }
 };
 
-class StopBluetoothRunnable final : public nsRunnable
+class StopBluetoothRunnable final : public Runnable
 {
 public:
   NS_IMETHOD Run()
   {
     MOZ_ASSERT(!NS_IsMainThread()); // BT thread
 
     // This could block. It should never be run on the main thread.
     MonitorAutoLock lock(*sStopBluetoothMonitor);
@@ -2321,17 +2321,17 @@ public:
   }
 };
 
 nsresult
 BluetoothDBusService::StopInternal(BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(!aRunnable);
 
-  RefPtr<nsRunnable> runnable = new StopBluetoothRunnable();
+  RefPtr<Runnable> runnable = new StopBluetoothRunnable();
   nsresult rv = DispatchToBtThread(runnable);
   if (NS_FAILED(rv)) {
     BT_WARNING("Failed to dispatch to BT thread!");
   }
   return rv;
 }
 
 class DefaultAdapterPathReplyHandler : public DBusReplyHandler
@@ -3509,17 +3509,17 @@ BluetoothDBusService::ToggleCalls(Blueto
 
   BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
   hfp->ToggleCalls();
 
   DispatchBluetoothReply(aRunnable, BluetoothValue(true), EmptyString());
 }
 #endif // MOZ_B2G_RIL
 
-class OnUpdateSdpRecordsRunnable : public nsRunnable
+class OnUpdateSdpRecordsRunnable : public Runnable
 {
 public:
   OnUpdateSdpRecordsRunnable(const BluetoothAddress& aDeviceAddress,
                              BluetoothProfileManagerBase* aManager)
     : mDeviceAddress(aDeviceAddress)
     , mManager(aManager)
   {
     MOZ_ASSERT(!mDeviceAddress.IsCleared());
@@ -3536,17 +3536,17 @@ public:
     return NS_OK;
   }
 
 private:
   BluetoothAddress mDeviceAddress;
   BluetoothProfileManagerBase* mManager;
 };
 
-class OnGetServiceChannelRunnable : public nsRunnable
+class OnGetServiceChannelRunnable : public Runnable
 {
 public:
   OnGetServiceChannelRunnable(const BluetoothAddress& aDeviceAddress,
                               const BluetoothUuid& aServiceUuid,
                               int aChannel,
                               BluetoothProfileManagerBase* aManager)
     : mDeviceAddress(aDeviceAddress)
     , mServiceUuid(aServiceUuid)
@@ -3598,17 +3598,17 @@ public:
     // in BluetoothProfileManagerBase::OnGetServiceChannel.
 
     int channel = -1;
 
     if (aReply && (dbus_message_get_type(aReply) != DBUS_MESSAGE_TYPE_ERROR)) {
       channel = dbus_returns_int32(aReply);
     }
 
-    RefPtr<nsRunnable> r =
+    RefPtr<Runnable> r =
       new OnGetServiceChannelRunnable(mDeviceAddress, mServiceUUID, channel,
                                       mBluetoothProfileManager);
     nsresult rv = NS_DispatchToMainThread(r);
     NS_ENSURE_SUCCESS_VOID(rv);
   }
 
 private:
   BluetoothAddress mDeviceAddress;
@@ -3691,20 +3691,20 @@ BluetoothDBusService::GetServiceChannel(
   DispatchToDBusThread(task);
 #else
   // FIXME/Bug 793977 qdot: Just set something for desktop, until we have a
   // parser for the GetServiceAttributes xml block
   //
   // Even though we are on the main thread already, we need to dispatch a
   // runnable here. OnGetServiceChannel needs mRunnable to be set, which
   // happens after GetServiceChannel returns.
-  RefPtr<nsRunnable> r = new OnGetServiceChannelRunnable(aDeviceAddress,
-                                                           aServiceUUID,
-                                                           1,
-                                                           aManager);
+  RefPtr<Runnable> r = new OnGetServiceChannelRunnable(aDeviceAddress,
+                                                         aServiceUUID,
+                                                         1,
+                                                         aManager);
   NS_DispatchToMainThread(r);
 #endif
 
   return NS_OK;
 }
 
 class UpdateSdpRecordsTask : public Task
 {
--- a/dom/bluetooth/bluez/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/bluez/BluetoothHfpManager.cpp
@@ -1485,17 +1485,17 @@ BluetoothHfpManager::HandleCallStateChan
   mCurrentCallArray[aCallIndex].mIsConference = aIsConference;
 
   // Same logic as implementation in ril_worker.js
   if (aNumber.Length() && aNumber[0] == '+') {
     mCurrentCallArray[aCallIndex].mType = TOA_INTERNATIONAL;
   }
   mCurrentCallArray[aCallIndex].mNumber = aNumber;
 
-  RefPtr<nsRunnable> sendRingTask;
+  RefPtr<Runnable> sendRingTask;
   nsString address;
 
   switch (aCallState) {
     case nsITelephonyService::CALL_STATE_HELD:
       switch (prevCallState) {
         case nsITelephonyService::CALL_STATE_CONNECTED: {
           uint32_t numActive =
             GetNumberOfCalls(nsITelephonyService::CALL_STATE_CONNECTED);
--- a/dom/bluetooth/bluez/BluetoothOppManager.cpp
+++ b/dom/bluetooth/bluez/BluetoothOppManager.cpp
@@ -92,17 +92,17 @@ BluetoothOppManager::Observe(nsISupports
     HandleShutdown();
     return NS_OK;
   }
 
   MOZ_ASSERT(false, "BluetoothOppManager got unexpected topic!");
   return NS_ERROR_UNEXPECTED;
 }
 
-class SendSocketDataTask : public nsRunnable
+class SendSocketDataTask : public Runnable
 {
 public:
   SendSocketDataTask(UniquePtr<uint8_t[]> aStream, uint32_t aSize)
     : mStream(Move(aStream))
     , mSize(aSize)
   {
     MOZ_ASSERT(!NS_IsMainThread());
   }
@@ -116,17 +116,17 @@ public:
     return NS_OK;
   }
 
 private:
   UniquePtr<uint8_t[]> mStream;
   uint32_t mSize;
 };
 
-class ReadFileTask : public nsRunnable
+class ReadFileTask : public Runnable
 {
 public:
   ReadFileTask(nsIInputStream* aInputStream,
                uint32_t aRemoteMaxPacketSize) : mInputStream(aInputStream)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
     mAvailablePacketSize = aRemoteMaxPacketSize - kPutRequestHeaderSize;
--- a/dom/bluetooth/common/BluetoothReplyRunnable.h
+++ b/dom/bluetooth/common/BluetoothReplyRunnable.h
@@ -20,17 +20,17 @@ namespace dom {
 class Promise;
 }
 }
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 class BluetoothReply;
 
-class BluetoothReplyRunnable : public nsRunnable
+class BluetoothReplyRunnable : public Runnable
 {
 public:
   NS_DECL_NSIRUNNABLE
 
   BluetoothReplyRunnable(nsIDOMDOMRequest* aReq,
                          Promise* aPromise = nullptr);
 
   void SetReply(BluetoothReply* aReply);
@@ -91,17 +91,17 @@ protected:
   virtual bool
   ParseSuccessfulReply(JS::MutableHandle<JS::Value> aValue) override
   {
     aValue.setUndefined();
     return true;
   }
 };
 
-class BluetoothReplyTaskQueue : public nsRunnable
+class BluetoothReplyTaskQueue : public Runnable
 {
 public:
   NS_DECL_NSIRUNNABLE
 
   class SubReplyRunnable : public BluetoothReplyRunnable
   {
   public:
     SubReplyRunnable(nsIDOMDOMRequest* aReq,
--- a/dom/bluetooth/common/BluetoothService.cpp
+++ b/dom/bluetooth/common/BluetoothService.cpp
@@ -429,17 +429,17 @@ BluetoothService::StartBluetooth(bool aI
     // Switch Bluetooth on
     nsresult rv = StartInternal(aRunnable);
     if (NS_FAILED(rv)) {
       BT_WARNING("Bluetooth service failed to start!");
       return rv;
     }
   } else {
     BT_WARNING("Bluetooth has already been enabled before.");
-    RefPtr<nsRunnable> runnable = new BluetoothService::ToggleBtAck(true);
+    RefPtr<Runnable> runnable = new BluetoothService::ToggleBtAck(true);
     if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
       BT_WARNING("Failed to dispatch to main thread!");
     }
   }
 
   return NS_OK;
 }
 
@@ -460,17 +460,17 @@ BluetoothService::StopBluetooth(bool aIs
     // Any connected Bluetooth profile would be disconnected.
     nsresult rv = StopInternal(aRunnable);
     if (NS_FAILED(rv)) {
       BT_WARNING("Bluetooth service failed to stop!");
       return rv;
     }
   } else {
     BT_WARNING("Bluetooth has already been enabled/disabled before.");
-    RefPtr<nsRunnable> runnable = new BluetoothService::ToggleBtAck(false);
+    RefPtr<Runnable> runnable = new BluetoothService::ToggleBtAck(false);
     if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
       BT_WARNING("Failed to dispatch to main thread!");
     }
   }
 
   return NS_OK;
 }
 
--- a/dom/bluetooth/common/BluetoothService.h
+++ b/dom/bluetooth/common/BluetoothService.h
@@ -36,17 +36,17 @@ class BluetoothService : public nsIObser
 {
   class ToggleBtTask;
   friend class ToggleBtTask;
 
   class StartupTask;
   friend class StartupTask;
 
 public:
-  class ToggleBtAck : public nsRunnable
+  class ToggleBtAck : public Runnable
   {
   public:
     ToggleBtAck(bool aEnabled);
     NS_IMETHOD Run();
 
   private:
     bool mEnabled;
   };
--- a/dom/bluetooth/common/webapi/BluetoothGattServer.cpp
+++ b/dom/bluetooth/common/webapi/BluetoothGattServer.cpp
@@ -892,19 +892,19 @@ public:
     mPromise = nullptr;
   }
 
 private:
   virtual void OnSuccessFired() override
   {
     mService->AssignAppUuid(mServer->mAppUuid);
 
-    RefPtr<nsRunnable> runnable = new AddServiceTaskQueue(mServer,
-                                                            mService,
-                                                            mPromise);
+    RefPtr<Runnable> runnable = new AddServiceTaskQueue(mServer,
+                                                          mService,
+                                                          mPromise);
     nsresult rv = NS_DispatchToMainThread(runnable.forget());
 
     if (NS_WARN_IF(NS_FAILED(rv))) {
       mServer->mPendingService = nullptr;
       mPromise->MaybeReject(NS_ERROR_NOT_AVAILABLE);
     }
   }
 
--- a/dom/camera/TestGonkCameraHardware.cpp
+++ b/dom/camera/TestGonkCameraHardware.cpp
@@ -148,17 +148,17 @@ TestGonkCameraHardwareListener::HandleEv
     if (!NS_WARN_IF(!event)) {
       nsString errorType;
 
       event->GetMessage(errorType);
       if (errorType.EqualsLiteral("picture")) {
         OnTakePictureError(mTarget);
       } else if (errorType.EqualsLiteral("system")) {
         if (!NS_WARN_IF(!mCameraThread)) {
-          class DeferredSystemFailure : public nsRunnable
+          class DeferredSystemFailure : public Runnable
           {
           public:
             DeferredSystemFailure(nsGonkCameraControl* aTarget)
               : mTarget(aTarget)
             { }
 
             NS_IMETHODIMP
             Run()
@@ -223,17 +223,17 @@ TestGonkCameraHardwareListener::HandleEv
       NS_ConvertUTF16toUTF8(eventType).get());
   }
 
   return NS_OK;
 }
 
 NS_IMPL_ISUPPORTS(TestGonkCameraHardwareListener, nsIDOMEventListener)
 
-class TestGonkCameraHardware::ControlMessage : public nsRunnable
+class TestGonkCameraHardware::ControlMessage : public Runnable
 {
 public:
   ControlMessage(TestGonkCameraHardware* aTestHw)
     : mTestHw(aTestHw)
   { }
 
   NS_IMETHOD
   Run() override
--- a/dom/fmradio/FMRadioService.h
+++ b/dom/fmradio/FMRadioService.h
@@ -15,17 +15,17 @@
 #include "mozilla/StaticPtr.h"
 #include "mozilla/Services.h"
 #include "nsThreadUtils.h"
 #include "nsIObserver.h"
 #include "nsXULAppAPI.h"
 
 BEGIN_FMRADIO_NAMESPACE
 
-class FMRadioReplyRunnable : public nsRunnable
+class FMRadioReplyRunnable : public Runnable
 {
 public:
   FMRadioReplyRunnable() : mResponseType(SuccessResponse()) {}
   virtual ~FMRadioReplyRunnable() {}
 
   void
   SetReply(const FMRadioResponseType& aResponseType)
   {
--- a/dom/ipc/NuwaChild.cpp
+++ b/dom/ipc/NuwaChild.cpp
@@ -30,17 +30,17 @@ using namespace mozilla::dom;
 
 namespace mozilla {
 namespace dom {
 
 #ifdef MOZ_NUWA_PROCESS
 
 namespace {
 
-class CallNuwaSpawn: public nsRunnable
+class CallNuwaSpawn: public Runnable
 {
 public:
   NS_IMETHOD Run()
   {
     NuwaSpawn();
     if (IsNuwaProcess()) {
       return NS_OK;
     }
@@ -180,17 +180,17 @@ GetProtoFdInfos(NuwaProtoFdInfo* aInfoLi
   }
 
   if (i > NUWA_TOPLEVEL_MAX) {
     NS_RUNTIMEABORT("Too many top level protocols!");
   }
   *aInfoSize = i;
 }
 
-class RunAddNewIPCProcess : public nsRunnable
+class RunAddNewIPCProcess : public mozilla::Runnable
 {
 public:
   RunAddNewIPCProcess(pid_t aPid,
                       nsTArray<mozilla::ipc::ProtocolFdMapping>& aMaps)
       : mPid(aPid)
   {
     mMaps.SwapElements(aMaps);
   }
--- a/dom/nfc/gonk/NfcService.cpp
+++ b/dom/nfc/gonk/NfcService.cpp
@@ -166,17 +166,17 @@ NfcConsumer::Send(const CommandOptions& 
   // TODO: Zero-copy buffer transfers
   mStreamSocket->SendSocketData(
     new UnixSocketRawData(parcel.data(), parcel.dataSize()));
 
   return NS_OK;
 }
 
 // Runnable used dispatch the NfcEventOptions on the main thread.
-class NfcConsumer::DispatchNfcEventRunnable final : public nsRunnable
+class NfcConsumer::DispatchNfcEventRunnable final : public Runnable
 {
 public:
   DispatchNfcEventRunnable(NfcService* aNfcService, const EventOptions& aEvent)
     : mNfcService(aNfcService)
     , mEvent(aEvent)
   {
     MOZ_ASSERT(mNfcService);
   }
@@ -387,17 +387,17 @@ NfcConsumer::OnConnectSuccess(int aIndex
       break;
     }
     case STREAM_SOCKET:
       /* nothing to do */
       break;
   }
 }
 
-class NfcConsumer::ShutdownServiceRunnable final : public nsRunnable
+class NfcConsumer::ShutdownServiceRunnable final : public Runnable
 {
 public:
   ShutdownServiceRunnable(NfcService* aNfcService)
     : mNfcService(aNfcService)
   {
     MOZ_ASSERT(mNfcService);
   }
 
@@ -459,17 +459,17 @@ NfcService::FactoryCreate()
 
   RefPtr<NfcService> service(gNfcService);
   return service.forget();
 }
 
 /**
  * |StartConsumerRunnable| calls |NfcConsumer::Start| on the NFC thread.
  */
-class NfcService::StartConsumerRunnable final : public nsRunnable
+class NfcService::StartConsumerRunnable final : public Runnable
 {
 public:
   StartConsumerRunnable(NfcConsumer* aNfcConsumer)
     : mNfcConsumer(aNfcConsumer)
   {
     MOZ_ASSERT(mNfcConsumer);
   }
 
@@ -512,17 +512,17 @@ NfcService::Start(nsINfcGonkEventListene
   return NS_OK;
 }
 
 /**
  * |CleanupRunnable| deletes instances of the NFC consumer and
  * thread on the main thread. This has to be down after shutting
  * down the NFC consumer on the NFC thread.
  */
-class NfcService::CleanupRunnable final : public nsRunnable
+class NfcService::CleanupRunnable final : public Runnable
 {
 public:
   CleanupRunnable(NfcConsumer* aNfcConsumer,
                   already_AddRefed<nsIThread> aThread)
     : mNfcConsumer(aNfcConsumer)
     , mThread(aThread)
   {
     MOZ_ASSERT(mNfcConsumer);
@@ -546,17 +546,17 @@ private:
   nsCOMPtr<nsIThread> mThread;
 };
 
 /**
  * |ShutdownConsumerRunnable| calls |NfcConsumer::Shutdown| on the
  * NFC thread. Optionally, it can dispatch a |CleanupRunnable| to
  * the main thread for cleaning up the NFC resources.
  */
-class NfcService::ShutdownConsumerRunnable final : public nsRunnable
+class NfcService::ShutdownConsumerRunnable final : public Runnable
 {
 public:
   ShutdownConsumerRunnable(NfcConsumer* aNfcConsumer, bool aCleanUp)
     : mNfcConsumer(aNfcConsumer)
     , mCleanUp(aCleanUp)
   {
     MOZ_ASSERT(mNfcConsumer);
   }
@@ -598,17 +598,17 @@ NfcService::Shutdown()
   Unused << mThread.forget();
 
   return NS_OK;
 }
 
 /**
  * |SendRunnable| calls |NfcConsumer::Send| on the NFC thread.
  */
-class NfcService::SendRunnable final : public nsRunnable
+class NfcService::SendRunnable final : public Runnable
 {
 public:
   SendRunnable(NfcConsumer* aNfcConsumer, const CommandOptions& aOptions)
     : mNfcConsumer(aNfcConsumer)
     , mOptions(aOptions)
   {
     MOZ_ASSERT(mNfcConsumer);
   }
--- a/dom/system/gonk/AutoMounterSetting.cpp
+++ b/dom/system/gonk/AutoMounterSetting.cpp
@@ -156,17 +156,17 @@ AutoMounterSetting::StatusStr(int32_t aS
   switch (aStatus) {
     case AUTOMOUNTER_STATUS_DISABLED:   return "Disabled";
     case AUTOMOUNTER_STATUS_ENABLED:    return "Enabled";
     case AUTOMOUNTER_STATUS_FILES_OPEN: return "FilesOpen";
   }
   return "??? Unknown ???";
 }
 
-class CheckVolumeSettingsRunnable : public nsRunnable
+class CheckVolumeSettingsRunnable : public Runnable
 {
 public:
   CheckVolumeSettingsRunnable(const nsACString& aVolumeName)
     : mVolumeName(aVolumeName) {}
 
   NS_IMETHOD Run()
   {
     MOZ_ASSERT(NS_IsMainThread());
@@ -189,17 +189,17 @@ private:
 
 //static
 void
 AutoMounterSetting::CheckVolumeSettings(const nsACString& aVolumeName)
 {
   NS_DispatchToMainThread(new CheckVolumeSettingsRunnable(aVolumeName));
 }
 
-class SetStatusRunnable : public nsRunnable
+class SetStatusRunnable : public Runnable
 {
 public:
   SetStatusRunnable(int32_t aStatus) : mStatus(aStatus) {}
 
   NS_IMETHOD Run()
   {
     MOZ_ASSERT(NS_IsMainThread());
     nsCOMPtr<nsISettingsService> settingsService =
--- a/dom/system/gonk/GonkGPSGeolocationProvider.cpp
+++ b/dom/system/gonk/GonkGPSGeolocationProvider.cpp
@@ -100,17 +100,17 @@ AGpsRilCallbacks GonkGPSGeolocationProvi
 
 void
 GonkGPSGeolocationProvider::LocationCallback(GpsLocation* location)
 {
   if (gDebug_isGPSLocationIgnored) {
     return;
   }
 
-  class UpdateLocationEvent : public nsRunnable {
+  class UpdateLocationEvent : public Runnable {
   public:
     UpdateLocationEvent(nsGeoPosition* aPosition)
       : mPosition(aPosition)
     {}
     NS_IMETHOD Run() {
       RefPtr<GonkGPSGeolocationProvider> provider =
         GonkGPSGeolocationProvider::GetSingleton();
       nsCOMPtr<nsIGeolocationUpdate> callback = provider->mLocationCallback;
@@ -155,17 +155,17 @@ GonkGPSGeolocationProvider::LocationCall
   RefPtr<UpdateLocationEvent> event = new UpdateLocationEvent(somewhere);
   NS_DispatchToMainThread(event);
 
 #ifdef MOZ_B2G_RIL
   MozStumble(somewhere);
 #endif
 }
 
-class NotifyObserversGPSTask final : public nsRunnable
+class NotifyObserversGPSTask final : public Runnable
 {
 public:
   explicit NotifyObserversGPSTask(const char16_t* aData)
     : mData(aData)
   {}
   NS_IMETHOD Run() override {
     RefPtr<nsIGeolocationProvider> provider =
     GonkGPSGeolocationProvider::GetSingleton();
@@ -266,17 +266,17 @@ GonkGPSGeolocationProvider::NmeaCallback
   if (gDebug_isLoggingEnabled) {
     DBG("NMEA: timestamp:\t%lld, length: %d, %s", timestamp, length, nmea);
   }
 }
 
 void
 GonkGPSGeolocationProvider::SetCapabilitiesCallback(uint32_t capabilities)
 {
-  class UpdateCapabilitiesEvent : public nsRunnable {
+  class UpdateCapabilitiesEvent : public Runnable {
   public:
     UpdateCapabilitiesEvent(uint32_t aCapabilities)
       : mCapabilities(aCapabilities)
     {}
     NS_IMETHOD Run() {
       RefPtr<GonkGPSGeolocationProvider> provider =
         GonkGPSGeolocationProvider::GetSingleton();
 
@@ -334,17 +334,17 @@ GonkGPSGeolocationProvider::RequestUtcTi
 }
 
 #ifdef MOZ_B2G_RIL
 void
 GonkGPSGeolocationProvider::AGPSStatusCallback(AGpsStatus* status)
 {
   MOZ_ASSERT(status);
 
-  class AGPSStatusEvent : public nsRunnable {
+  class AGPSStatusEvent : public Runnable {
   public:
     AGPSStatusEvent(AGpsStatusValue aStatus)
       : mStatus(aStatus)
     {}
     NS_IMETHOD Run() {
       RefPtr<GonkGPSGeolocationProvider> provider =
         GonkGPSGeolocationProvider::GetSingleton();
 
@@ -363,17 +363,17 @@ GonkGPSGeolocationProvider::AGPSStatusCa
   };
 
   NS_DispatchToMainThread(new AGPSStatusEvent(status->status));
 }
 
 void
 GonkGPSGeolocationProvider::AGPSRILSetIDCallback(uint32_t flags)
 {
-  class RequestSetIDEvent : public nsRunnable {
+  class RequestSetIDEvent : public Runnable {
   public:
     RequestSetIDEvent(uint32_t flags)
       : mFlags(flags)
     {}
     NS_IMETHOD Run() {
       RefPtr<GonkGPSGeolocationProvider> provider =
         GonkGPSGeolocationProvider::GetSingleton();
       provider->RequestSetID(mFlags);
@@ -384,17 +384,17 @@ GonkGPSGeolocationProvider::AGPSRILSetID
   };
 
   NS_DispatchToMainThread(new RequestSetIDEvent(flags));
 }
 
 void
 GonkGPSGeolocationProvider::AGPSRILRefLocCallback(uint32_t flags)
 {
-  class RequestRefLocEvent : public nsRunnable {
+  class RequestRefLocEvent : public Runnable {
   public:
     RequestRefLocEvent()
     {}
     NS_IMETHOD Run() {
       RefPtr<GonkGPSGeolocationProvider> provider =
         GonkGPSGeolocationProvider::GetSingleton();
       provider->SetReferenceLocation();
       return NS_OK;
--- a/dom/system/gonk/MozMtpDatabase.cpp
+++ b/dom/system/gonk/MozMtpDatabase.cpp
@@ -250,17 +250,17 @@ MozMtpDatabase::UpdateEntry(MtpObjectHan
   MTP_DBG("UpdateEntry (0x%08x file %s) modified (%ld) %s",
           entry->mHandle, entry->mPath.get(),
           entry->mDateModified,
           FormatDate(entry->mDateModified, dateStr, sizeof(dateStr)));
   #endif
 }
 
 
-class MtpWatcherNotifyRunnable final : public nsRunnable
+class MtpWatcherNotifyRunnable final : public Runnable
 {
 public:
   MtpWatcherNotifyRunnable(nsACString& aStorageName,
                            nsACString& aPath,
                            const char* aEventType)
     : mStorageName(aStorageName),
       mPath(aPath),
       mEventType(aEventType)
--- a/dom/system/gonk/MozMtpServer.cpp
+++ b/dom/system/gonk/MozMtpServer.cpp
@@ -36,17 +36,17 @@
 #define DEFAULT_THREAD_TIMEOUT_MS 30000
 
 using namespace android;
 using namespace mozilla;
 BEGIN_MTP_NAMESPACE
 
 static const char* kMtpWatcherUpdate = "mtp-watcher-update";
 
-class MtpWatcherUpdateRunnable final : public nsRunnable
+class MtpWatcherUpdateRunnable final : public Runnable
 {
 public:
   MtpWatcherUpdateRunnable(MozMtpDatabase* aMozMtpDatabase,
                            RefCountedMtpServer* aMtpServer,
                            DeviceStorageFile* aFile,
                            const nsACString& aEventType)
     : mMozMtpDatabase(aMozMtpDatabase),
       mMtpServer(aMtpServer),
@@ -137,17 +137,17 @@ protected:
 
 private:
   RefPtr<MozMtpServer> mMozMtpServer;
   nsCOMPtr<nsIThread> mIOThread;
 };
 NS_IMPL_ISUPPORTS(MtpWatcherUpdate, nsIObserver)
 static StaticRefPtr<MtpWatcherUpdate> sMtpWatcherUpdate;
 
-class AllocMtpWatcherUpdateRunnable final : public nsRunnable
+class AllocMtpWatcherUpdateRunnable final : public Runnable
 {
 public:
   AllocMtpWatcherUpdateRunnable(MozMtpServer* aMozMtpServer)
     : mMozMtpServer(aMozMtpServer)
   {}
 
   NS_IMETHOD Run()
   {
@@ -155,17 +155,17 @@ public:
 
     sMtpWatcherUpdate = new MtpWatcherUpdate(mMozMtpServer);
     return NS_OK;
   }
 private:
   RefPtr<MozMtpServer> mMozMtpServer;
 };
 
-class FreeMtpWatcherUpdateRunnable final : public nsRunnable
+class FreeMtpWatcherUpdateRunnable final : public Runnable
 {
 public:
   FreeMtpWatcherUpdateRunnable(MozMtpServer* aMozMtpServer)
     : mMozMtpServer(aMozMtpServer)
   {}
 
   NS_IMETHOD Run()
   {
@@ -173,17 +173,17 @@ public:
 
     sMtpWatcherUpdate = nullptr;
     return NS_OK;
   }
 private:
   RefPtr<MozMtpServer> mMozMtpServer;
 };
 
-class MtpServerRunnable : public nsRunnable
+class MtpServerRunnable : public Runnable
 {
 public:
   MtpServerRunnable(int aMtpUsbFd, MozMtpServer* aMozMtpServer)
     : mMozMtpServer(aMozMtpServer),
       mMtpUsbFd(aMtpUsbFd)
   {
   }
 
--- a/dom/system/gonk/NetworkWorker.cpp
+++ b/dom/system/gonk/NetworkWorker.cpp
@@ -24,17 +24,17 @@ nsCOMPtr<nsIThread> gWorkerThread;
 
 // The singleton network worker, to be used on the main thread.
 StaticRefPtr<NetworkWorker> gNetworkWorker;
 
 // The singleton networkutils class, that can be used on any thread.
 static nsAutoPtr<NetworkUtils> gNetworkUtils;
 
 // Runnable used dispatch command result on the main thread.
-class NetworkResultDispatcher : public nsRunnable
+class NetworkResultDispatcher : public Runnable
 {
 public:
   NetworkResultDispatcher(const NetworkResultOptions& aResult)
     : mResult(aResult)
   {
     MOZ_ASSERT(!NS_IsMainThread());
   }
 
@@ -47,17 +47,17 @@ public:
     }
     return NS_OK;
   }
 private:
   NetworkResultOptions mResult;
 };
 
 // Runnable used dispatch netd command on the worker thread.
-class NetworkCommandDispatcher : public nsRunnable
+class NetworkCommandDispatcher : public Runnable
 {
 public:
   NetworkCommandDispatcher(const NetworkParams& aParams)
     : mParams(aParams)
   {
     MOZ_ASSERT(NS_IsMainThread());
   }
 
@@ -70,17 +70,17 @@ public:
     }
     return NS_OK;
   }
 private:
   NetworkParams mParams;
 };
 
 // Runnable used dispatch netd result on the worker thread.
-class NetdEventRunnable : public nsRunnable
+class NetdEventRunnable : public Runnable
 {
 public:
   NetdEventRunnable(NetdCommand* aCommand)
     : mCommand(aCommand)
   {
     MOZ_ASSERT(!NS_IsMainThread());
   }
 
--- a/dom/system/gonk/VolumeServiceTest.cpp
+++ b/dom/system/gonk/VolumeServiceTest.cpp
@@ -152,17 +152,17 @@ VolumeTestObserver::Observe(nsISupports*
     ERR("GetVolumeByPath( '/mnt/sdcardfoo' ) succeeded (unexpected)");
   } else {
     LOG("GetVolumeByPath( '/mnt/sdcardfoo' ) failed (expected)");
   }
 
   return NS_OK;
 }
 
-class InitVolumeServiceTestIO : public nsRunnable
+class InitVolumeServiceTestIO : public Runnable
 {
 public:
   NS_IMETHOD Run()
   {
     MOZ_ASSERT(NS_IsMainThread());
 
     DBG("InitVolumeServiceTest called");
     nsCOMPtr<nsIVolumeService> vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID);
--- a/dom/system/gonk/mozstumbler/MozStumbler.cpp
+++ b/dom/system/gonk/mozstumbler/MozStumbler.cpp
@@ -23,17 +23,17 @@
 #include "nsIRadioInterfaceLayer.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 
 NS_IMPL_ISUPPORTS(StumblerInfo, nsICellInfoListCallback, nsIWifiScanResultsReady)
 
-class RequestCellInfoEvent : public nsRunnable {
+class RequestCellInfoEvent : public Runnable {
 public:
   RequestCellInfoEvent(StumblerInfo *callback)
   : mRequestCallback(callback)
   {}
 
   NS_IMETHOD Run() {
     MOZ_ASSERT(NS_IsMainThread());
     // Get Cell Info
--- a/dom/system/gonk/mozstumbler/UploadStumbleRunnable.h
+++ b/dom/system/gonk/mozstumbler/UploadStumbleRunnable.h
@@ -12,17 +12,17 @@
 
 class nsIXMLHttpRequest;
 class nsIInputStream;
 
 /*
  This runnable is managed by WriteStumbleOnThread only, see that class
  for how this is scheduled.
  */
-class UploadStumbleRunnable final : public nsRunnable
+class UploadStumbleRunnable final : public Runnable
 {
 public:
   explicit UploadStumbleRunnable(nsIInputStream* aUploadInputStream);
 
   NS_IMETHOD Run() override;
 private:
   virtual ~UploadStumbleRunnable() {}
   nsCOMPtr<nsIInputStream> mUploadInputStream;
--- a/dom/system/gonk/mozstumbler/WriteStumbleOnThread.cpp
+++ b/dom/system/gonk/mozstumbler/WriteStumbleOnThread.cpp
@@ -20,17 +20,17 @@
 mozilla::Atomic<bool> WriteStumbleOnThread::sIsFileWaitingForUpload(false);
 mozilla::Atomic<bool> WriteStumbleOnThread::sIsAlreadyRunning(false);
 WriteStumbleOnThread::UploadFreqGuard WriteStumbleOnThread::sUploadFreqGuard = {0};
 
 #define FILENAME_INPROGRESS NS_LITERAL_CSTRING("stumbles.json.gz")
 #define FILENAME_COMPLETED NS_LITERAL_CSTRING("stumbles.done.json.gz")
 #define OUTPUT_DIR NS_LITERAL_CSTRING("mozstumbler")
 
-class DeleteRunnable : public nsRunnable
+class DeleteRunnable : public Runnable
 {
   public:
     DeleteRunnable() {}
 
     NS_IMETHODIMP
     Run() override
     {
       nsCOMPtr<nsIFile> tmpFile;
--- a/dom/system/gonk/mozstumbler/WriteStumbleOnThread.h
+++ b/dom/system/gonk/mozstumbler/WriteStumbleOnThread.h
@@ -30,17 +30,17 @@ class DeleteRunnable;
 
  A notable limitation is that the upload is triggered by a location event,
  this is used as an arbitrary and simple trigger. In future, there are
  better events that can be used, such as detecting network activity.
 
  This thread is guarded so that only one instance is active (see the
  mozilla::Atomics used for this).
  */
-class WriteStumbleOnThread : public nsRunnable
+class WriteStumbleOnThread : public mozilla::Runnable
 {
 public:
   explicit WriteStumbleOnThread(const nsCString& aDesc)
   : mDesc(aDesc)
   {}
 
   NS_IMETHODIMP Run() override;
 
--- a/dom/system/gonk/nsVolumeService.cpp
+++ b/dom/system/gonk/nsVolumeService.cpp
@@ -500,17 +500,17 @@ nsVolumeService::RemoveVolumeByName(cons
     obs->NotifyObservers(nullptr, NS_VOLUME_REMOVED, nsString(aName).get());
   }
 }
 
 /***************************************************************************
 * The UpdateVolumeRunnable creates an nsVolume and updates the main thread
 * data structure while running on the main thread.
 */
-class UpdateVolumeRunnable : public nsRunnable
+class UpdateVolumeRunnable : public Runnable
 {
 public:
   UpdateVolumeRunnable(nsVolumeService* aVolumeService, const Volume* aVolume)
     : mVolumeService(aVolumeService),
       mVolume(new nsVolume(aVolume))
   {
     MOZ_ASSERT(MessageLoop::current() == XRE_GetIOMessageLoop());
   }
--- a/dom/wifi/WifiProxyService.cpp
+++ b/dom/wifi/WifiProxyService.cpp
@@ -27,17 +27,17 @@ namespace mozilla {
 
 // The singleton Wifi service, to be used on the main thread.
 static StaticRefPtr<WifiProxyService> gWifiProxyService;
 
 // The singleton supplicant class, that can be used on any thread.
 static UniquePtr<WpaSupplicant> gWpaSupplicant;
 
 // Runnable used dispatch the WaitForEvent result on the main thread.
-class WifiEventDispatcher : public nsRunnable
+class WifiEventDispatcher : public Runnable
 {
 public:
   WifiEventDispatcher(const nsAString& aEvent, const nsACString& aInterface)
     : mEvent(aEvent)
     , mInterface(aInterface)
   {
     MOZ_ASSERT(!NS_IsMainThread());
   }
@@ -50,17 +50,17 @@ public:
   }
 
 private:
   nsString mEvent;
   nsCString mInterface;
 };
 
 // Runnable used to call WaitForEvent on the event thread.
-class EventRunnable : public nsRunnable
+class EventRunnable : public Runnable
 {
 public:
   EventRunnable(const nsACString& aInterface)
     : mInterface(aInterface)
   {
     MOZ_ASSERT(NS_IsMainThread());
   }
 
@@ -82,17 +82,17 @@ public:
     return NS_OK;
   }
 
 private:
   nsCString mInterface;
 };
 
 // Runnable used dispatch the Command result on the main thread.
-class WifiResultDispatcher : public nsRunnable
+class WifiResultDispatcher : public Runnable
 {
 public:
   WifiResultDispatcher(WifiResultOptions& aResult, const nsACString& aInterface)
     : mResult(aResult)
     , mInterface(aInterface)
   {
     MOZ_ASSERT(!NS_IsMainThread());
   }
@@ -105,17 +105,17 @@ public:
   }
 
 private:
   WifiResultOptions mResult;
   nsCString mInterface;
 };
 
 // Runnable used to call SendCommand on the control thread.
-class ControlRunnable : public nsRunnable
+class ControlRunnable : public Runnable
 {
 public:
   ControlRunnable(CommandOptions aOptions, const nsACString& aInterface)
     : mOptions(aOptions)
     , mInterface(aInterface)
   {
     MOZ_ASSERT(NS_IsMainThread());
   }
--- a/hal/gonk/GonkDiskSpaceWatcher.cpp
+++ b/hal/gonk/GonkDiskSpaceWatcher.cpp
@@ -114,17 +114,17 @@ static GonkDiskSpaceWatcher* gHalDiskSpa
 #define WATCHER_PREF_LOW        "disk_space_watcher.low_threshold"
 #define WATCHER_PREF_HIGH       "disk_space_watcher.high_threshold"
 #define WATCHER_PREF_TIMEOUT    "disk_space_watcher.timeout"
 #define WATCHER_PREF_SIZE_DELTA "disk_space_watcher.size_delta"
 
 static const char kWatchedPath[] = "/data";
 
 // Helper class to dispatch calls to xpcom on the main thread.
-class DiskSpaceNotifier : public nsRunnable
+class DiskSpaceNotifier : public Runnable
 {
 public:
   DiskSpaceNotifier(const bool aIsDiskFull, const uint64_t aFreeSpace) :
     mIsDiskFull(aIsDiskFull),
     mFreeSpace(aFreeSpace) {}
 
   NS_IMETHOD Run()
   {
@@ -134,17 +134,17 @@ public:
   }
 
 private:
   bool mIsDiskFull;
   uint64_t mFreeSpace;
 };
 
 // Helper runnable to delete the watcher on the main thread.
-class DiskSpaceCleaner : public nsRunnable
+class DiskSpaceCleaner : public Runnable
 {
 public:
   NS_IMETHOD Run()
   {
     MOZ_ASSERT(NS_IsMainThread());
     if (gHalDiskSpaceWatcher) {
       delete gHalDiskSpaceWatcher;
       gHalDiskSpaceWatcher = nullptr;
--- a/hal/gonk/GonkFMRadio.cpp
+++ b/hal/gonk/GonkFMRadio.cpp
@@ -79,17 +79,17 @@ static int
 setControl(uint32_t id, int32_t value)
 {
   struct v4l2_control control = {0};
   control.id = id;
   control.value = value;
   return ioctl(sRadioFD, VIDIOC_S_CTRL, &control);
 }
 
-class RadioUpdate : public nsRunnable {
+class RadioUpdate : public Runnable {
   hal::FMRadioOperation mOp;
   hal::FMRadioOperationStatus mStatus;
 public:
   RadioUpdate(hal::FMRadioOperation op, hal::FMRadioOperationStatus status)
     : mOp(op)
     , mStatus(status)
   {}
 
--- a/hal/gonk/GonkHal.cpp
+++ b/hal/gonk/GonkHal.cpp
@@ -418,17 +418,17 @@ CancelVibrate(const hal::WindowIdentifie
     return;
   }
   EnsureVibratorThreadInitialized();
   sVibratorRunnable->CancelVibrate();
 }
 
 namespace {
 
-class BatteryUpdater : public nsRunnable {
+class BatteryUpdater : public Runnable {
 public:
   NS_IMETHOD Run()
   {
     hal::BatteryInformation info;
     hal_impl::GetCurrentBatteryInformation(&info);
 
     // Control the battery indicator (led light) here using BatteryInformation
     // we just retrieved.
@@ -1038,17 +1038,17 @@ public:
   static int sNextGeneration;
 
 };
 
 int AlarmData::sNextGeneration = 0;
 
 AlarmData* sAlarmData = nullptr;
 
-class AlarmFiredEvent : public nsRunnable {
+class AlarmFiredEvent : public Runnable {
 public:
   AlarmFiredEvent(int aGeneration) : mGeneration(aGeneration) {}
 
   NS_IMETHOD Run() {
     // Guard against spurious notifications caused by an alarm firing
     // concurrently with it being disabled.
     if (sAlarmData && !sAlarmData->mShuttingDown &&
         mGeneration == sAlarmData->mGeneration) {
@@ -1971,17 +1971,17 @@ namespace {
 /**
  * This class sets the priority of threads given the kernel thread's id and a
  * value taken from hal::ThreadPriority.
  *
  * This runnable must always be dispatched to the main thread otherwise it will fail.
  * We have to run this from the main thread since preferences can only be read on
  * main thread.
  */
-class SetThreadPriorityRunnable : public nsRunnable
+class SetThreadPriorityRunnable : public Runnable
 {
 public:
   SetThreadPriorityRunnable(pid_t aThreadId, hal::ThreadPriority aThreadPriority)
     : mThreadId(aThreadId)
     , mThreadPriority(aThreadPriority)
   { }
 
   NS_IMETHOD Run()
--- a/hal/gonk/GonkSensor.cpp
+++ b/hal/gonk/GonkSensor.cpp
@@ -121,17 +121,17 @@ SensorseventStatus(const sensors_event_t
       return data.acceleration.status;
     case SENSOR_GYROSCOPE:
       return data.gyro.status;
   }
 
   return SENSOR_STATUS_UNRELIABLE;
 }
 
-class SensorRunnable : public nsRunnable
+class SensorRunnable : public Runnable
 {
 public:
   SensorRunnable(const sensors_event_t& data, const sensor_t* sensors, ssize_t size)
   {
     mSensorData.sensor() = HardwareSensorToHalSensor(data.type);
     mSensorData.accuracy() = HardwareStatusToHalAccuracy(SensorseventStatus(data));
     mSensorData.timestamp() = data.timestamp;
     if (mSensorData.sensor() == SENSOR_GYROSCOPE) {
--- a/hal/gonk/GonkSwitch.cpp
+++ b/hal/gonk/GonkSwitch.cpp
@@ -207,17 +207,17 @@ protected:
     return aState[0] == '0' ? SWITCH_STATE_OFF :
       (aState[0] == '1' ? SWITCH_STATE_HEADSET : SWITCH_STATE_HEADPHONE);
   }
 };
 
 
 typedef nsTArray<RefPtr<SwitchHandler> > SwitchHandlerArray;
 
-class SwitchEventRunnable : public nsRunnable
+class SwitchEventRunnable : public Runnable
 {
 public:
   SwitchEventRunnable(SwitchEvent& aEvent) : mEvent(aEvent)
   {
   }
 
   NS_IMETHOD Run()
   {
--- a/ipc/hal/DaemonRunnables.h
+++ b/ipc/hal/DaemonRunnables.h
@@ -11,17 +11,17 @@
 #include "mozilla/UniquePtr.h"
 #include "nsThreadUtils.h"
 
 namespace mozilla {
 namespace ipc {
 
 namespace details {
 
-class DaemonRunnable : public nsRunnable
+class DaemonRunnable : public Runnable
 {
 protected:
   DaemonRunnable() = default;
   virtual ~DaemonRunnable() = default;
 
   template<typename Out, typename In>
   static Out& ConvertArg(In& aArg)
   {
--- a/ipc/netd/Netd.cpp
+++ b/ipc/netd/Netd.cpp
@@ -26,17 +26,17 @@
 
 using mozilla::system::Property;
 
 namespace {
 
 RefPtr<mozilla::ipc::NetdClient> gNetdClient;
 RefPtr<mozilla::ipc::NetdConsumer> gNetdConsumer;
 
-class StopNetdConsumer : public nsRunnable {
+class StopNetdConsumer : public mozilla::Runnable {
 public:
   NS_IMETHOD Run()
   {
     MOZ_ASSERT(NS_IsMainThread());
 
     gNetdConsumer = nullptr;
     return NS_OK;
   }
--- a/netwerk/protocol/rtsp/RtspChannelChild.cpp
+++ b/netwerk/protocol/rtsp/RtspChannelChild.cpp
@@ -77,17 +77,17 @@ NS_IMPL_ISUPPORTS_INHERITED(RtspChannelC
 //-----------------------------------------------------------------------------
 NS_IMETHODIMP
 RtspChannelChild::GetContentType(nsACString& aContentType)
 {
   aContentType.AssignLiteral("RTSP");
   return NS_OK;
 }
 
-class CallListenerOnStartRequestEvent : public nsRunnable
+class CallListenerOnStartRequestEvent : public Runnable
 {
 public:
   CallListenerOnStartRequestEvent(nsIStreamListener *aListener,
                                   nsIRequest *aRequest, nsISupports *aContext)
     : mListener(aListener)
     , mRequest(aRequest)
     , mContext(aContext)
   {
@@ -180,17 +180,17 @@ RtspChannelChild::OnDataAvailable(nsIReq
                                   uint32_t aCount)
 {
   MOZ_CRASH("Should never be called");
 }
 
 //-----------------------------------------------------------------------------
 // nsBaseChannel::nsIChannel::nsIRequest
 //-----------------------------------------------------------------------------
-class CallListenerOnStopRequestEvent : public nsRunnable
+class CallListenerOnStopRequestEvent : public Runnable
 {
 public:
   CallListenerOnStopRequestEvent(nsIStreamListener *aListener,
                                  nsIRequest *aRequest,
                                  nsISupports *aContext, nsresult aStatus)
     : mListener(aListener)
     , mRequest(aRequest)
     , mContext(aContext)
--- a/netwerk/protocol/rtsp/controller/RtspController.cpp
+++ b/netwerk/protocol/rtsp/controller/RtspController.cpp
@@ -190,17 +190,17 @@ RtspController::AsyncOpen(nsIStreamingPr
   mRtspSource->start();
 
   return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // nsIStreamingProtocolListener
 //-----------------------------------------------------------------------------
-class SendMediaDataTask : public nsRunnable
+class SendMediaDataTask : public Runnable
 {
 public:
   SendMediaDataTask(nsIStreamingProtocolListener *listener,
                     uint8_t index,
                     const nsACString & data,
                     uint32_t length,
                     uint32_t offset,
                     nsIStreamingProtocolMetaData *meta)
@@ -240,17 +240,17 @@ RtspController::OnMediaDataAvailable(uin
   if (mListener && mState == CONNECTED) {
     RefPtr<SendMediaDataTask> task =
       new SendMediaDataTask(mListener, index, data, length, offset, meta);
     return NS_DispatchToMainThread(task);
   }
   return NS_ERROR_NOT_AVAILABLE;
 }
 
-class SendOnConnectedTask : public nsRunnable
+class SendOnConnectedTask : public Runnable
 {
 public:
   SendOnConnectedTask(nsIStreamingProtocolListener *listener,
                       uint8_t index,
                       nsIStreamingProtocolMetaData *meta)
     : mListener(listener)
     , mIndex(index)
     , mMetaData(meta)
@@ -279,17 +279,17 @@ RtspController::OnConnected(uint8_t inde
   if (mListener) {
     RefPtr<SendOnConnectedTask> task =
       new SendOnConnectedTask(mListener, index, meta);
     return NS_DispatchToMainThread(task);
   }
   return NS_ERROR_NOT_AVAILABLE;
 }
 
-class SendOnDisconnectedTask : public nsRunnable
+class SendOnDisconnectedTask : public Runnable
 {
 public:
   SendOnDisconnectedTask(nsIStreamingProtocolListener *listener,
                          uint8_t index,
                          nsresult reason)
     : mListener(listener)
     , mIndex(index)
     , mReason(reason)
--- a/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp
+++ b/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp
@@ -249,17 +249,17 @@ enum IPCEvent
   SendNoneEvent = 0,
   SendPlayEvent,
   SendPauseEvent,
   SendSeekEvent,
   SendStopEvent,
   SendPlaybackEndedEvent
 };
 
-class SendIPCEvent : public nsRunnable
+class SendIPCEvent : public Runnable
 {
 public:
   SendIPCEvent(RtspControllerChild *aController, IPCEvent aEvent)
     : mController(aController)
     , mEvent(aEvent)
     , mSeekTime(0)
   {
   }
--- a/toolkit/xre/EventTracer.cpp
+++ b/toolkit/xre/EventTracer.cpp
@@ -81,17 +81,17 @@ PRThread* sTracerThread = nullptr;
 bool sExit = false;
 
 struct TracerStartClosure {
   bool mLogTracing;
   int32_t mThresholdInterval;
 };
 
 #ifdef MOZ_WIDGET_GONK
-class EventLoopLagDispatcher : public nsRunnable
+class EventLoopLagDispatcher : public Runnable
 {
   public:
     explicit EventLoopLagDispatcher(int aLag)
       : mLag(aLag) {}
 
     NS_IMETHODIMP Run()
     {
       nsCOMPtr<nsIObserverService> obsService =
--- a/widget/gonk/GonkPermission.cpp
+++ b/widget/gonk/GonkPermission.cpp
@@ -34,17 +34,17 @@
 #define ALOGE(args...)  __android_log_print(ANDROID_LOG_ERROR, "gonkperm" , ## args)
 
 using namespace android;
 using namespace mozilla;
 
 // Checking permissions needs to happen on the main thread, but the
 // binder callback is called on a special binder thread, so we use
 // this runnable for that.
-class GonkPermissionChecker : public nsRunnable {
+class GonkPermissionChecker : public Runnable {
   int32_t mPid;
   bool mCanUseCamera;
 
   explicit GonkPermissionChecker(int32_t pid)
     : mPid(pid)
     , mCanUseCamera(false)
   {
   }
--- a/widget/gonk/HwcComposer2D.cpp
+++ b/widget/gonk/HwcComposer2D.cpp
@@ -201,17 +201,17 @@ HwcComposer2D::Invalidate()
 
     MutexAutoLock lock(mLock);
     if (mCompositorBridgeParent) {
         mCompositorBridgeParent->ScheduleRenderOnCompositorThread();
     }
 }
 
 namespace {
-class HotplugEvent : public nsRunnable {
+class HotplugEvent : public Runnable {
 public:
     HotplugEvent(GonkDisplay::DisplayType aType, bool aConnected)
         : mType(aType)
         , mConnected(aConnected)
     {
     }
 
     NS_IMETHOD Run()
--- a/widget/gonk/WidgetTraceEvent.cpp
+++ b/widget/gonk/WidgetTraceEvent.cpp
@@ -8,17 +8,17 @@
 #include <mozilla/CondVar.h>
 #include <mozilla/Mutex.h>
 
 using mozilla::CondVar;
 using mozilla::Mutex;
 using mozilla::MutexAutoLock;
 
 namespace mozilla {
-  class TracerRunnable : public nsRunnable {
+  class TracerRunnable : public Runnable {
     public:
       TracerRunnable() {
         mTracerLock = new Mutex("TracerRunnable");
         mTracerCondVar = new CondVar(*mTracerLock, "TracerRunnable");
         mMainThread = do_GetMainThread();
       }
 
       ~TracerRunnable() {
--- a/widget/gonk/nativewindow/FakeSurfaceComposer.cpp
+++ b/widget/gonk/nativewindow/FakeSurfaceComposer.cpp
@@ -96,17 +96,17 @@ sp<ISurfaceComposerClient> FakeSurfaceCo
 }
 
 sp<IGraphicBufferAlloc> FakeSurfaceComposer::createGraphicBufferAlloc()
 {
     sp<GraphicBufferAlloc> gba(new GraphicBufferAlloc());
     return gba;
 }
 
-class DestroyDisplayRunnable : public nsRunnable {
+class DestroyDisplayRunnable : public Runnable {
 public:
     DestroyDisplayRunnable(FakeSurfaceComposer* aComposer, ssize_t aIndex)
         : mComposer(aComposer), mIndex(aIndex) { }
     NS_IMETHOD Run() override {
         MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread.");
         Mutex::Autolock _l(mComposer->mStateLock);
         RefPtr<nsScreenManagerGonk> screenManager =
             nsScreenManagerGonk::GetInstance();
--- a/widget/gonk/nsAppShell.cpp
+++ b/widget/gonk/nsAppShell.cpp
@@ -349,17 +349,17 @@ KeyEventDispatcher::DispatchKeyDownEvent
 }
 
 void
 KeyEventDispatcher::DispatchKeyUpEvent()
 {
     DispatchKeyEventInternal(eKeyUp);
 }
 
-class SwitchEventRunnable : public nsRunnable {
+class SwitchEventRunnable : public mozilla::Runnable {
 public:
     SwitchEventRunnable(hal::SwitchEvent& aEvent) : mEvent(aEvent)
     {}
 
     NS_IMETHOD Run()
     {
         hal::NotifySwitchStateFromInputDevice(mEvent.device(),
           mEvent.status());
--- a/widget/gonk/nsScreenManagerGonk.cpp
+++ b/widget/gonk/nsScreenManagerGonk.cpp
@@ -51,17 +51,17 @@ using namespace mozilla;
 using namespace mozilla::hal;
 using namespace mozilla::gfx;
 using namespace mozilla::gl;
 using namespace mozilla::layers;
 using namespace mozilla::dom;
 
 namespace {
 
-class ScreenOnOffEvent : public nsRunnable {
+class ScreenOnOffEvent : public mozilla::Runnable {
 public:
     ScreenOnOffEvent(bool on)
         : mIsOn(on)
     {}
 
     NS_IMETHOD Run() {
         // Notify observers that the screen state has just changed.
         nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
@@ -969,17 +969,17 @@ private:
     virtual ~DisplayInfo() {}
 
     uint32_t mId;
     bool mConnected;
 };
 
 NS_IMPL_ISUPPORTS(DisplayInfo, nsIDisplayInfo, nsISupports)
 
-class NotifyTask : public nsRunnable {
+class NotifyTask : public mozilla::Runnable {
 public:
     NotifyTask(uint32_t aId, bool aConnected)
         : mDisplayInfo(new DisplayInfo(aId, aConnected))
     {
     }
 
     NS_IMETHOD Run()
     {
--- a/widget/gonk/nsScreenManagerGonk.h
+++ b/widget/gonk/nsScreenManagerGonk.h
@@ -26,25 +26,25 @@
 #include "mozilla/Mutex.h"
 #include "nsBaseScreen.h"
 #include "nsCOMPtr.h"
 #include "nsIScreenManager.h"
 #include "nsProxyRelease.h"
 
 #include <android/native_window.h>
 
-class nsRunnable;
 class nsWindow;
 
 namespace android {
     class DisplaySurface;
     class IGraphicBufferProducer;
 };
 
 namespace mozilla {
+    class Runnable;
 namespace gl {
     class GLContext;
 }
 namespace layers {
 class CompositorVsyncScheduler;
 class CompositorBridgeParent;
 }
 }
@@ -211,18 +211,18 @@ public:
 protected:
     ~nsScreenManagerGonk();
     void VsyncControl(bool aEnabled);
     uint32_t GetIdFromType(GonkDisplay::DisplayType aDisplayType);
     bool IsScreenConnected(uint32_t aId);
 
     bool mInitialized;
     nsTArray<RefPtr<nsScreenGonk>> mScreens;
-    RefPtr<nsRunnable> mScreenOnEvent;
-    RefPtr<nsRunnable> mScreenOffEvent;
+    RefPtr<mozilla::Runnable> mScreenOnEvent;
+    RefPtr<mozilla::Runnable> mScreenOffEvent;
 
 #if ANDROID_VERSION >= 19
     bool mDisplayEnabled;
     RefPtr<mozilla::layers::CompositorVsyncScheduler> mCompositorVsyncScheduler;
 #endif
 };
 
 #endif /* nsScreenManagerGonk_h___ */
--- a/widget/gonk/nsWindow.cpp
+++ b/widget/gonk/nsWindow.cpp
@@ -156,17 +156,17 @@ nsWindow::DispatchTouchInput(MultiTouchI
 
     if (!gFocusedWindow) {
         return;
     }
 
     gFocusedWindow->DispatchTouchInputViaAPZ(aInput);
 }
 
-class DispatchTouchInputOnMainThread : public nsRunnable
+class DispatchTouchInputOnMainThread : public mozilla::Runnable
 {
 public:
     DispatchTouchInputOnMainThread(const MultiTouchInput& aInput,
                                    const ScrollableLayerGuid& aGuid,
                                    const uint64_t& aInputBlockId,
                                    nsEventStatus aApzResponse)
       : mInput(aInput)
       , mGuid(aGuid)