Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Mon, 30 Apr 2018 19:46:04 +0300
changeset 461394 17e1f96d453f869f9bb64cc1d889320ca2b4adba
parent 461393 fef27fa9d5a7509a3e714fa9b1b33f9ee3893160
child 461395 daac5f4217b6a5c8b0607dcf5bdd713e68fc8529
push id166
push userfmarier@mozilla.com
push dateThu, 10 May 2018 00:43:18 +0000
reviewersvalentin
bugs1457411
milestone61.0a1
Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin MozReview-Commit-ID: 666LNaHyiuQ
netwerk/base/ARefBase.h
netwerk/base/ArrayBufferInputStream.h
netwerk/base/BackgroundFileSaver.cpp
netwerk/base/BackgroundFileSaver.h
netwerk/base/ChannelDiverterChild.cpp
netwerk/base/ChannelDiverterChild.h
netwerk/base/ChannelDiverterParent.cpp
netwerk/base/ChannelDiverterParent.h
netwerk/base/Dashboard.cpp
netwerk/base/Dashboard.h
netwerk/base/EventTokenBucket.cpp
netwerk/base/LoadContextInfo.cpp
netwerk/base/LoadContextInfo.h
netwerk/base/LoadInfo.cpp
netwerk/base/LoadInfo.h
netwerk/base/MemoryDownloader.cpp
netwerk/base/MemoryDownloader.h
netwerk/base/NetworkInfoServiceCocoa.cpp
netwerk/base/Predictor.cpp
netwerk/base/Predictor.h
netwerk/base/ProxyAutoConfig.cpp
netwerk/base/RedirectChannelRegistrar.h
netwerk/base/RequestContextService.cpp
netwerk/base/SimpleBuffer.h
netwerk/base/SimpleChannel.cpp
netwerk/base/SimpleChannel.h
netwerk/base/TCPFastOpenLayer.cpp
netwerk/base/TLSServerSocket.cpp
netwerk/base/TLSServerSocket.h
netwerk/base/Tickler.h
netwerk/base/nsAuthInformationHolder.h
netwerk/base/nsBase64Encoder.h
netwerk/base/nsBaseContentStream.h
netwerk/base/nsBufferedStreams.h
netwerk/base/nsDNSPrefetch.h
netwerk/base/nsIOService.cpp
netwerk/base/nsIncrementalDownload.cpp
netwerk/base/nsIncrementalStreamLoader.cpp
netwerk/base/nsIncrementalStreamLoader.h
netwerk/base/nsInputStreamChannel.h
netwerk/base/nsInputStreamPump.cpp
netwerk/base/nsInputStreamPump.h
netwerk/base/nsMIMEInputStream.cpp
netwerk/base/nsNetAddr.h
netwerk/base/nsNetUtil.cpp
netwerk/base/nsNetUtil.h
netwerk/base/nsNetworkInfoService.cpp
netwerk/base/nsPreloadedStream.cpp
netwerk/base/nsProtocolProxyService.cpp
netwerk/base/nsReadLine.h
netwerk/base/nsRedirectHistoryEntry.cpp
netwerk/base/nsRedirectHistoryEntry.h
netwerk/base/nsRequestObserverProxy.cpp
netwerk/base/nsRequestObserverProxy.h
netwerk/base/nsSecCheckWrapChannel.cpp
netwerk/base/nsSecCheckWrapChannel.h
netwerk/base/nsSerializationHelper.h
netwerk/base/nsServerSocket.cpp
netwerk/base/nsSimpleNestedURI.h
netwerk/base/nsSimpleStreamListener.h
netwerk/base/nsSimpleURI.cpp
netwerk/base/nsSimpleURI.h
netwerk/base/nsSocketTransport2.cpp
netwerk/base/nsSocketTransport2.h
netwerk/base/nsSocketTransportService2.cpp
netwerk/base/nsSocketTransportService2.h
netwerk/base/nsStandardURL.cpp
netwerk/base/nsStandardURL.h
netwerk/base/nsStreamListenerTee.h
netwerk/base/nsStreamListenerWrapper.h
netwerk/base/nsStreamLoader.cpp
netwerk/base/nsStreamLoader.h
netwerk/base/nsStreamTransportService.cpp
netwerk/base/nsSyncStreamListener.h
netwerk/base/nsTransportUtils.cpp
netwerk/base/nsUDPSocket.cpp
netwerk/base/nsUDPSocket.h
netwerk/base/nsURLParsers.cpp
netwerk/base/nsURLParsers.h
netwerk/cache/nsApplicationCacheService.cpp
netwerk/cache/nsApplicationCacheService.h
netwerk/cache/nsCacheEntry.cpp
netwerk/cache/nsCacheEntry.h
netwerk/cache/nsCacheEntryDescriptor.cpp
netwerk/cache/nsCacheEntryDescriptor.h
netwerk/cache/nsCacheService.cpp
netwerk/cache/nsCacheUtils.cpp
netwerk/cache/nsCacheUtils.h
netwerk/cache/nsDiskCacheBinding.cpp
netwerk/cache/nsDiskCacheDevice.cpp
netwerk/cache/nsDiskCacheDeviceSQL.cpp
netwerk/cache/nsDiskCacheDeviceSQL.h
netwerk/cache/nsDiskCacheEntry.h
netwerk/cache/nsDiskCacheMap.cpp
netwerk/cache/nsMemoryCacheDevice.cpp
netwerk/cache/nsMemoryCacheDevice.h
netwerk/cache2/CacheEntry.cpp
netwerk/cache2/CacheEntry.h
netwerk/cache2/CacheFile.cpp
netwerk/cache2/CacheFileIOManager.cpp
netwerk/cache2/CacheFileInputStream.cpp
netwerk/cache2/CacheFileOutputStream.cpp
netwerk/cache2/CacheFileUtils.cpp
netwerk/cache2/CacheFileUtils.h
netwerk/cache2/CacheHashUtils.h
netwerk/cache2/CacheIOThread.cpp
netwerk/cache2/CacheIndex.cpp
netwerk/cache2/CacheIndexContextIterator.cpp
netwerk/cache2/CacheIndexContextIterator.h
netwerk/cache2/CacheObserver.h
netwerk/cache2/CacheStorage.cpp
netwerk/cache2/CacheStorage.h
netwerk/cache2/CacheStorageService.cpp
netwerk/cache2/CacheStorageService.h
netwerk/cache2/OldWrappers.cpp
netwerk/cache2/OldWrappers.h
netwerk/cookie/CookieServiceParent.cpp
netwerk/cookie/CookieServiceParent.h
netwerk/cookie/nsCookie.h
netwerk/cookie/nsCookieKey.h
netwerk/cookie/nsCookieService.h
netwerk/dns/ChildDNSService.cpp
netwerk/dns/ChildDNSService.h
netwerk/dns/DNSRequestChild.cpp
netwerk/dns/DNSRequestParent.cpp
netwerk/dns/DNSRequestParent.h
netwerk/dns/TRR.cpp
netwerk/dns/TRRService.cpp
netwerk/dns/mdns/libmdns/MDNSResponderReply.cpp
netwerk/dns/mdns/libmdns/MDNSResponderReply.h
netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.cpp
netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.h
netwerk/dns/nsHostResolver.h
netwerk/ipc/ChannelEventQueue.cpp
netwerk/ipc/NeckoChild.cpp
netwerk/ipc/NeckoChild.h
netwerk/ipc/NeckoParent.cpp
netwerk/ipc/NeckoParent.h
netwerk/mime/nsMIMEHeaderParamImpl.h
netwerk/protocol/about/nsAboutBlank.h
netwerk/protocol/about/nsAboutCache.h
netwerk/protocol/about/nsAboutCacheEntry.h
netwerk/protocol/about/nsAboutProtocolHandler.h
netwerk/protocol/data/DataChannelChild.cpp
netwerk/protocol/data/DataChannelChild.h
netwerk/protocol/data/DataChannelParent.cpp
netwerk/protocol/data/DataChannelParent.h
netwerk/protocol/data/nsDataChannel.cpp
netwerk/protocol/data/nsDataHandler.cpp
netwerk/protocol/data/nsDataHandler.h
netwerk/protocol/file/FileChannelChild.h
netwerk/protocol/file/FileChannelParent.cpp
netwerk/protocol/file/FileChannelParent.h
netwerk/protocol/file/nsFileChannel.cpp
netwerk/protocol/file/nsFileChannel.h
netwerk/protocol/file/nsFileProtocolHandler.cpp
netwerk/protocol/file/nsFileProtocolHandler.h
netwerk/protocol/ftp/FTPChannelChild.cpp
netwerk/protocol/ftp/FTPChannelParent.cpp
netwerk/protocol/ftp/nsFTPChannel.cpp
netwerk/protocol/ftp/nsFTPChannel.h
netwerk/protocol/ftp/nsFtpConnectionThread.cpp
netwerk/protocol/http/ASpdySession.cpp
netwerk/protocol/http/ASpdySession.h
netwerk/protocol/http/AltDataOutputStreamChild.cpp
netwerk/protocol/http/AltDataOutputStreamChild.h
netwerk/protocol/http/AlternateServices.h
netwerk/protocol/http/Http2Compression.cpp
netwerk/protocol/http/Http2Compression.h
netwerk/protocol/http/Http2Push.h
netwerk/protocol/http/Http2Session.cpp
netwerk/protocol/http/Http2Session.h
netwerk/protocol/http/HttpBackgroundChannelChild.cpp
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/HttpBaseChannel.h
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/HttpChannelChild.h
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/protocol/http/HttpChannelParentListener.cpp
netwerk/protocol/http/HttpChannelParentListener.h
netwerk/protocol/http/InterceptedChannel.cpp
netwerk/protocol/http/InterceptedChannel.h
netwerk/protocol/http/NullHttpChannel.h
netwerk/protocol/http/NullHttpTransaction.cpp
netwerk/protocol/http/PSpdyPush.h
netwerk/protocol/http/TunnelUtils.cpp
netwerk/protocol/http/nsCORSListenerProxy.cpp
netwerk/protocol/http/nsCORSListenerProxy.h
netwerk/protocol/http/nsHttp.cpp
netwerk/protocol/http/nsHttpActivityDistributor.cpp
netwerk/protocol/http/nsHttpActivityDistributor.h
netwerk/protocol/http/nsHttpAuthCache.h
netwerk/protocol/http/nsHttpAuthManager.cpp
netwerk/protocol/http/nsHttpAuthManager.h
netwerk/protocol/http/nsHttpBasicAuth.cpp
netwerk/protocol/http/nsHttpBasicAuth.h
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpChunkedDecoder.cpp
netwerk/protocol/http/nsHttpConnectionMgr.cpp
netwerk/protocol/http/nsHttpConnectionMgr.h
netwerk/protocol/http/nsHttpDigestAuth.cpp
netwerk/protocol/http/nsHttpDigestAuth.h
netwerk/protocol/http/nsHttpHandler.h
netwerk/protocol/http/nsHttpHeaderArray.cpp
netwerk/protocol/http/nsHttpNTLMAuth.cpp
netwerk/protocol/http/nsHttpNTLMAuth.h
netwerk/protocol/http/nsHttpResponseHead.cpp
netwerk/protocol/http/nsHttpTransaction.cpp
netwerk/protocol/res/ExtensionProtocolHandler.cpp
netwerk/protocol/res/ExtensionProtocolHandler.h
netwerk/protocol/res/SubstitutingProtocolHandler.h
netwerk/protocol/res/nsResProtocolHandler.h
netwerk/protocol/viewsource/nsViewSourceChannel.h
netwerk/protocol/websocket/BaseWebSocketChannel.cpp
netwerk/protocol/websocket/IPCTransportProvider.cpp
netwerk/protocol/websocket/IPCTransportProvider.h
netwerk/protocol/websocket/WebSocketChannel.cpp
netwerk/protocol/websocket/WebSocketChannel.h
netwerk/protocol/websocket/WebSocketChannelParent.cpp
netwerk/protocol/websocket/WebSocketChannelParent.h
netwerk/protocol/websocket/WebSocketEventService.cpp
netwerk/protocol/websocket/WebSocketFrame.cpp
netwerk/protocol/websocket/WebSocketFrame.h
netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp
netwerk/protocol/wyciwyg/WyciwygChannelParent.h
netwerk/sctp/datachannel/DataChannel.cpp
netwerk/sctp/datachannel/DataChannel.h
netwerk/sctp/datachannel/DataChannelListener.h
netwerk/socket/nsSOCKSSocketProvider.h
netwerk/socket/nsSocketProviderService.h
netwerk/socket/nsUDPSocketProvider.cpp
netwerk/socket/nsUDPSocketProvider.h
netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
netwerk/streamconv/converters/mozTXTToHTMLConv.h
netwerk/streamconv/converters/nsDirIndex.cpp
netwerk/streamconv/converters/nsDirIndex.h
netwerk/streamconv/converters/nsDirIndexParser.cpp
netwerk/streamconv/converters/nsDirIndexParser.h
netwerk/streamconv/converters/nsFTPDirListingConv.cpp
netwerk/streamconv/converters/nsIndexedToHTML.cpp
netwerk/streamconv/converters/nsIndexedToHTML.h
netwerk/streamconv/converters/nsMultiMixedConv.cpp
netwerk/streamconv/converters/nsMultiMixedConv.h
netwerk/streamconv/converters/nsUnknownDecoder.cpp
netwerk/streamconv/converters/nsUnknownDecoder.h
netwerk/streamconv/nsStreamConverterService.cpp
netwerk/streamconv/nsStreamConverterService.h
netwerk/system/mac/nsNetworkLinkService.mm
netwerk/wifi/nsWifiAccessPoint.cpp
netwerk/wifi/nsWifiAccessPoint.h
netwerk/wifi/nsWifiMonitor.cpp
netwerk/wifi/nsWifiMonitor.h
--- a/netwerk/base/ARefBase.h
+++ b/netwerk/base/ARefBase.h
@@ -14,18 +14,18 @@ namespace mozilla { namespace net {
 // This is an abstract class that can be pointed to by either
 // nsCOMPtr or nsRefPtr. nsHttpConnectionMgr uses it for generic
 // objects that need to be reference counted - similiar to nsISupports
 // but it may or may not be xpcom.
 
 class ARefBase
 {
 public:
-  ARefBase() {}
-  virtual ~ARefBase() {}
+  ARefBase() = default;
+  virtual ~ARefBase() = default;
 
   NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING
 };
 
 } // namespace net
 } // namespace mozilla
 
 #endif
--- a/netwerk/base/ArrayBufferInputStream.h
+++ b/netwerk/base/ArrayBufferInputStream.h
@@ -25,16 +25,16 @@ class ArrayBufferInputStream : public ns
 public:
   ArrayBufferInputStream();
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIARRAYBUFFERINPUTSTREAM
   NS_DECL_NSIINPUTSTREAM
 
 private:
-  virtual ~ArrayBufferInputStream() {}
+  virtual ~ArrayBufferInputStream() = default;
   mozilla::UniquePtr<char[]> mArrayBuffer;
   uint32_t mBufferLength;
   uint32_t mPos;
   bool mClosed;
 };
 
 #endif // ArrayBufferInputStream_h
--- a/netwerk/base/BackgroundFileSaver.cpp
+++ b/netwerk/base/BackgroundFileSaver.cpp
@@ -913,20 +913,16 @@ NS_IMPL_ISUPPORTS(BackgroundFileSaverOut
                   nsIOutputStreamCallback)
 
 BackgroundFileSaverOutputStream::BackgroundFileSaverOutputStream()
 : BackgroundFileSaver()
 , mAsyncWaitCallback(nullptr)
 {
 }
 
-BackgroundFileSaverOutputStream::~BackgroundFileSaverOutputStream()
-{
-}
-
 bool
 BackgroundFileSaverOutputStream::HasInfiniteBuffer()
 {
   return false;
 }
 
 nsAsyncCopyProgressFun
 BackgroundFileSaverOutputStream::GetProgressCallback()
@@ -1018,20 +1014,16 @@ BackgroundFileSaverStreamListener::Backg
 : BackgroundFileSaver()
 , mSuspensionLock("BackgroundFileSaverStreamListener.mSuspensionLock")
 , mReceivedTooMuchData(false)
 , mRequest(nullptr)
 , mRequestSuspended(false)
 {
 }
 
-BackgroundFileSaverStreamListener::~BackgroundFileSaverStreamListener()
-{
-}
-
 bool
 BackgroundFileSaverStreamListener::HasInfiniteBuffer()
 {
   return true;
 }
 
 nsAsyncCopyProgressFun
 BackgroundFileSaverStreamListener::GetProgressCallback()
--- a/netwerk/base/BackgroundFileSaver.h
+++ b/netwerk/base/BackgroundFileSaver.h
@@ -307,17 +307,17 @@ public:
 
   BackgroundFileSaverOutputStream();
 
 protected:
   virtual bool HasInfiniteBuffer() override;
   virtual nsAsyncCopyProgressFun GetProgressCallback() override;
 
 private:
-  ~BackgroundFileSaverOutputStream();
+  ~BackgroundFileSaverOutputStream() = default;
 
   /**
    * Original callback provided to our AsyncWait wrapper.
    */
   nsCOMPtr<nsIOutputStreamCallback> mAsyncWaitCallback;
 };
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -334,17 +334,17 @@ public:
 
   BackgroundFileSaverStreamListener();
 
 protected:
   virtual bool HasInfiniteBuffer() override;
   virtual nsAsyncCopyProgressFun GetProgressCallback() override;
 
 private:
-  ~BackgroundFileSaverStreamListener();
+  ~BackgroundFileSaverStreamListener() = default;
 
   /**
    * Protects the state related to whether the request should be suspended.
    */
   mozilla::Mutex mSuspensionLock;
 
   /**
    * Whether we should suspend the request because we received too much data.
@@ -380,23 +380,23 @@ class DigestOutputStream : public nsIOut
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIOUTPUTSTREAM
   // Constructor. Neither parameter may be null. The caller owns both.
   DigestOutputStream(nsIOutputStream* outputStream, PK11Context* aContext);
 
 private:
-  virtual ~DigestOutputStream() {}
+  virtual ~DigestOutputStream() = default;
 
   // Calls to write are passed to this stream.
   nsCOMPtr<nsIOutputStream> mOutputStream;
   // Digest context used to compute the hash, owned by the caller.
   PK11Context* mDigestContext;
 
   // Don't accidentally copy construct.
-  DigestOutputStream(const DigestOutputStream& d);
+  DigestOutputStream(const DigestOutputStream& d) = delete;
 };
 
 } // namespace net
 } // namespace mozilla
 
 #endif
--- a/netwerk/base/ChannelDiverterChild.cpp
+++ b/netwerk/base/ChannelDiverterChild.cpp
@@ -10,18 +10,10 @@
 #include "mozilla/net/FTPChannelChild.h"
 #include "mozilla/net/PHttpChannelChild.h"
 #include "mozilla/net/PFTPChannelChild.h"
 #include "nsIDivertableChannel.h"
 
 namespace mozilla {
 namespace net {
 
-ChannelDiverterChild::ChannelDiverterChild()
-{
-}
-
-ChannelDiverterChild::~ChannelDiverterChild()
-{
-}
-
 } // namespace net
 } // namespace mozilla
--- a/netwerk/base/ChannelDiverterChild.h
+++ b/netwerk/base/ChannelDiverterChild.h
@@ -11,16 +11,16 @@
 
 namespace mozilla {
 namespace net {
 
 class ChannelDiverterChild :
   public PChannelDiverterChild
 {
 public:
-  ChannelDiverterChild();
-  virtual ~ChannelDiverterChild();
+  ChannelDiverterChild() = default;
+  virtual ~ChannelDiverterChild() = default;
 };
 
 } // namespace net
 } // namespace mozilla
 
 #endif /* _channeldiverterchild_h_ */
--- a/netwerk/base/ChannelDiverterParent.cpp
+++ b/netwerk/base/ChannelDiverterParent.cpp
@@ -10,24 +10,16 @@
 #include "mozilla/net/FTPChannelParent.h"
 #include "mozilla/net/PHttpChannelParent.h"
 #include "mozilla/net/PFTPChannelParent.h"
 #include "ADivertableParentChannel.h"
 
 namespace mozilla {
 namespace net {
 
-ChannelDiverterParent::ChannelDiverterParent()
-{
-}
-
-ChannelDiverterParent::~ChannelDiverterParent()
-{
-}
-
 bool
 ChannelDiverterParent::Init(const ChannelDiverterArgs& aArgs)
 {
   switch (aArgs.type()) {
   case ChannelDiverterArgs::THttpChannelDiverterArgs:
   {
     auto httpParent = static_cast<HttpChannelParent*>(
       aArgs.get_HttpChannelDiverterArgs().mChannelParent());
--- a/netwerk/base/ChannelDiverterParent.h
+++ b/netwerk/base/ChannelDiverterParent.h
@@ -16,18 +16,18 @@ namespace net {
 
 class ChannelDiverterArgs;
 class ADivertableParentChannel;
 
 class ChannelDiverterParent :
   public PChannelDiverterParent
 {
 public:
-  ChannelDiverterParent();
-  virtual ~ChannelDiverterParent();
+  ChannelDiverterParent() = default;
+  virtual ~ChannelDiverterParent() = default;
 
   bool Init(const ChannelDiverterArgs& aArgs);
 
   void DivertTo(nsIStreamListener* newListener);
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
 
 private:
--- a/netwerk/base/Dashboard.cpp
+++ b/netwerk/base/Dashboard.cpp
@@ -45,32 +45,28 @@ public:
 
     uint64_t mTotalSent;
     uint64_t mTotalRecv;
     nsTArray<SocketInfo> mData;
     nsMainThreadPtrHandle<NetDashboardCallback> mCallback;
     nsIEventTarget *mEventTarget;
 
 private:
-    virtual ~SocketData()
-    {
-    }
+    virtual ~SocketData() = default;
 };
 
 static void GetErrorString(nsresult rv, nsAString& errorString);
 
 NS_IMPL_ISUPPORTS0(SocketData)
 
 
 class HttpData
     : public nsISupports
 {
-    virtual ~HttpData()
-    {
-    }
+    virtual ~HttpData() = default;
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
 
     HttpData()
     {
         mEventTarget = nullptr;
     }
@@ -81,19 +77,17 @@ public:
 };
 
 NS_IMPL_ISUPPORTS0(HttpData)
 
 
 class WebSocketRequest
     : public nsISupports
 {
-    virtual ~WebSocketRequest()
-    {
-    }
+    virtual ~WebSocketRequest() = default;
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
 
     WebSocketRequest()
     {
         mEventTarget = nullptr;
     }
@@ -103,19 +97,17 @@ public:
 };
 
 NS_IMPL_ISUPPORTS0(WebSocketRequest)
 
 
 class DnsData
     : public nsISupports
 {
-    virtual ~DnsData()
-    {
-    }
+    virtual ~DnsData() = default;
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
 
     DnsData()
     {
         mEventTarget = nullptr;
     }
@@ -177,19 +169,17 @@ public:
 };
 
 NS_IMPL_ISUPPORTS(ConnectionData, nsITransportEventSink, nsITimerCallback, nsINamed)
 
 
 class RcwnData
     : public nsISupports
 {
-    virtual ~RcwnData()
-    {
-    }
+    virtual ~RcwnData() = default;
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
 
     RcwnData()
     {
         mEventTarget = nullptr;
     }
@@ -260,19 +250,17 @@ ConnectionData::StopTimer()
 }
 
 
 class LookupHelper;
 
 class LookupArgument
     : public nsISupports
 {
-    virtual ~LookupArgument()
-    {
-    }
+    virtual ~LookupArgument() = default;
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
 
     LookupArgument(nsIDNSRecord *aRecord, LookupHelper *aHelper)
     {
         mRecord = aRecord;
         mHelper = aHelper;
@@ -294,18 +282,17 @@ class LookupHelper final
             mCancel->Cancel(NS_ERROR_ABORT);
         }
     }
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIDNSLISTENER
 
-    LookupHelper() {
-    }
+    LookupHelper() = default;
 
     nsresult ConstructAnswer(LookupArgument *aArgument);
 public:
     nsCOMPtr<nsICancelable> mCancel;
     nsMainThreadPtrHandle<NetDashboardCallback> mCallback;
     nsIEventTarget *mEventTarget;
     nsresult mStatus;
 };
@@ -372,20 +359,16 @@ LookupHelper::ConstructAnswer(LookupArgu
 
 NS_IMPL_ISUPPORTS(Dashboard, nsIDashboard, nsIDashboardEventNotifier)
 
 Dashboard::Dashboard()
 {
     mEnableLogging = false;
 }
 
-Dashboard::~Dashboard()
-{
-}
-
 NS_IMETHODIMP
 Dashboard::RequestSockets(NetDashboardCallback *aCallback)
 {
     RefPtr<SocketData> socketData = new SocketData();
     socketData->mCallback =
         new nsMainThreadPtrHolder<NetDashboardCallback>(
           "NetDashboardCallback", aCallback, true);
     socketData->mEventTarget = GetCurrentThreadEventTarget();
@@ -1016,19 +999,19 @@ ErrorEntry socketTransportStatuses[] = {
         ERROR(NS_NET_STATUS_RECEIVING_FROM,         FAILURE(6)),
 };
 #undef ERROR
 
 
 static void
 GetErrorString(nsresult rv, nsAString& errorString)
 {
-    for (size_t i = 0; i < ArrayLength(socketTransportStatuses); ++i) {
-        if (socketTransportStatuses[i].key == rv) {
-            errorString.AssignASCII(socketTransportStatuses[i].error);
+    for (auto& socketTransportStatus : socketTransportStatuses) {
+        if (socketTransportStatus.key == rv) {
+            errorString.AssignASCII(socketTransportStatus.error);
             return;
         }
     }
     nsAutoCString errorCString;
     mozilla::GetErrorName(rv, errorCString);
     CopyUTF8toUTF16(errorCString, errorString);
 }
 
--- a/netwerk/base/Dashboard.h
+++ b/netwerk/base/Dashboard.h
@@ -79,17 +79,17 @@ private:
         mozilla::Mutex lock;
     };
 
 
     bool mEnableLogging;
     WebSocketData mWs;
 
 private:
-    virtual ~Dashboard();
+    virtual ~Dashboard() = default;
 
     nsresult GetSocketsDispatch(SocketData *);
     nsresult GetHttpDispatch(HttpData *);
     nsresult GetDnsInfoDispatch(DnsData *);
     nsresult TestNewConnection(ConnectionData *);
 
     /* Helper methods that pass the JSON to the callback function. */
     nsresult GetSockets(SocketData *);
--- a/netwerk/base/EventTokenBucket.cpp
+++ b/netwerk/base/EventTokenBucket.cpp
@@ -33,17 +33,17 @@ class TokenBucketCancelable : public nsI
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSICANCELABLE
 
   explicit TokenBucketCancelable(class ATokenBucketEvent *event);
   void Fire();
 
 private:
-  virtual ~TokenBucketCancelable() {}
+  virtual ~TokenBucketCancelable() = default;
 
   friend class EventTokenBucket;
   ATokenBucketEvent *mEvent;
 };
 
 NS_IMPL_ISUPPORTS(TokenBucketCancelable, nsICancelable)
 
 TokenBucketCancelable::TokenBucketCancelable(ATokenBucketEvent *event)
--- a/netwerk/base/LoadContextInfo.cpp
+++ b/netwerk/base/LoadContextInfo.cpp
@@ -17,21 +17,17 @@ namespace net {
 
 // LoadContextInfo
 
 NS_IMPL_ISUPPORTS(LoadContextInfo, nsILoadContextInfo)
 
 LoadContextInfo::LoadContextInfo(bool aIsAnonymous,
                                  OriginAttributes aOriginAttributes)
   : mIsAnonymous(aIsAnonymous)
-  , mOriginAttributes(aOriginAttributes)
-{
-}
-
-LoadContextInfo::~LoadContextInfo()
+  , mOriginAttributes(std::move(aOriginAttributes))
 {
 }
 
 NS_IMETHODIMP LoadContextInfo::GetIsPrivate(bool *aIsPrivate)
 {
   *aIsPrivate = mOriginAttributes.mPrivateBrowsingId > 0;
   return NS_OK;
 }
--- a/netwerk/base/LoadContextInfo.h
+++ b/netwerk/base/LoadContextInfo.h
@@ -17,26 +17,26 @@ class LoadContextInfo final : public nsI
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSILOADCONTEXTINFO
 
   LoadContextInfo(bool aIsAnonymous, OriginAttributes aOriginAttributes);
 
 private:
-  virtual ~LoadContextInfo();
+  virtual ~LoadContextInfo() = default;
 
 protected:
   bool mIsAnonymous : 1;
   OriginAttributes mOriginAttributes;
 };
 
 class LoadContextInfoFactory : public nsILoadContextInfoFactory
 {
-  virtual ~LoadContextInfoFactory() {}
+  virtual ~LoadContextInfoFactory() = default;
 public:
   NS_DECL_ISUPPORTS // deliberately not thread-safe
   NS_DECL_NSILOADCONTEXTINFOFACTORY
 };
 
 LoadContextInfo*
 GetLoadContextInfo(nsIChannel *aChannel);
 
--- a/netwerk/base/LoadInfo.cpp
+++ b/netwerk/base/LoadInfo.cpp
@@ -490,20 +490,16 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadin
   MOZ_ASSERT(mTriggeringPrincipal);
 
   mRedirectChainIncludingInternalRedirects.SwapElements(
     aRedirectChainIncludingInternalRedirects);
 
   mRedirectChain.SwapElements(aRedirectChain);
 }
 
-LoadInfo::~LoadInfo()
-{
-}
-
 void
 LoadInfo::ComputeIsThirdPartyContext(nsPIDOMWindowOuter* aOuterWindow)
 {
   nsContentPolicyType type =
     nsContentUtils::InternalContentPolicyTypeToExternal(mInternalContentPolicyType);
   if (type == nsIContentPolicy::TYPE_DOCUMENT) {
     // Top-level loads are never third-party.
     mIsThirdPartyContext = false;
--- a/netwerk/base/LoadInfo.h
+++ b/netwerk/base/LoadInfo.h
@@ -147,17 +147,17 @@ private:
   NS_IMETHOD GetRedirects(JSContext* aCx, JS::MutableHandle<JS::Value> aRedirects,
                           const RedirectHistoryArray& aArra);
 
   friend nsresult
   mozilla::ipc::LoadInfoArgsToLoadInfo(
     const mozilla::net::OptionalLoadInfoArgs& aLoadInfoArgs,
     nsILoadInfo** outLoadInfo);
 
-  ~LoadInfo();
+  ~LoadInfo() = default;
 
   void ComputeIsThirdPartyContext(nsPIDOMWindowOuter* aOuterWindow);
 
   // This function is the *only* function which can change the securityflags
   // of a loadinfo. It only exists because of the XHR code. Don't call it
   // from anywhere else!
   void SetIncludeCookiesSecFlag();
   friend class mozilla::dom::XMLHttpRequestMainThread;
--- a/netwerk/base/MemoryDownloader.cpp
+++ b/netwerk/base/MemoryDownloader.cpp
@@ -15,20 +15,16 @@ NS_IMPL_ISUPPORTS(MemoryDownloader,
 		  nsIStreamListener,
 		  nsIRequestObserver)
 
 MemoryDownloader::MemoryDownloader(IObserver* aObserver)
 : mObserver(aObserver)
 {
 }
 
-MemoryDownloader::~MemoryDownloader()
-{
-}
-
 NS_IMETHODIMP
 MemoryDownloader::OnStartRequest(nsIRequest* aRequest, nsISupports* aCtxt)
 {
   MOZ_ASSERT(!mData);
   mData.reset(new FallibleTArray<uint8_t>());
   mStatus = NS_OK;
   return NS_OK;
 }
--- a/netwerk/base/MemoryDownloader.h
+++ b/netwerk/base/MemoryDownloader.h
@@ -40,17 +40,17 @@ public:
                                     nsISupports* aCtxt,
                                     nsresult aStatus,
                                     Data aData) = 0;
   };
 
   explicit MemoryDownloader(IObserver* aObserver);
 
 private:
-  virtual ~MemoryDownloader();
+  virtual ~MemoryDownloader() = default;
 
   static nsresult ConsumeData(nsIInputStream *in,
                               void           *closure,
                               const char     *fromRawSegment,
                               uint32_t        toOffset,
                               uint32_t        count,
                               uint32_t       *writeCount);
 
--- a/netwerk/base/NetworkInfoServiceCocoa.cpp
+++ b/netwerk/base/NetworkInfoServiceCocoa.cpp
@@ -75,17 +75,17 @@ ListInterfaceAddresses(int aFd, const ch
         return NS_ERROR_FAILURE;
     }
 
     char host[128];
     int family;
     switch(family=ifreq.ifr_addr.sa_family) {
       case AF_INET:
       case AF_INET6:
-        getnameinfo(&ifreq.ifr_addr, sizeof(ifreq.ifr_addr), host, sizeof(host), 0, 0, NI_NUMERICHOST);
+        getnameinfo(&ifreq.ifr_addr, sizeof(ifreq.ifr_addr), host, sizeof(host), nullptr, 0, NI_NUMERICHOST);
         break;
       case AF_UNSPEC:
         return NS_OK;
       default:
         // Unknown family.
         return NS_OK;
     }
 
--- a/netwerk/base/Predictor.cpp
+++ b/netwerk/base/Predictor.cpp
@@ -190,19 +190,16 @@ Predictor::Action::Action(bool fullUri, 
   mStartTime = TimeStamp::Now();
   if (mPredict) {
     mPredictReason = reason.mPredict;
   } else {
     mLearnReason = reason.mLearn;
   }
 }
 
-Predictor::Action::~Action()
-{ }
-
 NS_IMETHODIMP
 Predictor::Action::OnCacheEntryCheck(nsICacheEntry *entry,
                                      nsIApplicationCache *appCache,
                                      uint32_t *result)
 {
   *result = nsICacheEntryOpenCallback::ENTRY_WANTED;
   return NS_OK;
 }
@@ -463,17 +460,17 @@ namespace {
 class PredictorThreadShutdownRunner : public Runnable
 {
 public:
   PredictorThreadShutdownRunner(nsIThread* ioThread, bool success)
     : Runnable("net::PredictorThreadShutdownRunner")
     , mIOThread(ioThread)
     , mSuccess(success)
   { }
-  ~PredictorThreadShutdownRunner() { }
+  ~PredictorThreadShutdownRunner() = default;
 
   NS_IMETHOD Run() override
   {
     MOZ_ASSERT(NS_IsMainThread(), "Shutting down io thread off main thread!");
     if (mSuccess) {
       // This means the cleanup happened. Mark so we don't try in the
       // future.
       Preferences::SetBool(PREDICTOR_CLEANED_UP_PREF, true);
@@ -490,17 +487,17 @@ class PredictorOldCleanupRunner : public
 {
 public:
   PredictorOldCleanupRunner(nsIThread* ioThread, nsIFile* dbFile)
     : Runnable("net::PredictorOldCleanupRunner")
     , mIOThread(ioThread)
     , mDBFile(dbFile)
   { }
 
-  ~PredictorOldCleanupRunner() { }
+  ~PredictorOldCleanupRunner() = default;
 
   NS_IMETHOD Run() override
   {
     MOZ_ASSERT(!NS_IsMainThread(), "Cleaning up old files on main thread!");
     nsresult rv = CheckForAndDeleteOldDBFiles();
     RefPtr<PredictorThreadShutdownRunner> runner =
       new PredictorThreadShutdownRunner(mIOThread, NS_SUCCEEDED(rv));
     NS_DispatchToMainThread(runner);
@@ -547,17 +544,17 @@ public:
                          PredictorLearnReason reason, const OriginAttributes &oa)
     : Runnable("PredictorLearnRunnable")
     , mTargetURI(targetURI)
     , mSourceURI(sourceURI)
     , mReason(reason)
     , mOA(oa)
   { }
 
-  ~PredictorLearnRunnable() { }
+  ~PredictorLearnRunnable() = default;
 
   NS_IMETHOD Run() override
   {
     if (!gNeckoChild) {
       // This may have gone away between when this runnable was dispatched and
       // when it actually runs, so let's be safe here, even though we asserted
       // earlier.
       PREDICTOR_LOG(("predictor::learn (async) gNeckoChild went away"));
--- a/netwerk/base/Predictor.h
+++ b/netwerk/base/Predictor.h
@@ -81,22 +81,20 @@ private:
   };
 
   class DNSListener : public nsIDNSListener
   {
   public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIDNSLISTENER
 
-    DNSListener()
-    { }
+    DNSListener() = default;
 
   private:
-    virtual ~DNSListener()
-    { }
+    virtual ~DNSListener() = default;
   };
 
   class Action : public nsICacheEntryOpenCallback
   {
   public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSICACHEENTRYOPENCALLBACK
 
@@ -110,17 +108,17 @@ private:
 
     static const bool IS_FULL_URI = true;
     static const bool IS_ORIGIN = false;
 
     static const bool DO_PREDICT = true;
     static const bool DO_LEARN = false;
 
   private:
-    virtual ~Action();
+    virtual ~Action() = default;
 
     bool mFullUri : 1;
     bool mPredict : 1;
     union {
       PredictorPredictReason mPredictReason;
       PredictorLearnReason mLearnReason;
     };
     nsCOMPtr<nsIURI> mTargetURI;
@@ -147,17 +145,17 @@ private:
       ,mMethod(method)
       ,mIsTracking(isTracking)
       ,mCouldVary(couldVary)
       ,mIsNoStore(isNoStore)
       ,mPredictor(predictor)
     { }
 
   private:
-    virtual ~CacheabilityAction() { }
+    virtual ~CacheabilityAction() = default;
 
     nsCOMPtr<nsIURI> mTargetURI;
     uint32_t mHttpStatus;
     nsCString mMethod;
     bool mIsTracking;
     bool mCouldVary;
     bool mIsNoStore;
     RefPtr<Predictor> mPredictor;
@@ -173,17 +171,17 @@ private:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSICACHEENTRYOPENCALLBACK
     NS_DECL_NSICACHEENTRYMETADATAVISITOR
     NS_DECL_NSICACHESTORAGEVISITOR
 
     explicit Resetter(Predictor *predictor);
 
   private:
-    virtual ~Resetter() { }
+    virtual ~Resetter() = default;
 
     void Complete();
 
     uint32_t mEntriesToVisit;
     nsTArray<nsCString> mKeysToDelete;
     RefPtr<Predictor> mPredictor;
     nsTArray<nsCOMPtr<nsIURI>> mURIsToVisit;
     nsTArray<nsCOMPtr<nsILoadContextInfo>> mInfosToVisit;
@@ -199,17 +197,17 @@ private:
       :mLRUStamp(0)
       ,mLRUKeyToDelete(nullptr)
       ,mPredictor(predictor)
     { }
 
     void Finalize(nsICacheEntry *entry);
 
   private:
-    virtual ~SpaceCleaner() { }
+    virtual ~SpaceCleaner() = default;
     uint32_t mLRUStamp;
     const char *mLRUKeyToDelete;
     nsTArray<nsCString> mLongKeysToDelete;
     RefPtr<Predictor> mPredictor;
   };
 
   class PrefetchListener : public nsIStreamListener
   {
@@ -221,17 +219,17 @@ private:
     PrefetchListener(nsINetworkPredictorVerifier *verifier, nsIURI *uri,
                      Predictor *predictor)
       :mVerifier(verifier)
       ,mURI(uri)
       ,mPredictor(predictor)
     { }
 
   private:
-    virtual ~PrefetchListener() { }
+    virtual ~PrefetchListener() = default;
 
     nsCOMPtr<nsINetworkPredictorVerifier> mVerifier;
     nsCOMPtr<nsIURI> mURI;
     RefPtr<Predictor> mPredictor;
     TimeStamp mStartTime;
   };
 
   // Observer-related stuff
--- a/netwerk/base/ProxyAutoConfig.cpp
+++ b/netwerk/base/ProxyAutoConfig.cpp
@@ -323,17 +323,17 @@ public:
 
   nsresult                 mStatus;
   nsCOMPtr<nsICancelable>  mRequest;
   nsCOMPtr<nsIDNSRecord>   mResponse;
   nsCOMPtr<nsITimer>       mTimer;
   nsCOMPtr<nsIEventTarget> mMainThreadEventTarget;
 
 private:
-  ~PACResolver() {}
+  ~PACResolver() = default;
 };
 NS_IMPL_ISUPPORTS(PACResolver, nsIDNSListener, nsITimerCallback, nsINamed)
 
 static
 void PACLogToConsole(nsString &aMessage)
 {
   nsCOMPtr<nsIConsoleService> consoleService =
     do_GetService(NS_CONSOLESERVICE_CONTRACTID);
--- a/netwerk/base/RedirectChannelRegistrar.h
+++ b/netwerk/base/RedirectChannelRegistrar.h
@@ -19,17 +19,17 @@ namespace net {
 class RedirectChannelRegistrar final : public nsIRedirectChannelRegistrar
 {
   NS_DECL_ISUPPORTS
   NS_DECL_NSIREDIRECTCHANNELREGISTRAR
 
   RedirectChannelRegistrar();
 
 private:
-  ~RedirectChannelRegistrar() {}
+  ~RedirectChannelRegistrar() = default;
 
 protected:
   typedef nsInterfaceHashtable<nsUint32HashKey, nsIChannel>
           ChannelHashtable;
   typedef nsInterfaceHashtable<nsUint32HashKey, nsIParentChannel>
           ParentChannelHashtable;
 
   ChannelHashtable mRealChannels;
--- a/netwerk/base/RequestContextService.cpp
+++ b/netwerk/base/RequestContextService.cpp
@@ -437,17 +437,17 @@ RequestContext::ProcessTailQueue(nsresul
   }
 
   // Must drop to stop tailing requests
   mUntailAt = TimeStamp();
 
   nsTArray<PendingTailRequest> queue;
   queue.SwapElements(mTailQueue);
 
-  for (auto request : queue) {
+  for (const auto& request : queue) {
     LOG(("  untailing %p", request.get()));
     request->OnTailUnblock(aResult);
   }
 }
 
 NS_IMETHODIMP
 RequestContext::CancelTailPendingRequests(nsresult aResult)
 {
--- a/netwerk/base/SimpleBuffer.h
+++ b/netwerk/base/SimpleBuffer.h
@@ -32,17 +32,17 @@ private:
   size_t mReadOffset;
   size_t mWriteOffset;
 };
 
 class SimpleBuffer
 {
 public:
   SimpleBuffer();
-  ~SimpleBuffer() {}
+  ~SimpleBuffer() = default;
 
   nsresult Write(char *stc, size_t len); // return OK or OUT_OF_MEMORY
   size_t Read(char *dest, size_t maxLen); // return bytes read
   size_t Available();
   void Clear();
 
 private:
   NS_DECL_OWNINGTHREAD
--- a/netwerk/base/SimpleChannel.cpp
+++ b/netwerk/base/SimpleChannel.cpp
@@ -22,17 +22,17 @@ namespace mozilla {
 namespace net {
 
 class SimpleChannel : public nsBaseChannel
 {
 public:
   explicit SimpleChannel(UniquePtr<SimpleChannelCallbacks>&& aCallbacks);
 
 protected:
-  virtual ~SimpleChannel() {}
+  virtual ~SimpleChannel() = default;
 
   virtual nsresult OpenContentStream(bool async, nsIInputStream **streamOut,
                                      nsIChannel** channel) override;
 
   virtual nsresult BeginAsyncRead(nsIStreamListener* listener,
                                   nsIRequest** request) override;
 
 private:
--- a/netwerk/base/SimpleChannel.h
+++ b/netwerk/base/SimpleChannel.h
@@ -28,30 +28,30 @@ namespace net {
 
 class SimpleChannelCallbacks
 {
 public:
   virtual InputStreamOrReason OpenContentStream(bool async, nsIChannel* channel) = 0;
 
   virtual RequestOrReason StartAsyncRead(nsIStreamListener* stream, nsIChannel* channel) = 0;
 
-  virtual ~SimpleChannelCallbacks() {}
+  virtual ~SimpleChannelCallbacks() = default;
 };
 
 template <typename F1, typename F2, typename T>
 class SimpleChannelCallbacksImpl final : public SimpleChannelCallbacks
 {
 public:
   SimpleChannelCallbacksImpl(F1&& aStartAsyncRead, F2&& aOpenContentStream, T* context)
     : mStartAsyncRead(aStartAsyncRead)
     , mOpenContentStream(aOpenContentStream)
     , mContext(context)
   {}
 
-  virtual ~SimpleChannelCallbacksImpl() {}
+  virtual ~SimpleChannelCallbacksImpl() = default;
 
   virtual InputStreamOrReason OpenContentStream(bool async, nsIChannel* channel) override
   {
     return mOpenContentStream(async, channel, mContext);
   }
 
   virtual RequestOrReason StartAsyncRead(nsIStreamListener* listener, nsIChannel* channel) override
   {
--- a/netwerk/base/TCPFastOpenLayer.cpp
+++ b/netwerk/base/TCPFastOpenLayer.cpp
@@ -116,28 +116,27 @@ TCPFastOpenSend(PRFileDesc *fd, const vo
                   secret->mFirstPacketBufLen ));
       PRInt32 rv = (fd->lower->methods->send)(fd->lower,
                                               secret->mFirstPacketBuf,
                                               secret->mFirstPacketBufLen,
                                               0, // flags
                                               PR_INTERVAL_NO_WAIT);
       if (rv <= 0) {
         return rv;
-      } else {
-        secret->mFirstPacketBufLen -= rv;
-        if (secret->mFirstPacketBufLen) {
-          memmove(secret->mFirstPacketBuf,
-                  secret->mFirstPacketBuf + rv,
-                  secret->mFirstPacketBufLen);
+      }
+      secret->mFirstPacketBufLen -= rv;
+      if (secret->mFirstPacketBufLen) {
+        memmove(secret->mFirstPacketBuf,
+                secret->mFirstPacketBuf + rv,
+                secret->mFirstPacketBufLen);
 
-          PR_SetError(PR_WOULD_BLOCK_ERROR, 0);
-          return PR_FAILURE;
-        } // if we drained the buffer we can fall through this checks and call
-          // send for the new data
-      }
+        PR_SetError(PR_WOULD_BLOCK_ERROR, 0);
+        return PR_FAILURE;
+      } // if we drained the buffer we can fall through this checks and call
+        // send for the new data
     }
     SOCKET_LOG(("TCPFastOpenSend sending new data.\n"));
     return (fd->lower->methods->send)(fd->lower, buf, amount, flags, timeout);
   case TCPFastOpenSecret::WAITING_FOR_CONNECTCONTINUE:
     PR_SetError(PR_WOULD_BLOCK_ERROR, 0);
     return -1;
   case TCPFastOpenSecret::COLLECT_DATA_FOR_FIRST_PACKET:
     {
@@ -199,23 +198,22 @@ TCPFastOpenRecv(PRFileDesc *fd, void *bu
                   secret->mFirstPacketBufLen ));
       PRInt32 rv = (fd->lower->methods->send)(fd->lower,
                                               secret->mFirstPacketBuf,
                                               secret->mFirstPacketBufLen,
                                               0, // flags
                                               PR_INTERVAL_NO_WAIT);
       if (rv <= 0) {
         return rv;
-      } else {
-        secret->mFirstPacketBufLen -= rv;
-        if (secret->mFirstPacketBufLen) {
-          memmove(secret->mFirstPacketBuf,
-                  secret->mFirstPacketBuf + rv,
-                  secret->mFirstPacketBufLen);
-        }
+      }
+      secret->mFirstPacketBufLen -= rv;
+      if (secret->mFirstPacketBufLen) {
+        memmove(secret->mFirstPacketBuf,
+                secret->mFirstPacketBuf + rv,
+                secret->mFirstPacketBufLen);
       }
     }
     rv = (fd->lower->methods->recv)(fd->lower, buf, amount, flags, timeout);
     break;
   case TCPFastOpenSecret::WAITING_FOR_CONNECTCONTINUE:
   case TCPFastOpenSecret::COLLECT_DATA_FOR_FIRST_PACKET:
     PR_SetError(PR_WOULD_BLOCK_ERROR, 0);
     break;
@@ -518,22 +516,21 @@ TCPFastOpenFlushBuffer(PRFileDesc *fd)
                                                secret->mFirstPacketBufLen,
                                                0, // flags
                                                PR_INTERVAL_NO_WAIT);
     if (rv <= 0) {
       PRErrorCode err = PR_GetError();
       if (err == PR_WOULD_BLOCK_ERROR) {
         // We still need to send this data.
         return true;
-      } else {
-        // There is an error, let nsSocketTransport pick it up properly.
-        secret->mCondition = err;
-        secret->mState = TCPFastOpenSecret::SOCKET_ERROR_STATE;
-        return false;
       }
+      // There is an error, let nsSocketTransport pick it up properly.
+      secret->mCondition = err;
+      secret->mState = TCPFastOpenSecret::SOCKET_ERROR_STATE;
+      return false;
     }
 
     secret->mFirstPacketBufLen -= rv;
     if (secret->mFirstPacketBufLen) {
       memmove(secret->mFirstPacketBuf,
               secret->mFirstPacketBuf + rv,
               secret->mFirstPacketBufLen);
     }
--- a/netwerk/base/TLSServerSocket.cpp
+++ b/netwerk/base/TLSServerSocket.cpp
@@ -28,20 +28,16 @@ namespace net {
 // TLSServerSocket
 //-----------------------------------------------------------------------------
 
 TLSServerSocket::TLSServerSocket()
   : mServerCert(nullptr)
 {
 }
 
-TLSServerSocket::~TLSServerSocket()
-{
-}
-
 NS_IMPL_ISUPPORTS_INHERITED(TLSServerSocket,
                             nsServerSocket,
                             nsITLSServerSocket)
 
 nsresult
 TLSServerSocket::SetSocketDefaults()
 {
   // Set TLS options on the listening socket
@@ -267,17 +263,17 @@ TLSServerSocket::SetVersionRange(uint16_
 //-----------------------------------------------------------------------------
 // TLSServerConnectionInfo
 //-----------------------------------------------------------------------------
 
 namespace {
 
 class TLSServerSecurityObserverProxy final : public nsITLSServerSecurityObserver
 {
-  ~TLSServerSecurityObserverProxy() {}
+  ~TLSServerSecurityObserverProxy() = default;
 
 public:
   explicit TLSServerSecurityObserverProxy(nsITLSServerSecurityObserver* aListener)
     : mListener(new nsMainThreadPtrHolder<nsITLSServerSecurityObserver>(
         "TLSServerSecurityObserverProxy::mListener", aListener))
   { }
 
   NS_DECL_THREADSAFE_ISUPPORTS
--- a/netwerk/base/TLSServerSocket.h
+++ b/netwerk/base/TLSServerSocket.h
@@ -28,17 +28,17 @@ public:
   virtual void CreateClientTransport(PRFileDesc* clientFD,
                                      const NetAddr& clientAddr) override;
   virtual nsresult SetSocketDefaults() override;
   virtual nsresult OnSocketListen() override;
 
   TLSServerSocket();
 
 private:
-  virtual ~TLSServerSocket();
+  virtual ~TLSServerSocket() = default;
 
   static SECStatus AuthCertificateHook(void* arg, PRFileDesc* fd,
                                        PRBool checksig, PRBool isServer);
 
   nsCOMPtr<nsIX509Cert>                  mServerCert;
 };
 
 class TLSServerConnectionInfo : public nsITLSServerConnectionInfo
--- a/netwerk/base/Tickler.h
+++ b/netwerk/base/Tickler.h
@@ -106,21 +106,21 @@ private:
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(Tickler, NS_TICKLER_IID)
 
 #else // not defined MOZ_USE_WIFI_TICKLER
 
 class Tickler final : public nsISupports
 {
-  ~Tickler() { }
+  ~Tickler() = default;
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  Tickler() { }
+  Tickler() = default;
   nsresult Init() { return NS_ERROR_NOT_IMPLEMENTED; }
   void Cancel() { }
   void SetIPV4Address(uint32_t) { };
   void SetIPV4Port(uint16_t) { }
   void Tickle() { }
 };
 
 #endif // defined MOZ_USE_WIFI_TICKLER
--- a/netwerk/base/nsAuthInformationHolder.h
+++ b/netwerk/base/nsAuthInformationHolder.h
@@ -7,17 +7,17 @@
 #define NSAUTHINFORMATIONHOLDER_H_
 
 #include "nsIAuthInformation.h"
 #include "nsString.h"
 
 class nsAuthInformationHolder : public nsIAuthInformation {
 
 protected:
-    virtual ~nsAuthInformationHolder() {}
+    virtual ~nsAuthInformationHolder() = default;
 
 public:
     // aAuthType must be ASCII
     nsAuthInformationHolder(uint32_t aFlags, const nsString& aRealm,
                             const nsCString& aAuthType)
         : mFlags(aFlags), mRealm(aRealm), mAuthType(aAuthType) {}
 
     NS_DECL_ISUPPORTS
--- a/netwerk/base/nsBase64Encoder.h
+++ b/netwerk/base/nsBase64Encoder.h
@@ -10,23 +10,23 @@
 #include "mozilla/Attributes.h"
 
 /**
  * A base64 encoder. Usage: Instantiate class, write to it using
  * Write(), then call Finish() to get the base64-encoded data.
  */
 class nsBase64Encoder final : public nsIOutputStream {
   public:
-    nsBase64Encoder() {}
+    nsBase64Encoder() = default;
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIOUTPUTSTREAM
 
     nsresult Finish(nsACString& _result);
   private:
-    ~nsBase64Encoder() {}
+    ~nsBase64Encoder() = default;
 
     /// The data written to this stream. nsCString can deal fine with
     /// binary data.
     nsCString mData;
 };
 
 #endif
--- a/netwerk/base/nsBaseContentStream.h
+++ b/netwerk/base/nsBaseContentStream.h
@@ -60,17 +60,17 @@ public:
   // callback to occur asynchronously; otherwise, the callback will happen
   // before this function returns.
   void DispatchCallback(bool async = true);
 
   // Helper function to make code more self-documenting.
   void DispatchCallbackSync() { DispatchCallback(false); }
 
 protected:
-  virtual ~nsBaseContentStream() {}
+  virtual ~nsBaseContentStream() = default;
 
 private:
   // Called from the base stream's AsyncWait method when a pending callback
   // is installed on the stream.
   virtual void OnCallbackPending() {}
 
 private:
   nsCOMPtr<nsIInputStreamCallback> mCallback;
--- a/netwerk/base/nsBufferedStreams.h
+++ b/netwerk/base/nsBufferedStreams.h
@@ -86,17 +86,17 @@ public:
     static nsresult
     Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
 
     nsIInputStream* Source() {
         return (nsIInputStream*)mStream;
     }
 
 protected:
-    virtual ~nsBufferedInputStream() {}
+    virtual ~nsBufferedInputStream() = default;
 
     NS_IMETHOD Fill() override;
     NS_IMETHOD Flush() override { return NS_OK; } // no-op for input streams
 
     mozilla::Mutex mMutex;
 
     // This value is protected by mutex.
     nsCOMPtr<nsIInputStreamCallback> mAsyncWaitCallback;
--- a/netwerk/base/nsDNSPrefetch.h
+++ b/netwerk/base/nsDNSPrefetch.h
@@ -14,17 +14,17 @@
 
 #include "nsIDNSListener.h"
 
 class nsIURI;
 class nsIDNSService;
 
 class nsDNSPrefetch final : public nsIDNSListener
 {
-    ~nsDNSPrefetch() {}
+    ~nsDNSPrefetch() = default;
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIDNSLISTENER
 
     nsDNSPrefetch(nsIURI *aURI, mozilla::OriginAttributes& aOriginAttributes,
                   nsIDNSListener *aListener, bool storeTiming);
     bool TimingsValid() const {
--- a/netwerk/base/nsIOService.cpp
+++ b/netwerk/base/nsIOService.cpp
@@ -1412,17 +1412,17 @@ public:
     : Runnable("net::nsWakeupNotifier")
     , mIOService(ioService)
   {
   }
 
   NS_IMETHOD Run() override { return mIOService->NotifyWakeup(); }
 
 private:
-    virtual ~nsWakeupNotifier() { }
+    virtual ~nsWakeupNotifier() = default;
     nsCOMPtr<nsIIOServiceInternal> mIOService;
 };
 
 NS_IMETHODIMP
 nsIOService::NotifyWakeup()
 {
     nsCOMPtr<nsIObserverService> observerService = services::GetObserverService();
 
@@ -1742,17 +1742,17 @@ nsIOService::ParseAttributePolicyString(
   NS_ENSURE_ARG(outPolicyEnum);
   *outPolicyEnum = (uint32_t)AttributeReferrerPolicyFromString(policyString);
   return NS_OK;
 }
 
 // nsISpeculativeConnect
 class IOServiceProxyCallback final : public nsIProtocolProxyCallback
 {
-    ~IOServiceProxyCallback() {}
+    ~IOServiceProxyCallback() = default;
 
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIPROTOCOLPROXYCALLBACK
 
     IOServiceProxyCallback(nsIInterfaceRequestor *aCallbacks,
                            nsIOService *aIOService)
         : mCallbacks(aCallbacks)
--- a/netwerk/base/nsIncrementalDownload.cpp
+++ b/netwerk/base/nsIncrementalDownload.cpp
@@ -107,17 +107,17 @@ public:
   NS_DECL_NSIOBSERVER
   NS_DECL_NSIINTERFACEREQUESTOR
   NS_DECL_NSICHANNELEVENTSINK
   NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
 
   nsIncrementalDownload();
 
 private:
-  ~nsIncrementalDownload() {}
+  ~nsIncrementalDownload() = default;
   nsresult FlushChunk();
   void     UpdateProgress();
   nsresult CallOnStartRequest();
   void     CallOnStopRequest();
   nsresult StartTimer(int32_t interval);
   nsresult ProcessTimeout();
   nsresult ReadCurrentSize();
   nsresult ClearRequestHeader(nsIHttpChannel *channel);
--- a/netwerk/base/nsIncrementalStreamLoader.cpp
+++ b/netwerk/base/nsIncrementalStreamLoader.cpp
@@ -11,20 +11,16 @@
 
 #include <limits>
 
 nsIncrementalStreamLoader::nsIncrementalStreamLoader()
   : mData(), mBytesConsumed(0)
 {
 }
 
-nsIncrementalStreamLoader::~nsIncrementalStreamLoader()
-{
-}
-
 NS_IMETHODIMP
 nsIncrementalStreamLoader::Init(nsIIncrementalStreamLoaderObserver* observer)
 {
   NS_ENSURE_ARG_POINTER(observer);
   mObserver = observer;
   return NS_OK;
 }
 
--- a/netwerk/base/nsIncrementalStreamLoader.h
+++ b/netwerk/base/nsIncrementalStreamLoader.h
@@ -25,17 +25,17 @@ public:
   NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
 
   nsIncrementalStreamLoader();
 
   static nsresult
   Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
 
 protected:
-  ~nsIncrementalStreamLoader();
+  ~nsIncrementalStreamLoader() = default;
 
   static nsresult WriteSegmentFun(nsIInputStream *, void *, const char *,
                                   uint32_t, uint32_t, uint32_t *);
 
   // Utility method to free mData, if present, and update other state to
   // reflect that no data has been allocated.
   void ReleaseData();
 
--- a/netwerk/base/nsInputStreamChannel.h
+++ b/netwerk/base/nsInputStreamChannel.h
@@ -20,17 +20,17 @@ class nsInputStreamChannel : public nsBa
 public:
     NS_DECL_ISUPPORTS_INHERITED
     NS_DECL_NSIINPUTSTREAMCHANNEL
 
     nsInputStreamChannel() :
       mIsSrcdocChannel(false) {}
 
 protected:
-    virtual ~nsInputStreamChannel() {}
+    virtual ~nsInputStreamChannel() = default;
 
     virtual nsresult OpenContentStream(bool async, nsIInputStream **result,
                                        nsIChannel** channel) override;
 
     virtual void OnChannelDone() override {
         mContentStream = nullptr;
     }
 
--- a/netwerk/base/nsInputStreamPump.cpp
+++ b/netwerk/base/nsInputStreamPump.cpp
@@ -45,20 +45,16 @@ nsInputStreamPump::nsInputStreamPump()
     , mWaitingForInputStreamReady(false)
     , mCloseWhenDone(false)
     , mRetargeting(false)
     , mAsyncStreamIsBuffered(false)
     , mMutex("nsInputStreamPump")
 {
 }
 
-nsInputStreamPump::~nsInputStreamPump()
-{
-}
-
 nsresult
 nsInputStreamPump::Create(nsInputStreamPump  **result,
                           nsIInputStream      *stream,
                           uint32_t             segsize,
                           uint32_t             segcount,
                           bool                 closeWhenDone,
                           nsIEventTarget      *mainThreadTarget)
 {
--- a/netwerk/base/nsInputStreamPump.h
+++ b/netwerk/base/nsInputStreamPump.h
@@ -16,17 +16,17 @@
 class nsIInputStream;
 class nsILoadGroup;
 class nsIStreamListener;
 
 class nsInputStreamPump final : public nsIInputStreamPump
                               , public nsIInputStreamCallback
                               , public nsIThreadRetargetableRequest
 {
-    ~nsInputStreamPump();
+    ~nsInputStreamPump() = default;
 
 public:
     typedef mozilla::RecursiveMutexAutoLock RecursiveMutexAutoLock;
     typedef mozilla::RecursiveMutexAutoUnlock RecursiveMutexAutoUnlock;
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIREQUEST
     NS_DECL_NSIINPUTSTREAMPUMP
     NS_DECL_NSIINPUTSTREAMCALLBACK
--- a/netwerk/base/nsMIMEInputStream.cpp
+++ b/netwerk/base/nsMIMEInputStream.cpp
@@ -29,17 +29,17 @@ using mozilla::Maybe;
 using mozilla::Move;
 
 class nsMIMEInputStream : public nsIMIMEInputStream,
                           public nsISeekableStream,
                           public nsIIPCSerializableInputStream,
                           public nsIAsyncInputStream,
                           public nsIInputStreamCallback
 {
-    virtual ~nsMIMEInputStream();
+    virtual ~nsMIMEInputStream() = default;
 
 public:
     nsMIMEInputStream();
 
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIINPUTSTREAM
     NS_DECL_NSIMIMEINPUTSTREAM
     NS_DECL_NSISEEKABLESTREAM
@@ -101,20 +101,16 @@ NS_IMPL_CI_INTERFACE_GETTER(nsMIMEInputS
                             nsISeekableStream)
 
 nsMIMEInputStream::nsMIMEInputStream()
   : mStartedReading(false)
   , mMutex("nsMIMEInputStream::mMutex")
 {
 }
 
-nsMIMEInputStream::~nsMIMEInputStream()
-{
-}
-
 NS_IMETHODIMP
 nsMIMEInputStream::AddHeader(const char *aName, const char *aValue)
 {
     NS_ENSURE_FALSE(mStartedReading, NS_ERROR_FAILURE);
 
     HeaderEntry* entry = mHeaders.AppendElement();
     entry->name().Append(aName);
     entry->value().Append(aValue);
--- a/netwerk/base/nsNetAddr.h
+++ b/netwerk/base/nsNetAddr.h
@@ -8,17 +8,17 @@
 #define nsNetAddr_h__
 
 #include "nsINetAddr.h"
 #include "mozilla/net/DNS.h"
 #include "mozilla/Attributes.h"
 
 class nsNetAddr final : public nsINetAddr
 {
-  ~nsNetAddr() {}
+  ~nsNetAddr() = default;
 
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSINETADDR
 
   explicit nsNetAddr(mozilla::net::NetAddr* addr);
 
 private:
--- a/netwerk/base/nsNetUtil.cpp
+++ b/netwerk/base/nsNetUtil.cpp
@@ -3151,19 +3151,18 @@ NS_ShouldSecureUpgrade(nsIURI* aURI,
               break;
           case nsISiteSecurityService::SOURCE_UNKNOWN:
           default:
               // record this as an organic request
               Telemetry::Accumulate(Telemetry::HSTS_UPGRADE_SOURCE, 1);
               break;
         }
         return NS_OK;
-      } else {
-        Telemetry::AccumulateCategorical(Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::PrefBlockedSTS);
       }
+      Telemetry::AccumulateCategorical(Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::PrefBlockedSTS);
     } else {
       Telemetry::AccumulateCategorical(Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::NoReasonToUpgrade);
     }
   } else {
     Telemetry::AccumulateCategorical(Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::AlreadyHTTPS);
   }
   aShouldUpgrade = false;
   return NS_OK;
--- a/netwerk/base/nsNetUtil.h
+++ b/netwerk/base/nsNetUtil.h
@@ -59,19 +59,19 @@ class ClientInfo;
 class PerformanceStorage;
 class ServiceWorkerDescriptor;
 } // namespace dom
 } // namespace mozilla
 
 template <class> class nsCOMPtr;
 template <typename> struct already_AddRefed;
 
-already_AddRefed<nsIIOService> do_GetIOService(nsresult *error = 0);
+already_AddRefed<nsIIOService> do_GetIOService(nsresult *error = nullptr);
 
-already_AddRefed<nsINetUtil> do_GetNetUtil(nsresult *error = 0);
+already_AddRefed<nsINetUtil> do_GetNetUtil(nsresult *error = nullptr);
 
 // private little helper function... don't call this directly!
 nsresult net_EnsureIOService(nsIIOService **ios, nsCOMPtr<nsIIOService> &grip);
 
 nsresult NS_NewURI(nsIURI **result,
                    const nsACString &spec,
                    const char *charset = nullptr,
                    nsIURI *baseURI = nullptr,
--- a/netwerk/base/nsNetworkInfoService.cpp
+++ b/netwerk/base/nsNetworkInfoService.cpp
@@ -20,19 +20,17 @@
 #endif
 
 namespace mozilla {
 namespace net {
 
 NS_IMPL_ISUPPORTS(nsNetworkInfoService,
                   nsINetworkInfoService)
 
-nsNetworkInfoService::nsNetworkInfoService()
-{
-}
+nsNetworkInfoService::nsNetworkInfoService() = default;
 
 nsresult
 nsNetworkInfoService::Init()
 {
   return NS_OK;
 }
 
 nsresult
--- a/netwerk/base/nsPreloadedStream.cpp
+++ b/netwerk/base/nsPreloadedStream.cpp
@@ -112,17 +112,17 @@ class RunOnThread : public Runnable
 public:
   RunOnThread(nsIAsyncInputStream* aStream, nsIInputStreamCallback* aCallback)
     : Runnable("net::RunOnThread")
     , mStream(aStream)
     , mCallback(aCallback)
   {
   }
 
-  virtual ~RunOnThread() {}
+  virtual ~RunOnThread() = default;
 
   NS_IMETHOD Run() override
   {
     mCallback->OnInputStreamReady(mStream);
     return NS_OK;
     }
 
 private:
--- a/netwerk/base/nsProtocolProxyService.cpp
+++ b/netwerk/base/nsProtocolProxyService.cpp
@@ -1610,19 +1610,17 @@ class nsAsyncBridgeRequest final  : publ
         mCondVar.Notify();
     }
 
     void Lock()   { mMutex.Lock(); }
     void Unlock() { mMutex.Unlock(); }
     void Wait()   { mCondVar.Wait(TimeDuration::FromSeconds(3)); }
 
 private:
-    ~nsAsyncBridgeRequest()
-    {
-    }
+    ~nsAsyncBridgeRequest() = default;
 
     friend class nsProtocolProxyService;
 
     Mutex    mMutex;
     CondVar  mCondVar;
 
     nsresult  mStatus;
     nsCString mPACString;
@@ -1771,22 +1769,22 @@ nsProtocolProxyService::NewProxyInfoWith
         kProxyType_HTTPS,
         kProxyType_SOCKS,
         kProxyType_SOCKS4,
         kProxyType_DIRECT
     };
 
     // resolve type; this allows us to avoid copying the type string into each
     // proxy info instance.  we just reference the string literals directly :)
-    const char *type = nullptr;
-    for (uint32_t i = 0; i < ArrayLength(types); ++i) {
-        if (aType.LowerCaseEqualsASCII(types[i])) {
-            type = types[i];
-            break;
-        }
+    const char* type = nullptr;
+    for (auto& t : types) {
+      if (aType.LowerCaseEqualsASCII(t)) {
+        type = t;
+        break;
+      }
     }
     NS_ENSURE_TRUE(type, NS_ERROR_INVALID_ARG);
 
     // We have only implemented username/password for SOCKS proxies.
     if ((!aUsername.IsEmpty() || !aPassword.IsEmpty()) &&
         !aType.LowerCaseEqualsASCII(kProxyType_SOCKS) &&
         !aType.LowerCaseEqualsASCII(kProxyType_SOCKS4)) {
         return NS_ERROR_NOT_IMPLEMENTED;
--- a/netwerk/base/nsReadLine.h
+++ b/netwerk/base/nsReadLine.h
@@ -73,17 +73,17 @@ template<typename CharT, class StreamTyp
 nsresult
 NS_ReadLine (StreamType* aStream, nsLineBuffer<CharT> * aBuffer,
              StringType & aLine, bool *more)
 {
   CharT eolchar = 0; // the first eol char or 1 after \r\n or \n\r is found
 
   aLine.Truncate();
 
-  while (1) { // will be returning out of this loop on eol or eof
+  while (true) { // will be returning out of this loop on eol or eof
     if (aBuffer->start == aBuffer->end) { // buffer is empty.  Read into it.
       uint32_t bytesRead;
       nsresult rv = aStream->Read(aBuffer->buf, kLineBufferSize, &bytesRead);
       if (NS_FAILED(rv) || MOZ_UNLIKELY(bytesRead == 0)) {
         *more = false;
         return rv;
       }
       aBuffer->start = aBuffer->buf;
--- a/netwerk/base/nsRedirectHistoryEntry.cpp
+++ b/netwerk/base/nsRedirectHistoryEntry.cpp
@@ -18,20 +18,16 @@ nsRedirectHistoryEntry::nsRedirectHistor
                                                nsIURI* aReferrer,
                                                const nsACString& aRemoteAddress)
   : mPrincipal(aPrincipal)
   , mReferrer(aReferrer)
   , mRemoteAddress(aRemoteAddress)
 {
 }
 
-nsRedirectHistoryEntry::~nsRedirectHistoryEntry()
-{
-}
-
 NS_IMETHODIMP
 nsRedirectHistoryEntry::GetRemoteAddress(nsACString &result)
 {
   result = mRemoteAddress;
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/netwerk/base/nsRedirectHistoryEntry.h
+++ b/netwerk/base/nsRedirectHistoryEntry.h
@@ -18,17 +18,17 @@ class nsRedirectHistoryEntry final : pub
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIREDIRECTHISTORYENTRY
 
   nsRedirectHistoryEntry(nsIPrincipal* aPrincipal, nsIURI* aReferrer,
                          const nsACString& aRemoteAddress);
 
 private:
-  ~nsRedirectHistoryEntry();
+  ~nsRedirectHistoryEntry() = default;
 
   nsCOMPtr<nsIPrincipal> mPrincipal;
   nsCOMPtr<nsIURI> mReferrer;
   nsCString mRemoteAddress;
 
 };
 
 } // namespace net
--- a/netwerk/base/nsRequestObserverProxy.cpp
+++ b/netwerk/base/nsRequestObserverProxy.cpp
@@ -42,17 +42,17 @@ public:
     nsOnStartRequestEvent(nsRequestObserverProxy *proxy,
                           nsIRequest *request)
         : nsARequestObserverEvent(request)
         , mProxy(proxy)
     {
         NS_PRECONDITION(mProxy, "null pointer");
     }
 
-    virtual ~nsOnStartRequestEvent() {}
+    virtual ~nsOnStartRequestEvent() = default;
 
     NS_IMETHOD Run() override
     {
         LOG(("nsOnStartRequestEvent::HandleEvent [req=%p]\n", mRequest.get()));
 
         if (!mProxy->mObserver) {
             NS_NOTREACHED("already handled onStopRequest event (observer is null)");
             return NS_OK;
@@ -82,29 +82,29 @@ public:
     nsOnStopRequestEvent(nsRequestObserverProxy *proxy,
                          nsIRequest *request)
         : nsARequestObserverEvent(request)
         , mProxy(proxy)
     {
         NS_PRECONDITION(mProxy, "null pointer");
     }
 
-    virtual ~nsOnStopRequestEvent() {}
+    virtual ~nsOnStopRequestEvent() = default;
 
     NS_IMETHOD Run() override
     {
         LOG(("nsOnStopRequestEvent::HandleEvent [req=%p]\n", mRequest.get()));
 
         nsMainThreadPtrHandle<nsIRequestObserver> observer = mProxy->mObserver;
         if (!observer) {
             NS_NOTREACHED("already handled onStopRequest event (observer is null)");
             return NS_OK;
         }
         // Do not allow any more events to be handled after OnStopRequest
-        mProxy->mObserver = 0;
+        mProxy->mObserver = nullptr;
 
         nsresult status = NS_OK;
         DebugOnly<nsresult> rv = mRequest->GetStatus(&status);
         NS_ASSERTION(NS_SUCCEEDED(rv), "GetStatus failed for request!");
 
         LOG(("handle stopevent=%p\n", this));
         (void) observer->OnStopRequest(mRequest, mProxy->mContext, status);
 
--- a/netwerk/base/nsRequestObserverProxy.h
+++ b/netwerk/base/nsRequestObserverProxy.h
@@ -15,24 +15,24 @@
 
 namespace mozilla {
 namespace net {
 
 class nsARequestObserverEvent;
 
 class nsRequestObserverProxy final : public nsIRequestObserverProxy
 {
-    ~nsRequestObserverProxy() {}
+    ~nsRequestObserverProxy() = default;
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIREQUESTOBSERVER
     NS_DECL_NSIREQUESTOBSERVERPROXY
 
-    nsRequestObserverProxy() {}
+    nsRequestObserverProxy() = default;
 
     nsIRequestObserver *Observer() { return mObserver; }
 
     nsresult FireEvent(nsARequestObserverEvent *);
 
 protected:
     nsMainThreadPtrHandle<nsIRequestObserver> mObserver;
     nsMainThreadPtrHandle<nsISupports>        mContext;
@@ -42,17 +42,17 @@ protected:
 };
 
 class nsARequestObserverEvent : public Runnable
 {
 public:
     explicit nsARequestObserverEvent(nsIRequest *);
 
 protected:
-    virtual ~nsARequestObserverEvent() {}
+    virtual ~nsARequestObserverEvent() = default;
 
     nsCOMPtr<nsIRequest>  mRequest;
 };
 
 } // namespace net
 } // namespace mozilla
 
 #endif // nsRequestObserverProxy_h__
--- a/netwerk/base/nsSecCheckWrapChannel.cpp
+++ b/netwerk/base/nsSecCheckWrapChannel.cpp
@@ -40,20 +40,16 @@ nsSecCheckWrapChannelBase::nsSecCheckWra
  , mHttpChannelInternal(do_QueryInterface(aChannel))
  , mRequest(do_QueryInterface(aChannel))
  , mUploadChannel(do_QueryInterface(aChannel))
  , mUploadChannel2(do_QueryInterface(aChannel))
 {
   MOZ_ASSERT(mChannel, "can not create a channel wrapper without a channel");
 }
 
-nsSecCheckWrapChannelBase::~nsSecCheckWrapChannelBase()
-{
-}
-
 //---------------------------------------------------------
 // nsISecCheckWrapChannel implementation
 //---------------------------------------------------------
 
 NS_IMETHODIMP
 nsSecCheckWrapChannelBase::GetInnerChannel(nsIChannel **aInnerChannel)
 {
   NS_IF_ADDREF(*aInnerChannel = mChannel);
@@ -92,20 +88,16 @@ nsSecCheckWrapChannel::MaybeWrap(nsIChan
     channel = aChannel;
     channel->SetLoadInfo(aLoadInfo);
   } else {
     channel = new nsSecCheckWrapChannel(aChannel, aLoadInfo);
   }
   return channel.forget();
 }
 
-nsSecCheckWrapChannel::~nsSecCheckWrapChannel()
-{
-}
-
 //---------------------------------------------------------
 // SecWrapChannelStreamListener helper
 //---------------------------------------------------------
 
 class SecWrapChannelStreamListener final : public nsIStreamListener
 {
   public:
     SecWrapChannelStreamListener(nsIRequest *aRequest,
@@ -113,17 +105,17 @@ class SecWrapChannelStreamListener final
     : mRequest(aRequest)
     , mListener(aStreamListener) {}
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSISTREAMLISTENER
     NS_DECL_NSIREQUESTOBSERVER
 
   private:
-    ~SecWrapChannelStreamListener() {}
+    ~SecWrapChannelStreamListener() = default;
 
     nsCOMPtr<nsIRequest>        mRequest;
     nsCOMPtr<nsIStreamListener> mListener;
 };
 
 NS_IMPL_ISUPPORTS(SecWrapChannelStreamListener,
                   nsIStreamListener,
                   nsIRequestObserver)
--- a/netwerk/base/nsSecCheckWrapChannel.h
+++ b/netwerk/base/nsSecCheckWrapChannel.h
@@ -61,17 +61,17 @@ public:
   NS_FORWARD_NSIUPLOADCHANNEL(mUploadChannel->)
   NS_FORWARD_NSIUPLOADCHANNEL2(mUploadChannel2->)
   NS_DECL_NSISECCHECKWRAPCHANNEL
   NS_DECL_ISUPPORTS
 
   explicit nsSecCheckWrapChannelBase(nsIChannel* aChannel);
 
 protected:
-  virtual ~nsSecCheckWrapChannelBase();
+  virtual ~nsSecCheckWrapChannelBase() = default;
 
   nsCOMPtr<nsIChannel>             mChannel;
   // We do a QI in the constructor to set the following pointers.
   nsCOMPtr<nsIHttpChannel>         mHttpChannel;
   nsCOMPtr<nsIHttpChannelInternal> mHttpChannelInternal;
   nsCOMPtr<nsIRequest>             mRequest;
   nsCOMPtr<nsIUploadChannel>       mUploadChannel;
   nsCOMPtr<nsIUploadChannel2>      mUploadChannel2;
@@ -90,17 +90,17 @@ public:
   NS_IMETHOD AsyncOpen2(nsIStreamListener *aListener) override;
   NS_IMETHOD Open2(nsIInputStream** aStream) override;
 
   nsSecCheckWrapChannel(nsIChannel* aChannel, nsILoadInfo* aLoadInfo);
   static already_AddRefed<nsIChannel> MaybeWrap(nsIChannel* aChannel,
                                                 nsILoadInfo* aLoadInfo);
 
 protected:
-  virtual ~nsSecCheckWrapChannel();
+  virtual ~nsSecCheckWrapChannel() = default;
 
   nsCOMPtr<nsILoadInfo> mLoadInfo;
 };
 
 } // namespace net
 } // namespace mozilla
 
 #endif // nsSecCheckWrapChannel_h__
--- a/netwerk/base/nsSerializationHelper.h
+++ b/netwerk/base/nsSerializationHelper.h
@@ -24,15 +24,15 @@ nsresult NS_SerializeToString(nsISeriali
 /**
  * Deserialize an object.
  */
 nsresult NS_DeserializeObject(const nsACString& str,
                               nsISupports** obj);
 
 class nsSerializationHelper final : public nsISerializationHelper
 {
-  ~nsSerializationHelper() {}
+  ~nsSerializationHelper() = default;
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSISERIALIZATIONHELPER
 };
 
 #endif
--- a/netwerk/base/nsServerSocket.cpp
+++ b/netwerk/base/nsServerSocket.cpp
@@ -414,17 +414,17 @@ nsServerSocket::Close()
   }
   return PostEvent(this, &nsServerSocket::OnMsgClose);
 }
 
 namespace {
 
 class ServerSocketListenerProxy final : public nsIServerSocketListener
 {
-  ~ServerSocketListenerProxy() {}
+  ~ServerSocketListenerProxy() = default;
 
 public:
   explicit ServerSocketListenerProxy(nsIServerSocketListener* aListener)
     : mListener(new nsMainThreadPtrHolder<nsIServerSocketListener>(
         "ServerSocketListenerProxy::mListener", aListener))
     , mTarget(GetCurrentThreadEventTarget())
   { }
 
--- a/netwerk/base/nsSimpleNestedURI.h
+++ b/netwerk/base/nsSimpleNestedURI.h
@@ -70,19 +70,19 @@ public:
         : public nsIURIMutator
         , public BaseURIMutator<nsSimpleNestedURI>
         , public nsISerializable
         , public nsINestedURIMutator
     {
         NS_DECL_ISUPPORTS
         NS_FORWARD_SAFE_NSIURISETTERS_RET(mURI)
 
-        explicit Mutator() { }
+        explicit Mutator() = default;
     private:
-        virtual ~Mutator() { }
+        virtual ~Mutator() = default;
 
         MOZ_MUST_USE NS_IMETHOD
         Deserialize(const mozilla::ipc::URIParams& aParams) override
         {
             return InitFromIPCParams(aParams);
         }
 
         NS_IMETHOD
--- a/netwerk/base/nsSimpleStreamListener.h
+++ b/netwerk/base/nsSimpleStreamListener.h
@@ -16,20 +16,20 @@ namespace net {
 class nsSimpleStreamListener : public nsISimpleStreamListener
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIREQUESTOBSERVER
     NS_DECL_NSISTREAMLISTENER
     NS_DECL_NSISIMPLESTREAMLISTENER
 
-    nsSimpleStreamListener() { }
+    nsSimpleStreamListener() = default;
 
 protected:
-    virtual ~nsSimpleStreamListener() {}
+    virtual ~nsSimpleStreamListener() = default;
 
     nsCOMPtr<nsIOutputStream>    mSink;
     nsCOMPtr<nsIRequestObserver> mObserver;
 };
 
 } // namespace net
 } // namespace mozilla
 
--- a/netwerk/base/nsSimpleURI.cpp
+++ b/netwerk/base/nsSimpleURI.cpp
@@ -50,20 +50,16 @@ nsSimpleURI::From(nsIURI* aURI)
 
 nsSimpleURI::nsSimpleURI()
     : mMutable(true)
     , mIsRefValid(false)
     , mIsQueryValid(false)
 {
 }
 
-nsSimpleURI::~nsSimpleURI()
-{
-}
-
 NS_IMPL_ADDREF(nsSimpleURI)
 NS_IMPL_RELEASE(nsSimpleURI)
 NS_INTERFACE_TABLE_HEAD(nsSimpleURI)
 NS_INTERFACE_TABLE(nsSimpleURI, nsIURI, nsISerializable,
                    nsIClassInfo, nsIMutable, nsIIPCSerializableURI)
 NS_INTERFACE_TABLE_TO_MAP_SEGUE
   if (aIID.Equals(kThisSimpleURIImplementationCID))
     foundInterface = static_cast<nsIURI*>(this);
@@ -309,17 +305,17 @@ nsSimpleURI::SetSpecInternal(const nsACS
     if (NS_FAILED(rv)) {
         return rv;
     }
 
     int32_t colonPos = spec.FindChar(':');
     MOZ_ASSERT(colonPos != kNotFound, "A colon should be in this string");
     // This sets mPath, mQuery and mRef.
     return SetPathQueryRefEscaped(Substring(spec, colonPos + 1),
-                                  /* needsEscape = */ false);
+                                  /* aNeedsEscape = */ false);
 }
 
 NS_IMETHODIMP
 nsSimpleURI::GetScheme(nsACString &result)
 {
     result = mScheme;
     return NS_OK;
 }
--- a/netwerk/base/nsSimpleURI.h
+++ b/netwerk/base/nsSimpleURI.h
@@ -32,17 +32,17 @@ class nsSimpleURI
     , public nsISerializable
     , public nsIClassInfo
     , public nsIMutable
     , public nsISizeOf
     , public nsIIPCSerializableURI
 {
 protected:
     nsSimpleURI();
-    virtual ~nsSimpleURI();
+    virtual ~nsSimpleURI() = default;
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIURI
     NS_DECL_NSISERIALIZABLE
     NS_DECL_NSICLASSINFO
     NS_DECL_NSIMUTABLE
     NS_DECL_NSIIPCSERIALIZABLEURI
@@ -145,19 +145,19 @@ public:
         }
 
         MOZ_MUST_USE NS_IMETHOD
         Read(nsIObjectInputStream* aStream) override
         {
             return InitFromInputStream(aStream);
         }
 
-        explicit Mutator() { }
+        explicit Mutator() = default;
     private:
-        virtual ~Mutator() { }
+        virtual ~Mutator() = default;
 
         friend class nsSimpleURI;
     };
 
     friend BaseURIMutator<nsSimpleURI>;
 };
 
 } // namespace net
--- a/netwerk/base/nsSocketTransport2.cpp
+++ b/netwerk/base/nsSocketTransport2.cpp
@@ -256,20 +256,16 @@ nsSocketInputStream::nsSocketInputStream
     : mTransport(trans)
     , mReaderRefCnt(0)
     , mCondition(NS_OK)
     , mCallbackFlags(0)
     , mByteCount(0)
 {
 }
 
-nsSocketInputStream::~nsSocketInputStream()
-{
-}
-
 // called on the socket transport thread...
 //
 //   condition : failure code if socket has been closed
 //
 void
 nsSocketInputStream::OnSocketReady(nsresult condition)
 {
     SOCKET_LOG(("nsSocketInputStream::OnSocketReady [this=%p cond=%" PRIx32 "]\n",
@@ -521,20 +517,16 @@ nsSocketOutputStream::nsSocketOutputStre
     : mTransport(trans)
     , mWriterRefCnt(0)
     , mCondition(NS_OK)
     , mCallbackFlags(0)
     , mByteCount(0)
 {
 }
 
-nsSocketOutputStream::~nsSocketOutputStream()
-{
-}
-
 // called on the socket transport thread...
 //
 //   condition : failure code if socket has been closed
 //
 void
 nsSocketOutputStream::OnSocketReady(nsresult condition)
 {
     SOCKET_LOG(("nsSocketOutputStream::OnSocketReady [this=%p cond=%" PRIx32 "]\n",
@@ -979,17 +971,17 @@ nsSocketTransport::InitWithConnectedSock
     SetSocketName(fd);
     mNetAddrIsSet = true;
 
     {
         MutexAutoLock lock(mLock);
 
         mFD = fd;
         mFDref = 1;
-        mFDconnected = 1;
+        mFDconnected = true;
     }
 
     // make sure new socket is non-blocking
     PRSocketOptionData opt;
     opt.option = PR_SockOpt_Nonblocking;
     opt.value.non_blocking = true;
     PR_SetSocketOption(fd, &opt);
 
@@ -1256,17 +1248,17 @@ nsSocketTransport::BuildSocket(PRFileDes
             }
         }
 
         if (NS_FAILED(rv)) {
             SOCKET_LOG(("  error pushing io layer [%u:%s rv=%" PRIx32 "]\n", i, mTypes[i],
                         static_cast<uint32_t>(rv)));
             if (fd) {
                 CloseSocket(fd,
-                    mSocketTransportService->IsTelemetryEnabledAndNotSleepPhase()); 
+                    mSocketTransportService->IsTelemetryEnabledAndNotSleepPhase());
             }
         }
     }
 
     return rv;
 }
 
 nsresult
@@ -2185,19 +2177,19 @@ nsSocketTransport::OnSocketReady(PRFileD
 
     if ((mState == STATE_TRANSFERRING) && mFastOpenLayerHasBufferedData) {
         // We have some data buffered in TCPFastOpenLayer. We will flush them
         // first. We need to do this first before calling OnSocketReady below
         // so that the socket status events are kept in the correct order.
         mFastOpenLayerHasBufferedData = TCPFastOpenFlushBuffer(fd);
         if (mFastOpenLayerHasBufferedData) {
             return;
-        } else {
-            SendStatus(NS_NET_STATUS_SENDING_TO);
         }
+        SendStatus(NS_NET_STATUS_SENDING_TO);
+
         // If we are done sending the buffered data continue with the normal
         // path.
         // In case of an error, TCPFastOpenFlushBuffer will return false and
         // the normal code path will pick up the error.
         mFastOpenLayerHasBufferedData = false;
     }
 
     if (mState == STATE_TRANSFERRING) {
--- a/netwerk/base/nsSocketTransport2.h
+++ b/netwerk/base/nsSocketTransport2.h
@@ -50,17 +50,17 @@ class nsSocketTransport;
 class nsSocketInputStream : public nsIAsyncInputStream
 {
 public:
     NS_DECL_ISUPPORTS_INHERITED
     NS_DECL_NSIINPUTSTREAM
     NS_DECL_NSIASYNCINPUTSTREAM
 
     explicit nsSocketInputStream(nsSocketTransport *);
-    virtual ~nsSocketInputStream();
+    virtual ~nsSocketInputStream() = default;
 
     bool     IsReferenced() { return mReaderRefCnt > 0; }
     nsresult Condition()    { return mCondition; }
     uint64_t ByteCount()    { return mByteCount; }
 
     // called by the socket transport on the socket thread...
     void OnSocketReady(nsresult condition);
 
@@ -80,17 +80,17 @@ private:
 class nsSocketOutputStream : public nsIAsyncOutputStream
 {
 public:
     NS_DECL_ISUPPORTS_INHERITED
     NS_DECL_NSIOUTPUTSTREAM
     NS_DECL_NSIASYNCOUTPUTSTREAM
 
     explicit nsSocketOutputStream(nsSocketTransport *);
-    virtual ~nsSocketOutputStream();
+    virtual ~nsSocketOutputStream() = default;
 
     bool     IsReferenced() { return mWriterRefCnt > 0; }
     nsresult Condition()    { return mCondition; }
     uint64_t ByteCount()    { return mByteCount; }
 
     // called by the socket transport on the socket thread...
     void OnSocketReady(nsresult condition);
 
@@ -250,17 +250,17 @@ private:
     {
     public:
       explicit LockedPRFileDesc(nsSocketTransport *aSocketTransport)
         : mSocketTransport(aSocketTransport)
         , mFd(nullptr)
       {
         MOZ_ASSERT(aSocketTransport);
       }
-      ~LockedPRFileDesc() {}
+      ~LockedPRFileDesc() = default;
       bool IsInitialized() {
         return mFd;
       }
       LockedPRFileDesc& operator=(PRFileDesc *aFd) {
         mSocketTransport->mLock.AssertCurrentThreadOwns();
         mFd = aFd;
         return *this;
       }
--- a/netwerk/base/nsSocketTransportService2.cpp
+++ b/netwerk/base/nsSocketTransportService2.cpp
@@ -510,17 +510,17 @@ nsSocketTransportService::PollTimeout(PR
 
 int32_t
 nsSocketTransportService::Poll(TimeDuration *pollDuration,
                                PRIntervalTime ts)
 {
     PRPollDesc *pollList;
     uint32_t pollCount;
     PRIntervalTime pollTimeout;
-    *pollDuration = 0;
+    *pollDuration = nullptr;
 
     // If there are pending events for this thread then
     // DoPollIteration() should service the network without blocking.
     bool pendingEvents = false;
     mRawThread->HasPendingEvents(&pendingEvents);
 
     if (mPollList[0].fd) {
         mPollList[0].out_flags = 0;
@@ -952,17 +952,17 @@ nsSocketTransportService::Run()
         bool pendingEvents = false;
 
         numberOfPendingEvents = 0;
         numberOfPendingEventsLastCycle = 0;
         if (mTelemetryEnabledPref) {
             startOfCycleForLastCycleCalc = TimeStamp::NowLoRes();
             startOfNextIteration = TimeStamp::NowLoRes();
         }
-        pollDuration = 0;
+        pollDuration = nullptr;
 
         do {
             if (mTelemetryEnabledPref) {
                 pollCycleStart = TimeStamp::NowLoRes();
             }
 
             DoPollIteration(&singlePollDuration);
 
@@ -1021,17 +1021,17 @@ nsSocketTransportService::Run()
                         TimeStamp::NowLoRes());
 
                     Telemetry::Accumulate(
                         Telemetry::STS_NUMBER_OF_PENDING_EVENTS,
                         numberOfPendingEvents);
 
                     numberOfPendingEventsLastCycle += numberOfPendingEvents;
                     numberOfPendingEvents = 0;
-                    pollDuration = 0;
+                    pollDuration = nullptr;
                 }
             }
         } while (pendingEvents);
 
         bool goingOffline = false;
         // now that our event queue is empty, check to see if we should exit
         {
             MutexAutoLock lock(mLock);
@@ -1161,17 +1161,17 @@ nsSocketTransportService::DoPollIteratio
     //  windows systems have troubles with the higher limit, so actively probe a
     // limit the first time we exceed 30.
     if ((mActiveCount > 30) && !mProbedMaxCount)
         ProbeMaxCount();
 #endif
 
     // Measures seconds spent while blocked on PR_Poll
     int32_t n = 0;
-    *pollDuration = 0;
+    *pollDuration = nullptr;
 
     if (!gIOService->IsNetTearingDown()) {
         // Let's not do polling during shutdown.
 #if defined(XP_WIN)
         StartPolling();
 #endif
         n = Poll(pollDuration, now);
 #if defined(XP_WIN)
--- a/netwerk/base/nsSocketTransportService2.h
+++ b/netwerk/base/nsSocketTransportService2.h
@@ -64,17 +64,17 @@ static const int32_t kDefaultTCPKeepCoun
 #else
                                               4;  // Specifiable in Linux.
 #endif
 
 class LinkedRunnableEvent final : public LinkedListElement<LinkedRunnableEvent>
 {
 public:
   explicit LinkedRunnableEvent(nsIRunnable *event) : mEvent(event) {}
-  ~LinkedRunnableEvent() {}
+  ~LinkedRunnableEvent() = default;
 
   already_AddRefed<nsIRunnable> TakeEvent()
   {
     return mEvent.forget();
   }
 private:
     nsCOMPtr<nsIRunnable> mEvent;
 };
--- a/netwerk/base/nsStandardURL.cpp
+++ b/netwerk/base/nsStandardURL.cpp
@@ -217,17 +217,17 @@ nsStandardURL::~nsStandardURL()
            remove();
         }
     }
 #endif
 }
 
 #ifdef DEBUG_DUMP_URLS_AT_SHUTDOWN
 struct DumpLeakedURLs {
-    DumpLeakedURLs() {}
+    DumpLeakedURLs() = default;
     ~DumpLeakedURLs();
 };
 
 DumpLeakedURLs::~DumpLeakedURLs()
 {
     MOZ_ASSERT(NS_IsMainThread());
     StaticMutexAutoLock lock(gAllURLsMutex);
     if (!gAllURLs.isEmpty()) {
@@ -769,17 +769,16 @@ nsStandardURL::BuildNormalizedSpec(const
 
     // We must take a copy of every single segment because they are pointing to
     // the |spec| while we are changing their value, in case we must use
     // encoded strings.
     URLSegment username(mUsername);
     URLSegment password(mPassword);
     URLSegment host(mHost);
     URLSegment path(mPath);
-    URLSegment filepath(mFilepath);
     URLSegment directory(mDirectory);
     URLSegment basename(mBasename);
     URLSegment extension(mExtension);
     URLSegment query(mQuery);
     URLSegment ref(mRef);
 
     // The encoded string could be longer than the original input, so we need
     // to check the final URI isn't longer than the max length.
@@ -951,52 +950,51 @@ nsStandardURL::SegmentIs(const URLSegmen
         return (!val && (mSpec.IsEmpty() || seg.mLen < 0));
     if (seg.mLen < 0)
         return false;
     // if the first |seg.mLen| chars of |val| match, then |val| must
     // also be null terminated at |seg.mLen|.
     if (ignoreCase)
         return !PL_strncasecmp(mSpec.get() + seg.mPos, val, seg.mLen)
             && (val[seg.mLen] == '\0');
-    else
-        return !strncmp(mSpec.get() + seg.mPos, val, seg.mLen)
-            && (val[seg.mLen] == '\0');
+
+    return !strncmp(mSpec.get() + seg.mPos, val, seg.mLen) &&
+           (val[seg.mLen] == '\0');
 }
 
 bool
 nsStandardURL::SegmentIs(const char* spec, const URLSegment &seg, const char *val, bool ignoreCase)
 {
     // one or both may be null
     if (!val || !spec)
         return (!val && (!spec || seg.mLen < 0));
     if (seg.mLen < 0)
         return false;
     // if the first |seg.mLen| chars of |val| match, then |val| must
     // also be null terminated at |seg.mLen|.
     if (ignoreCase)
         return !PL_strncasecmp(spec + seg.mPos, val, seg.mLen)
             && (val[seg.mLen] == '\0');
-    else
-        return !strncmp(spec + seg.mPos, val, seg.mLen)
-            && (val[seg.mLen] == '\0');
+
+    return !strncmp(spec + seg.mPos, val, seg.mLen) && (val[seg.mLen] == '\0');
 }
 
 bool
 nsStandardURL::SegmentIs(const URLSegment &seg1, const char *val, const URLSegment &seg2, bool ignoreCase)
 {
     if (seg1.mLen != seg2.mLen)
         return false;
     if (seg1.mLen == -1 || (!val && mSpec.IsEmpty()))
         return true; // both are empty
     if (!val)
         return false;
     if (ignoreCase)
         return !PL_strncasecmp(mSpec.get() + seg1.mPos, val + seg2.mPos, seg1.mLen);
-    else
-        return !strncmp(mSpec.get() + seg1.mPos, val + seg2.mPos, seg1.mLen);
+
+    return !strncmp(mSpec.get() + seg1.mPos, val + seg2.mPos, seg1.mLen);
 }
 
 int32_t
 nsStandardURL::ReplaceSegment(uint32_t pos, uint32_t len, const char *val, uint32_t valLen)
 {
     if (val && valLen) {
         if (len == 0)
             mSpec.Insert(val, pos, valLen);
@@ -1971,22 +1969,21 @@ nsStandardURL::SetHost(const nsACString 
 
     LOG(("nsStandardURL::SetHost [host=%s]\n", host));
 
     if (mURLType == URLTYPE_NO_AUTHORITY) {
         if (flat.IsEmpty())
             return NS_OK;
         NS_WARNING("cannot set host on no-auth url");
         return NS_ERROR_UNEXPECTED;
-    } else {
-        if (flat.IsEmpty()) {
-            // Setting an empty hostname is not allowed for
-            // URLTYPE_STANDARD and URLTYPE_AUTHORITY.
-            return NS_ERROR_UNEXPECTED;
-        }
+    }
+    if (flat.IsEmpty()) {
+      // Setting an empty hostname is not allowed for
+      // URLTYPE_STANDARD and URLTYPE_AUTHORITY.
+      return NS_ERROR_UNEXPECTED;
     }
 
     if (strlen(host) < flat.Length())
         return NS_ERROR_MALFORMED_URI; // found embedded null
 
     // For consistency with SetSpec/nsURLParsers, don't allow spaces
     // in the hostname.
     if (strchr(host, ' '))
@@ -2147,17 +2144,17 @@ nsStandardURL::SetPathQueryRef(const nsA
 
         spec.Assign(mSpec.get(), mPath.mPos);
         if (path.First() != '/')
             spec.Append('/');
         spec.Append(path);
 
         return SetSpecInternal(spec);
     }
-    else if (mPath.mLen >= 1) {
+    if (mPath.mLen >= 1) {
         mSpec.Cut(mPath.mPos + 1, mPath.mLen - 1);
         // these contain only a '/'
         mPath.mLen = 1;
         mDirectory.mLen = 1;
         mFilepath.mLen = 1;
         // these are no longer defined
         mBasename.mLen = -1;
         mExtension.mLen = -1;
@@ -2838,17 +2835,17 @@ nsStandardURL::SetFilePath(const nsACStr
         if (mFilepath.mLen >= 0) {
             uint32_t end = mFilepath.mPos + mFilepath.mLen;
             if (mSpec.Length() > end)
                 spec.Append(mSpec.get() + end, mSpec.Length() - end);
         }
 
         return SetSpecInternal(spec);
     }
-    else if (mPath.mLen > 1) {
+    if (mPath.mLen > 1) {
         mSpec.Cut(mPath.mPos + 1, mFilepath.mLen - 1);
         // left shift query, and ref
         ShiftFromQuery(1 - mFilepath.mLen);
         // these contain only a '/'
         mPath.mLen = 1;
         mDirectory.mLen = 1;
         mFilepath.mLen = 1;
         // these are no longer defined
--- a/netwerk/base/nsStandardURL.h
+++ b/netwerk/base/nsStandardURL.h
@@ -82,17 +82,17 @@ public: /* internal -- HPUX compiler can
     //
     struct URLSegment
     {
         uint32_t mPos;
         int32_t  mLen;
 
         URLSegment() : mPos(0), mLen(-1) {}
         URLSegment(uint32_t pos, int32_t len) : mPos(pos), mLen(len) {}
-        URLSegment(const URLSegment& aCopy) : mPos(aCopy.mPos), mLen(aCopy.mLen) {}
+        URLSegment(const URLSegment& aCopy) = default;
         void Reset() { mPos = 0; mLen = -1; }
         // Merge another segment following this one to it if they're contiguous
         // Assumes we have something like "foo;bar" where this object is 'foo' and right
         // is 'bar'.
         void Merge(const nsCString &spec, const char separator, const URLSegment &right) {
             if (mLen >= 0 &&
                 *(spec.get() + mPos + mLen) == separator &&
                 mPos + mLen + 1 == right.mPos) {
@@ -460,30 +460,30 @@ public:
         MOZ_MUST_USE NS_IMETHOD
         SetFile(nsIFile* aFile) override
         {
             RefPtr<T> uri;
             if (BaseURIMutator<T>::mURI) {
                 // We don't need a new URI object if we already have one
                 BaseURIMutator<T>::mURI.swap(uri);
             } else {
-                uri = new T(/* supportsFileURL = */ true);
+                uri = new T(/* aSupportsFileURL = */ true);
             }
 
             nsresult rv = uri->SetFile(aFile);
             if (NS_FAILED(rv)) {
                 return rv;
             }
             BaseURIMutator<T>::mURI.swap(uri);
             return NS_OK;
         }
 
-        explicit TemplatedMutator() { }
+        explicit TemplatedMutator() = default;
     private:
-        virtual ~TemplatedMutator() { }
+        virtual ~TemplatedMutator() = default;
 
         bool mMarkedFileURL = false;
 
         friend T;
     };
 
     class Mutator final
         : public TemplatedMutator<nsStandardURL>
--- a/netwerk/base/nsStreamListenerTee.h
+++ b/netwerk/base/nsStreamListenerTee.h
@@ -20,20 +20,20 @@ class nsStreamListenerTee : public nsISt
 {
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIREQUESTOBSERVER
     NS_DECL_NSISTREAMLISTENER
     NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
     NS_DECL_NSISTREAMLISTENERTEE
 
-    nsStreamListenerTee() { }
+    nsStreamListenerTee() = default;
 
 private:
-    virtual ~nsStreamListenerTee() { }
+    virtual ~nsStreamListenerTee() = default;
 
     nsCOMPtr<nsIInputStreamTee>  mInputTee;
     nsCOMPtr<nsIOutputStream>    mSink;
     nsCOMPtr<nsIStreamListener>  mListener;
     nsCOMPtr<nsIRequestObserver> mObserver;
     nsCOMPtr<nsIEventTarget>     mEventTarget;
 };
 
--- a/netwerk/base/nsStreamListenerWrapper.h
+++ b/netwerk/base/nsStreamListenerWrapper.h
@@ -27,17 +27,17 @@ public:
   }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_FORWARD_SAFE_NSIREQUESTOBSERVER(mListener)
   NS_FORWARD_SAFE_NSISTREAMLISTENER(mListener)
   NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
 
 private:
-  ~nsStreamListenerWrapper() {}
+  ~nsStreamListenerWrapper() = default;
   nsCOMPtr<nsIStreamListener> mListener;
 };
 
 } // namespace net
 } // namespace mozilla
 
 #endif // nsStreamListenerWrapper_h__
 
--- a/netwerk/base/nsStreamLoader.cpp
+++ b/netwerk/base/nsStreamLoader.cpp
@@ -14,20 +14,16 @@
 namespace mozilla {
 namespace net {
 
 nsStreamLoader::nsStreamLoader()
   : mData()
 {
 }
 
-nsStreamLoader::~nsStreamLoader()
-{
-}
-
 NS_IMETHODIMP
 nsStreamLoader::Init(nsIStreamLoaderObserver* aStreamObserver,
                      nsIRequestObserver* aRequestObserver)
 {
   NS_ENSURE_ARG_POINTER(aStreamObserver);
   mObserver = aStreamObserver;
   mRequestObserver = aRequestObserver;
   return NS_OK;
--- a/netwerk/base/nsStreamLoader.h
+++ b/netwerk/base/nsStreamLoader.h
@@ -28,17 +28,17 @@ public:
   NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
 
   nsStreamLoader();
 
   static nsresult
   Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
 
 protected:
-  ~nsStreamLoader();
+  ~nsStreamLoader() = default;
 
   static nsresult WriteSegmentFun(nsIInputStream *, void *, const char *,
                                   uint32_t, uint32_t, uint32_t *);
 
   // Utility method to free mData, if present, and update other state to
   // reflect that no data has been allocated.
   void ReleaseData();
 
--- a/netwerk/base/nsStreamTransportService.cpp
+++ b/netwerk/base/nsStreamTransportService.cpp
@@ -43,19 +43,17 @@ public:
         : mSource(source)
         , mOffset(0)
         , mCloseWhenDone(closeWhenDone)
         , mInProgress(false)
     {
     }
 
 private:
-    virtual ~nsInputStreamTransport()
-    {
-    }
+    virtual ~nsInputStreamTransport() = default;
 
     nsCOMPtr<nsIAsyncInputStream>   mPipeIn;
 
     // while the copy is active, these members may only be accessed from the
     // nsIInputStream implementation.
     nsCOMPtr<nsITransportEventSink> mEventSink;
     nsCOMPtr<nsIInputStream>        mSource;
     int64_t                         mOffset;
@@ -344,17 +342,17 @@ public:
             nsCOMPtr<nsIRunnable> event(this); // overly cute
             mCallbackTarget->Dispatch(event.forget(), NS_DISPATCH_NORMAL);
             mCallbackTarget = nullptr;
         }
         return NS_OK;
     }
 
 private:
-    virtual ~AvailableEvent() { }
+    virtual ~AvailableEvent() = default;
 
     nsCOMPtr<nsIInputStream> mStream;
     nsCOMPtr<nsIInputAvailableCallback> mCallback;
     nsCOMPtr<nsIEventTarget> mCallbackTarget;
     bool mDoingCallback;
     uint64_t mSize;
     nsresult mResultForCallback;
 };
--- a/netwerk/base/nsSyncStreamListener.h
+++ b/netwerk/base/nsSyncStreamListener.h
@@ -26,17 +26,17 @@ public:
     nsSyncStreamListener()
         : mStatus(NS_OK)
         , mKeepWaiting(false)
         , mDone(false) {}
 
     nsresult Init();
 
 private:
-    ~nsSyncStreamListener() {}
+    ~nsSyncStreamListener() = default;
 
     nsresult WaitForData();
 
     nsCOMPtr<nsIInputStream>    mPipeIn;
     nsCOMPtr<nsIOutputStream>   mPipeOut;
     nsresult                    mStatus;
     bool                        mKeepWaiting;
     bool                        mDone;
--- a/netwerk/base/nsTransportUtils.cpp
+++ b/netwerk/base/nsTransportUtils.cpp
@@ -59,17 +59,17 @@ public:
         : Runnable("nsTransportStatusEvent")
         , mProxy(proxy)
         , mTransport(transport)
         , mStatus(status)
         , mProgress(progress)
         , mProgressMax(progressMax)
     {}
 
-    ~nsTransportStatusEvent() {}
+    ~nsTransportStatusEvent() = default;
 
     NS_IMETHOD Run() override
     {
         // since this event is being handled, we need to clear the proxy's ref.
         // if not coalescing all, then last event may not equal self!
         {
             MutexAutoLock lock(mProxy->mLock);
             if (mProxy->mLastEvent == this)
--- a/netwerk/base/nsUDPSocket.cpp
+++ b/netwerk/base/nsUDPSocket.cpp
@@ -116,20 +116,16 @@ nsUDPOutputStream::nsUDPOutputStream(nsU
                                      PRNetAddr& aPrClientAddr)
   : mSocket(aSocket)
   , mFD(aFD)
   , mPrClientAddr(aPrClientAddr)
   , mIsClosed(false)
 {
 }
 
-nsUDPOutputStream::~nsUDPOutputStream()
-{
-}
-
 NS_IMETHODIMP nsUDPOutputStream::Close()
 {
   if (mIsClosed)
     return NS_BASE_STREAM_CLOSED;
 
   mIsClosed = true;
   return NS_OK;
 }
@@ -394,17 +390,17 @@ public:
     memcpy(&mAddr, aAddr, sizeof(mAddr));
     aData.SwapElements(mData);
   }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIUDPMESSAGE
 
 private:
-  ~UDPMessageProxy() {}
+  ~UDPMessageProxy() = default;
 
   NetAddr mAddr;
   nsCOMPtr<nsIOutputStream> mOutputStream;
   FallibleTArray<uint8_t> mData;
 };
 
 NS_IMPL_ISUPPORTS(UDPMessageProxy, nsIUDPMessage)
 
@@ -840,17 +836,17 @@ nsUDPSocket::GetAddress(NetAddr *aResult
 }
 
 namespace {
 //-----------------------------------------------------------------------------
 // SocketListenerProxy
 //-----------------------------------------------------------------------------
 class SocketListenerProxy final : public nsIUDPSocketListener
 {
-  ~SocketListenerProxy() {}
+  ~SocketListenerProxy() = default;
 
 public:
   explicit SocketListenerProxy(nsIUDPSocketListener* aListener)
     : mListener(new nsMainThreadPtrHolder<nsIUDPSocketListener>(
         "SocketListenerProxy::mListener", aListener))
     , mTarget(GetCurrentThreadEventTarget())
   { }
 
@@ -950,17 +946,17 @@ SocketListenerProxy::OnStopListeningRunn
 {
   mListener->OnStopListening(mSocket, mStatus);
   return NS_OK;
 }
 
 
 class SocketListenerProxyBackground final : public nsIUDPSocketListener
 {
-  ~SocketListenerProxyBackground() {}
+  ~SocketListenerProxyBackground() = default;
 
 public:
   explicit SocketListenerProxyBackground(nsIUDPSocketListener* aListener)
     : mListener(aListener)
     , mTarget(GetCurrentThreadEventTarget())
   { }
 
   NS_DECL_THREADSAFE_ISUPPORTS
@@ -1071,17 +1067,17 @@ public:
               FallibleTArray<uint8_t> &aData)
       : mSocket(aSocket)
       , mPort(aPort)
   {
     mData.SwapElements(aData);
   }
 
 private:
-  virtual ~PendingSend() {}
+  virtual ~PendingSend() = default;
 
   RefPtr<nsUDPSocket> mSocket;
   uint16_t mPort;
   FallibleTArray<uint8_t> mData;
 };
 
 NS_IMPL_ISUPPORTS(PendingSend, nsIDNSListener)
 
@@ -1114,17 +1110,17 @@ public:
 
   PendingSendStream(nsUDPSocket *aSocket, uint16_t aPort,
                     nsIInputStream *aStream)
       : mSocket(aSocket)
       , mPort(aPort)
       , mStream(aStream) {}
 
 private:
-  virtual ~PendingSendStream() {}
+  virtual ~PendingSendStream() = default;
 
   RefPtr<nsUDPSocket> mSocket;
   uint16_t mPort;
   nsCOMPtr<nsIInputStream> mStream;
 };
 
 NS_IMPL_ISUPPORTS(PendingSendStream, nsIDNSListener)
 
--- a/netwerk/base/nsUDPSocket.h
+++ b/netwerk/base/nsUDPSocket.h
@@ -101,17 +101,17 @@ public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIOUTPUTSTREAM
 
   nsUDPOutputStream(nsUDPSocket* aSocket,
                     PRFileDesc* aFD,
                     PRNetAddr& aPrClientAddr);
 
 private:
-  virtual ~nsUDPOutputStream();
+  virtual ~nsUDPOutputStream() = default;
 
   RefPtr<nsUDPSocket>       mSocket;
   PRFileDesc                  *mFD;
   PRNetAddr                   mPrClientAddr;
   bool                        mIsClosed;
 };
 
 } // namespace net
--- a/netwerk/base/nsURLParsers.cpp
+++ b/netwerk/base/nsURLParsers.cpp
@@ -219,19 +219,19 @@ nsBaseURLParser::ParsePath(const char *p
     if (pathLen < 0)
         pathLen = strlen(path);
 
     // path = [/]<segment1>/<segment2>/<...>/<segmentN>?<query>#<ref>
 
     // XXX PL_strnpbrk would be nice, but it's buggy
 
     // search for first occurrence of either ? or #
-    const char *query_beg = 0, *query_end = 0;
-    const char *ref_beg = 0;
-    const char *p = 0;
+    const char *query_beg = nullptr, *query_end = nullptr;
+    const char *ref_beg = nullptr;
+    const char *p = nullptr;
     for (p = path; p < path + pathLen; ++p) {
         // only match the query string if it precedes the reference fragment
         if (!ref_beg && !query_beg && *p == '?')
             query_beg = p + 1;
         else if (*p == '#') {
             ref_beg = p + 1;
             if (query_beg)
                 query_end = p;
--- a/netwerk/base/nsURLParsers.h
+++ b/netwerk/base/nsURLParsers.h
@@ -13,17 +13,17 @@
 // base class for url parsers
 //----------------------------------------------------------------------------
 
 class nsBaseURLParser : public nsIURLParser
 {
 public:
     NS_DECL_NSIURLPARSER
 
-    nsBaseURLParser() { }
+    nsBaseURLParser() = default;
 
 protected:
     // implemented by subclasses
     virtual void ParseAfterScheme(const char *spec, int32_t specLen,
                                   uint32_t *authPos, int32_t *authLen,
                                   uint32_t *pathPos, int32_t *pathLen) = 0;
 };
 
@@ -37,17 +37,17 @@ protected:
 // eg. file:////foo/bar.txt   (UNC-filepath = \\foo\bar.txt)
 //
 // XXX except in this case:
 //     file://foo/bar.txt     (the authority "foo"  is ignored)
 //----------------------------------------------------------------------------
 
 class nsNoAuthURLParser final : public nsBaseURLParser
 {
-    ~nsNoAuthURLParser() {}
+    ~nsNoAuthURLParser() = default;
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
 
 #if defined(XP_WIN)
     NS_IMETHOD ParseFilePath(const char *, int32_t,
                              uint32_t *, int32_t *,
                              uint32_t *, int32_t *,
@@ -72,17 +72,17 @@ public:
 //     http:/www.foo.com/bar.html
 //     http://www.foo.com/bar.html    (treated equivalently)
 //     http:///www.foo.com/bar.html
 //----------------------------------------------------------------------------
 
 class nsAuthURLParser : public nsBaseURLParser
 {
 protected:
-    virtual ~nsAuthURLParser() {}
+    virtual ~nsAuthURLParser() = default;
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
 
     NS_IMETHOD ParseAuthority(const char *auth, int32_t authLen,
                               uint32_t *usernamePos, int32_t *usernameLen,
                               uint32_t *passwordPos, int32_t *passwordLen,
                               uint32_t *hostnamePos, int32_t *hostnameLen,
@@ -108,17 +108,17 @@ public:
 //     http:www.foo.com/bar.html     (www.foo.com is authority)
 //     http:/www.foo.com/bar.html    (www.foo.com is part of file path)
 //     http://www.foo.com/bar.html   (www.foo.com is authority)
 //     http:///www.foo.com/bar.html  (www.foo.com is part of file path)
 //----------------------------------------------------------------------------
 
 class nsStdURLParser : public nsAuthURLParser
 {
-    virtual ~nsStdURLParser() {}
+    virtual ~nsStdURLParser() = default;
 
 public:
     void ParseAfterScheme(const char *spec, int32_t specLen,
                           uint32_t *authPos, int32_t *authLen,
                           uint32_t *pathPos, int32_t *pathLen) override;
 };
 
 #endif // nsURLParsers_h__
--- a/netwerk/cache/nsApplicationCacheService.cpp
+++ b/netwerk/cache/nsApplicationCacheService.cpp
@@ -24,20 +24,16 @@ static NS_DEFINE_CID(kCacheServiceCID, N
 NS_IMPL_ISUPPORTS(nsApplicationCacheService, nsIApplicationCacheService)
 
 nsApplicationCacheService::nsApplicationCacheService()
 {
     nsCOMPtr<nsICacheService> serv = do_GetService(kCacheServiceCID);
     mCacheService = nsCacheService::GlobalInstance();
 }
 
-nsApplicationCacheService::~nsApplicationCacheService()
-{
-}
-
 NS_IMETHODIMP
 nsApplicationCacheService::BuildGroupIDForInfo(
     nsIURI *aManifestURL,
     nsILoadContextInfo *aLoadContextInfo,
     nsACString &_result)
 {
     nsresult rv;
 
@@ -243,17 +239,17 @@ public:
         nsCOMPtr<nsIApplicationCacheService> cacheService =
             do_GetService(NS_APPLICATIONCACHESERVICE_CONTRACTID, &rv);
         NS_ENSURE_SUCCESS(rv, rv);
 
         return cacheService->EvictMatchingOriginAttributes(nsDependentString(aData));
     }
 
 private:
-    ~AppCacheClearDataObserver() {}
+    ~AppCacheClearDataObserver() = default;
 };
 
 NS_IMPL_ISUPPORTS(AppCacheClearDataObserver, nsIObserver)
 
 } // namespace
 
 // Instantiates and registers AppCacheClearDataObserver for notifications
 void
--- a/netwerk/cache/nsApplicationCacheService.h
+++ b/netwerk/cache/nsApplicationCacheService.h
@@ -16,13 +16,13 @@ public:
     nsApplicationCacheService();
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIAPPLICATIONCACHESERVICE
 
     static void AppClearDataObserverInit();
 
 private:
-    ~nsApplicationCacheService();
+    ~nsApplicationCacheService() = default;
     RefPtr<nsCacheService> mCacheService;
 };
 
 #endif // _nsApplicationCacheService_h_
--- a/netwerk/cache/nsCacheEntry.cpp
+++ b/netwerk/cache/nsCacheEntry.cpp
@@ -438,17 +438,17 @@ nsCacheEntryHashTable::AddEntry( nsCache
     NS_ASSERTION(initialized, "nsCacheEntryHashTable not initialized");
     if (!initialized)  return NS_ERROR_NOT_INITIALIZED;
     if (!cacheEntry)   return NS_ERROR_NULL_POINTER;
 
     hashEntry = table.Add(&(cacheEntry->mKey), fallible);
 
     if (!hashEntry)
         return NS_ERROR_FAILURE;
-    NS_ASSERTION(((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry == 0,
+    NS_ASSERTION(((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry == nullptr,
                  "### nsCacheEntryHashTable::AddEntry - entry already used");
     ((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry = cacheEntry;
 
     return NS_OK;
 }
 
 
 void
@@ -503,10 +503,10 @@ nsCacheEntryHashTable::MoveEntry(PLDHash
         ((nsCacheEntryHashTableEntry *)from)->cacheEntry;
 }
 
 
 void
 nsCacheEntryHashTable::ClearEntry(PLDHashTable * /* table */,
                                   PLDHashEntryHdr * hashEntry)
 {
-    ((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry = 0;
+    ((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry = nullptr;
 }
--- a/netwerk/cache/nsCacheEntry.h
+++ b/netwerk/cache/nsCacheEntry.h
@@ -243,17 +243,17 @@ public:
     {
     }
 
     void    DetachEntry() { mCacheEntry = nullptr; }
 
 private:
     nsCacheEntry * mCacheEntry;
 
-    virtual ~nsCacheEntryInfo() {}
+    virtual ~nsCacheEntryInfo() = default;
 };
 
 
 /******************************************************************************
 * nsCacheEntryHashTable
 *******************************************************************************/
 
 struct nsCacheEntryHashTableEntry : public PLDHashEntryHdr
--- a/netwerk/cache/nsCacheEntryDescriptor.cpp
+++ b/netwerk/cache/nsCacheEntryDescriptor.cpp
@@ -981,17 +981,17 @@ nsDecompressInputStreamWrapper::Close()
     mozilla::MutexAutoLock lock(mLock);
 
     if (!mDescriptor)
         return NS_ERROR_NOT_AVAILABLE;
 
     EndZstream();
     if (mReadBuffer) {
         free(mReadBuffer);
-        mReadBuffer = 0;
+        mReadBuffer = nullptr;
         mReadBufferLen = 0;
     }
     return nsInputStreamWrapper::Close_Locked();
 }
 
 nsresult nsCacheEntryDescriptor::
 nsDecompressInputStreamWrapper::InitZstream()
 {
@@ -1403,27 +1403,27 @@ nsCompressOutputStreamWrapper::Close()
         rv = mDescriptor->GetMetaDataElement("uncompressed-len",
                                              getter_Copies(uncompressedLenStr));
         if (NS_SUCCEEDED(rv)) {
             int32_t oldCount = uncompressedLenStr.ToInteger(&rv);
             if (NS_SUCCEEDED(rv)) {
                 mUncompressedCount += oldCount;
             }
         }
-        uncompressedLenStr.Adopt(0);
+        uncompressedLenStr.Adopt(nullptr);
         uncompressedLenStr.AppendInt(mUncompressedCount);
         rv = mDescriptor->SetMetaDataElement("uncompressed-len",
             uncompressedLenStr.get());
         if (NS_FAILED(rv))
             retval = rv;
     }
 
     if (mWriteBuffer) {
         free(mWriteBuffer);
-        mWriteBuffer = 0;
+        mWriteBuffer = nullptr;
         mWriteBufferLen = 0;
     }
 
     rv = nsOutputStreamWrapper::Close_Locked();
     if (NS_FAILED(rv))
         retval = rv;
 
     return retval;
--- a/netwerk/cache/nsCacheEntryDescriptor.h
+++ b/netwerk/cache/nsCacheEntryDescriptor.h
@@ -116,17 +116,17 @@ private:
          bool mStreamInitialized;
          bool mStreamEnded;
      public:
          NS_DECL_ISUPPORTS_INHERITED
 
          nsDecompressInputStreamWrapper(nsCacheEntryDescriptor * desc,
                                       uint32_t off)
           : nsInputStreamWrapper(desc, off)
-          , mReadBuffer(0)
+          , mReadBuffer(nullptr)
           , mReadBufferLen(0)
           , mStreamInitialized(false)
           , mStreamEnded(false)
          {
          }
          NS_IMETHOD Read(char* buf, uint32_t count, uint32_t * result) override;
          NS_IMETHOD Close() override;
      private:
@@ -196,17 +196,17 @@ private:
          bool mStreamEnded;
          uint32_t mUncompressedCount;
      public:
          NS_DECL_ISUPPORTS_INHERITED
 
          nsCompressOutputStreamWrapper(nsCacheEntryDescriptor * desc,
                                        uint32_t off)
           : nsOutputStreamWrapper(desc, off)
-          , mWriteBuffer(0)
+          , mWriteBuffer(nullptr)
           , mWriteBufferLen(0)
           , mStreamInitialized(false)
           , mStreamEnded(false)
           , mUncompressedCount(0)
          {
          }
          NS_IMETHOD Write(const char* buf, uint32_t count, uint32_t * result) override;
          NS_IMETHOD Close() override;
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -116,17 +116,17 @@ const int32_t OLD_MAX_CACHE_SIZE = 200 *
 const int32_t MAX_CACHE_SIZE = 350 * 1024;      // 350 MB
 const int32_t OLD_MAX_CACHE_SIZE = 1024 * 1024; //   1 GB
 #endif
 // Default cache size was 50 MB for many years until FF 4:
 const int32_t PRE_GECKO_2_0_DEFAULT_CACHE_SIZE = 50 * 1024;
 
 class nsCacheProfilePrefObserver : public nsIObserver
 {
-    virtual ~nsCacheProfilePrefObserver() {}
+    virtual ~nsCacheProfilePrefObserver() = default;
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIOBSERVER
 
     nsCacheProfilePrefObserver()
         : mHaveProfile(false)
         , mDiskCacheEnabled(false)
@@ -202,17 +202,17 @@ private:
     bool                    mClearCacheOnShutdown;
 };
 
 NS_IMPL_ISUPPORTS(nsCacheProfilePrefObserver, nsIObserver)
 
 class nsSetDiskSmartSizeCallback final : public nsITimerCallback
                                        , public nsINamed
 {
-    ~nsSetDiskSmartSizeCallback() {}
+    ~nsSetDiskSmartSizeCallback() = default;
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
 
     NS_IMETHOD Notify(nsITimer* aTimer) override {
         if (nsCacheService::gService) {
             nsCacheServiceAutoLock autoLock(LOCK_TELEM(NSSETDISKSMARTSIZECALLBACK_NOTIFY));
             nsCacheService::gService->SetDiskSmartSize_Locked();
@@ -323,28 +323,28 @@ nsCacheProfilePrefObserver::Install()
 {
     // install profile-change observer
     nsCOMPtr<nsIObserverService> observerService =
         mozilla::services::GetObserverService();
     if (!observerService)
         return NS_ERROR_FAILURE;
 
     nsresult rv, rv2 = NS_OK;
-    for (unsigned int i=0; i<ArrayLength(observerList); i++) {
-        rv = observerService->AddObserver(this, observerList[i], false);
+    for (auto& observer : observerList) {
+        rv = observerService->AddObserver(this, observer, false);
         if (NS_FAILED(rv))
             rv2 = rv;
     }
 
     // install preferences observer
     nsCOMPtr<nsIPrefBranch> branch = do_GetService(NS_PREFSERVICE_CONTRACTID);
     if (!branch) return NS_ERROR_FAILURE;
 
-    for (unsigned int i=0; i<ArrayLength(prefList); i++) {
-        rv = branch->AddObserver(prefList[i], this, false);
+    for (auto& pref : prefList) {
+        rv = branch->AddObserver(pref, this, false);
         if (NS_FAILED(rv))
             rv2 = rv;
     }
 
     // Determine if we have a profile already
     //     Install() is called *after* the profile-after-change notification
     //     when there is only a single profile, or it is specified on the
     //     commandline at startup.
@@ -366,28 +366,28 @@ nsCacheProfilePrefObserver::Install()
 
 void
 nsCacheProfilePrefObserver::Remove()
 {
     // remove Observer Service observers
     nsCOMPtr<nsIObserverService> obs =
         mozilla::services::GetObserverService();
     if (obs) {
-        for (unsigned int i=0; i<ArrayLength(observerList); i++) {
-            obs->RemoveObserver(this, observerList[i]);
+        for (auto& observer : observerList) {
+            obs->RemoveObserver(this, observer);
         }
     }
 
     // remove Pref Service observers
     nsCOMPtr<nsIPrefBranch> prefs =
         do_GetService(NS_PREFSERVICE_CONTRACTID);
     if (!prefs)
         return;
-    for (unsigned int i=0; i<ArrayLength(prefList); i++)
-        prefs->RemoveObserver(prefList[i], this); // remove cache pref observers
+    for (auto& pref : prefList)
+        prefs->RemoveObserver(pref, this); // remove cache pref observers
 }
 
 void
 nsCacheProfilePrefObserver::SetDiskCacheCapacity(int32_t capacity)
 {
     mDiskCacheCapacity = std::max(0, capacity);
 }
 
@@ -1012,17 +1012,17 @@ public:
         if (!(mRequest->IsBlocking() &&
             rv == NS_ERROR_CACHE_WAIT_FOR_VALIDATION))
             delete mRequest;
 
         return NS_OK;
     }
 
 protected:
-    virtual ~nsProcessRequestEvent() {}
+    virtual ~nsProcessRequestEvent() = default;
 
 private:
     nsCacheRequest *mRequest;
 };
 
 /******************************************************************************
  * nsDoomEvent
  *****************************************************************************/
@@ -1931,21 +1931,21 @@ nsCacheService::ProcessRequest(nsCacheRe
 {
     // !!! must be called with mLock held !!!
     nsresult           rv;
     nsCacheEntry *     entry = nullptr;
     nsCacheEntry *     doomedEntry = nullptr;
     nsCacheAccessMode  accessGranted = nsICache::ACCESS_NONE;
     if (result) *result = nullptr;
 
-    while(1) {  // Activate entry loop
+    while(true) {  // Activate entry loop
         rv = ActivateEntry(request, &entry, &doomedEntry);  // get the entry for this request
         if (NS_FAILED(rv))  break;
 
-        while(1) { // Request Access loop
+        while (true) { // Request Access loop
             NS_ASSERTION(entry, "no entry in Request Access loop!");
             // entry->RequestAccess queues request on entry
             rv = entry->RequestAccess(request, &accessGranted);
             if (rv != NS_ERROR_CACHE_WAIT_FOR_VALIDATION) break;
 
             if (request->IsBlocking()) {
                 if (request->mListener) {
                     // async exits - validate, doom, or close will resume
--- a/netwerk/cache/nsCacheUtils.cpp
+++ b/netwerk/cache/nsCacheUtils.cpp
@@ -28,20 +28,16 @@ private:
 nsShutdownThread::nsShutdownThread(nsIThread* aThread)
   : mozilla::Runnable("nsShutdownThread")
   , mMonitor("nsShutdownThread.mMonitor")
   , mShuttingDown(false)
   , mThread(aThread)
 {
 }
 
-nsShutdownThread::~nsShutdownThread()
-{
-}
-
 nsresult
 nsShutdownThread::Shutdown(nsIThread *aThread)
 {
   nsresult rv;
   RefPtr<nsDestroyThreadEvent> ev = new nsDestroyThreadEvent(aThread);
   rv = NS_DispatchToMainThread(ev);
   if (NS_FAILED(rv)) {
     NS_WARNING("Dispatching event in nsShutdownThread::Shutdown failed!");
--- a/netwerk/cache/nsCacheUtils.h
+++ b/netwerk/cache/nsCacheUtils.h
@@ -14,17 +14,17 @@
 class nsIThread;
 
 /**
  * A class with utility methods for shutting down nsIThreads easily.
   */
 class nsShutdownThread : public mozilla::Runnable {
 public:
   explicit nsShutdownThread(nsIThread *aThread);
-  ~nsShutdownThread();
+  ~nsShutdownThread() = default;
 
   NS_IMETHOD Run() override;
 
 /**
  * Shutdown ensures that aThread->Shutdown() is called on a main thread
  */
   static nsresult Shutdown(nsIThread *aThread);
 
--- a/netwerk/cache/nsDiskCacheBinding.cpp
+++ b/netwerk/cache/nsDiskCacheBinding.cpp
@@ -241,17 +241,17 @@ nsDiskCacheBindery::AddBinding(nsDiskCac
         return NS_OK;
     }
 
 
     // insert binding in generation order
     nsDiskCacheBinding * p  = hashEntry->mBinding;
     bool     calcGeneration = (binding->mGeneration == 0);  // do we need to calculate generation?
     if (calcGeneration)  binding->mGeneration = 1;          // initialize to 1 if uninitialized
-    while (1) {
+    while (true) {
 
         if (binding->mGeneration < p->mGeneration) {
             // here we are
             PR_INSERT_BEFORE(binding, p);
             if (hashEntry->mBinding == p)
                 hashEntry->mBinding = binding;
             break;
         }
@@ -298,20 +298,19 @@ nsDiskCacheBindery::RemoveBinding(nsDisk
     }
 
     if (binding == hashEntry->mBinding) {
         if (PR_CLIST_IS_EMPTY(binding)) {
             // remove this hash entry
             table.Remove((void*)(uintptr_t) binding->mRecord.HashNumber());
             return;
 
-        } else {
-            // promote next binding to head, and unlink this binding
-            hashEntry->mBinding = (nsDiskCacheBinding *)PR_NEXT_LINK(binding);
         }
+        // promote next binding to head, and unlink this binding
+        hashEntry->mBinding = (nsDiskCacheBinding *)PR_NEXT_LINK(binding);
     }
     PR_REMOVE_AND_INIT_LINK(binding);
 }
 
 /**
  * ActiveBindings: return true if any bindings have open descriptors.
  */
 bool
--- a/netwerk/cache/nsDiskCacheDevice.cpp
+++ b/netwerk/cache/nsDiskCacheDevice.cpp
@@ -185,17 +185,17 @@ public:
     NS_DECL_NSICACHEDEVICEINFO
 
     explicit nsDiskCacheDeviceInfo(nsDiskCacheDevice* device)
         :   mDevice(device)
     {
     }
 
 private:
-    virtual ~nsDiskCacheDeviceInfo() {}
+    virtual ~nsDiskCacheDeviceInfo() = default;
 
     nsDiskCacheDevice* mDevice;
 };
 
 NS_IMPL_ISUPPORTS(nsDiskCacheDeviceInfo, nsICacheDeviceInfo)
 
 NS_IMETHODIMP nsDiskCacheDeviceInfo::GetDescription(nsACString& aDescription)
 {
@@ -462,30 +462,33 @@ nsDiskCacheDevice::FindEntry(nsCString *
     if (mClearingDiskCache)  return nullptr;
     nsDiskCacheRecord       record;
     nsDiskCacheBinding *    binding = nullptr;
     PLDHashNumber           hashNumber = nsDiskCache::Hash(key->get());
 
     *collision = false;
 
     binding = mBindery.FindActiveBinding(hashNumber);
-    if (binding && !binding->mCacheEntry->Key()->Equals(*key)) {
-        *collision = true;
-        return nullptr;
-    } else if (binding && binding->mDeactivateEvent) {
-        binding->mDeactivateEvent->CancelEvent();
-        binding->mDeactivateEvent = nullptr;
-        CACHE_LOG_DEBUG(("CACHE: reusing deactivated entry %p " \
-                         "req-key=%s  entry-key=%s\n",
-                         binding->mCacheEntry, key->get(),
-                         binding->mCacheEntry->Key()->get()));
+    if (binding) {
+        if (!binding->mCacheEntry->Key()->Equals(*key)) {
+            *collision = true;
+            return nullptr;
+        }
+        if (binding->mDeactivateEvent) {
+            binding->mDeactivateEvent->CancelEvent();
+            binding->mDeactivateEvent = nullptr;
+            CACHE_LOG_DEBUG(("CACHE: reusing deactivated entry %p " \
+                            "req-key=%s  entry-key=%s\n",
+                            binding->mCacheEntry, key->get(),
+                            binding->mCacheEntry->Key()->get()));
 
-        return binding->mCacheEntry; // just return this one, observing that
-                                     // FindActiveBinding() does not return
-                                     // bindings to doomed entries
+            return binding->mCacheEntry; // just return this one, observing that
+                                        // FindActiveBinding() does not return
+                                        // bindings to doomed entries
+        }
     }
     binding = nullptr;
 
     // lookup hash number in cache map
     nsresult rv = mCacheMap.FindRecord(hashNumber, &record);
     if (NS_FAILED(rv))  return nullptr;  // XXX log error?
 
     nsDiskCacheEntry * diskEntry = mCacheMap.ReadDiskCacheEntry(&record);
@@ -915,19 +918,19 @@ nsDiskCacheDevice::Visit(nsICacheVisitor
 }
 
 // Max allowed size for an entry is currently MIN(mMaxEntrySize, 1/8 CacheCapacity)
 bool
 nsDiskCacheDevice::EntryIsTooBig(int64_t entrySize)
 {
     if (mMaxEntrySize == -1) // no limit
         return entrySize > (static_cast<int64_t>(mCacheCapacity) * 1024 / 8);
-    else
-        return entrySize > mMaxEntrySize ||
-               entrySize > (static_cast<int64_t>(mCacheCapacity) * 1024 / 8);
+
+    return entrySize > mMaxEntrySize ||
+            entrySize > (static_cast<int64_t>(mCacheCapacity) * 1024 / 8);
 }
 
 nsresult
 nsDiskCacheDevice::EvictEntries(const char * clientID)
 {
     CACHE_LOG_DEBUG(("CACHE: disk EvictEntries [%s]\n", clientID));
 
     if (!Initialized())  return NS_ERROR_NOT_INITIALIZED;
--- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp
+++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp
@@ -334,17 +334,17 @@ public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSICACHEDEVICEINFO
 
   explicit nsOfflineCacheDeviceInfo(nsOfflineCacheDevice* device)
     : mDevice(device)
   {}
 
 private:
-  ~nsOfflineCacheDeviceInfo() {}
+  ~nsOfflineCacheDeviceInfo() = default;
 
   nsOfflineCacheDevice* mDevice;
 };
 
 NS_IMPL_ISUPPORTS(nsOfflineCacheDeviceInfo, nsICacheDeviceInfo)
 
 NS_IMETHODIMP
 nsOfflineCacheDeviceInfo::GetDescription(nsACString& aDescription)
@@ -400,17 +400,17 @@ nsOfflineCacheDeviceInfo::GetMaximumSize
 }
 
 /******************************************************************************
  * nsOfflineCacheBinding
  */
 
 class nsOfflineCacheBinding final : public nsISupports
 {
-  ~nsOfflineCacheBinding() {}
+  ~nsOfflineCacheBinding() = default;
 
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
   static nsOfflineCacheBinding *
       Create(nsIFile *cacheDir, const nsCString *key, int generation);
 
   enum { FLAG_NEW_ENTRY = 1 };
@@ -569,17 +569,17 @@ CreateCacheEntry(nsOfflineCacheDevice *d
 
 
 /******************************************************************************
  * nsOfflineCacheEntryInfo
  */
 
 class nsOfflineCacheEntryInfo final : public nsICacheEntryInfo
 {
-  ~nsOfflineCacheEntryInfo() {}
+  ~nsOfflineCacheEntryInfo() = default;
 
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSICACHEENTRYINFO
 
   nsOfflineCacheRecord *mRec;
 };
 
@@ -925,17 +925,17 @@ public:
 
   NS_IMETHOD Run() override
   {
     mDB->Close();
     return NS_OK;
   }
 
 protected:
-  virtual ~nsCloseDBEvent() {}
+  virtual ~nsCloseDBEvent() = default;
 
 private:
   nsCOMPtr<mozIStorageConnection> mDB;
 };
 
 
 
 /******************************************************************************
@@ -950,19 +950,16 @@ nsOfflineCacheDevice::nsOfflineCacheDevi
   , mDeltaCounter(0)
   , mAutoShutdown(false)
   , mLock("nsOfflineCacheDevice.lock")
   , mActiveCaches(4)
   , mLockedEntries(32)
 {
 }
 
-nsOfflineCacheDevice::~nsOfflineCacheDevice()
-{}
-
 /* static */
 bool
 nsOfflineCacheDevice::GetStrictFileOriginPolicy()
 {
     nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
 
     bool retval;
     if (prefs && NS_SUCCEEDED(prefs->GetBoolPref("security.fileuri.strict_origin_policy", &retval)))
@@ -2537,17 +2534,17 @@ nsOfflineCacheDevice::Evict(nsILoadConte
 
   return NS_OK;
 }
 
 namespace { // anon
 
 class OriginMatch final : public mozIStorageFunction
 {
-  ~OriginMatch() {}
+  ~OriginMatch() = default;
   mozilla::OriginAttributesPattern const mPattern;
 
   NS_DECL_ISUPPORTS
   NS_DECL_MOZISTORAGEFUNCTION
   explicit OriginMatch(mozilla::OriginAttributesPattern const &aPattern)
     : mPattern(aPattern) {}
 };
 
--- a/netwerk/cache/nsDiskCacheDeviceSQL.h
+++ b/netwerk/cache/nsDiskCacheDeviceSQL.h
@@ -32,17 +32,17 @@ class nsApplicationCacheNamespace final 
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIAPPLICATIONCACHENAMESPACE
 
   nsApplicationCacheNamespace() : mItemType(0) {}
 
 private:
-  ~nsApplicationCacheNamespace() {}
+  ~nsApplicationCacheNamespace() = default;
 
   uint32_t mItemType;
   nsCString mNamespaceSpec;
   nsCString mData;
 };
 
 class nsOfflineCacheEvictionFunction final : public mozIStorageFunction {
 public:
@@ -51,17 +51,17 @@ public:
 
   explicit nsOfflineCacheEvictionFunction(nsOfflineCacheDevice *device);
 
   void Init();
   void Reset();
   void Apply();
 
 private:
-  ~nsOfflineCacheEvictionFunction() {}
+  ~nsOfflineCacheEvictionFunction() = default;
 
   nsOfflineCacheDevice *mDevice;
   bool mTLSInited;
 };
 
 class nsOfflineCacheDevice final : public nsCacheDevice
                                  , public nsISupports
 {
@@ -190,17 +190,17 @@ public:
 
   nsIFile *               BaseDirectory() { return mBaseDirectory; }
   nsIFile *               CacheDirectory() { return mCacheDirectory; }
   uint32_t                CacheCapacity() { return mCacheCapacity; }
   uint32_t                CacheSize();
   uint32_t                EntryCount();
 
 private:
-  ~nsOfflineCacheDevice();
+  ~nsOfflineCacheDevice() = default;
 
   friend class nsApplicationCache;
 
   static bool GetStrictFileOriginPolicy();
 
   bool     Initialized() { return mDB != nullptr; }
 
   nsresult InitActiveCaches();
--- a/netwerk/cache/nsDiskCacheEntry.h
+++ b/netwerk/cache/nsDiskCacheEntry.h
@@ -85,16 +85,16 @@ public:
         : mDeviceID(deviceID)
         , mDiskEntry(diskEntry)
     {
     }
 
     const char* Key() { return mDiskEntry->Key(); }
 
 private:
-    virtual ~nsDiskCacheEntryInfo() {}
+    virtual ~nsDiskCacheEntryInfo() = default;
 
     const char *        mDeviceID;
     nsDiskCacheEntry *  mDiskEntry;
 };
 
 
 #endif /* _nsDiskCacheEntry_h_ */
--- a/netwerk/cache/nsDiskCacheMap.cpp
+++ b/netwerk/cache/nsDiskCacheMap.cpp
@@ -238,18 +238,18 @@ nsDiskCacheMap::Close(bool flush)
     return rv;
 }
 
 
 nsresult
 nsDiskCacheMap::Trim()
 {
     nsresult rv, rv2 = NS_OK;
-    for (int i=0; i < kNumBlockFiles; ++i) {
-        rv = mBlockFile[i].Trim();
+    for (auto& block : mBlockFile) {
+        rv = block.Trim();
         if (NS_FAILED(rv))  rv2 = rv;   // if one or more errors, report at least one
     }
     // Try to shrink the records array
     rv = ShrinkRecords();
     if (NS_FAILED(rv))  rv2 = rv;   // if one or more errors, report at least one
     return rv2;
 }
 
@@ -699,18 +699,18 @@ nsDiskCacheMap::OpenBlockFiles(nsDiskCac
     return rv;
 }
 
 
 nsresult
 nsDiskCacheMap::CloseBlockFiles(bool flush)
 {
     nsresult rv, rv2 = NS_OK;
-    for (int i=0; i < kNumBlockFiles; ++i) {
-        rv = mBlockFile[i].Close(flush);
+    for (auto& block : mBlockFile) {
+        rv = block.Close(flush);
         if (NS_FAILED(rv))  rv2 = rv;   // if one or more errors, report at least one
     }
     return rv2;
 }
 
 
 bool
 nsDiskCacheMap::CacheFilesExist()
@@ -914,17 +914,17 @@ nsDiskCacheMap::WriteDiskCacheEntry(nsDi
         }
     }
 
     binding->mRecord.SetEvictionRank(ULONG_MAX - SecondsFromPRTime(PR_Now()));
     // write entry data to disk cache block file
     diskEntry->Swap();
 
     if (fileIndex != 0) {
-        while (1) {
+        while (true) {
             uint32_t  blockSize = GetBlockSizeForIndex(fileIndex);
             uint32_t  blocks    = ((size - 1) / blockSize) + 1;
 
             int32_t startBlock;
             rv = mBlockFile[fileIndex - 1].WriteBlocks(diskEntry, size, blocks,
                                                        &startBlock);
             if (NS_SUCCEEDED(rv)) {
                 // update binding and cache map record
@@ -1224,18 +1224,18 @@ nsDiskCacheMap::SizeOfExcludingThis(Mall
   size_t usage = aMallocSizeOf(mRecordArray);
 
   usage += aMallocSizeOf(mBuffer);
   usage += aMallocSizeOf(mMapFD);
   usage += aMallocSizeOf(mCleanFD);
   usage += aMallocSizeOf(mCacheDirectory);
   usage += aMallocSizeOf(mCleanCacheTimer);
 
-  for (int i = 0; i < kNumBlockFiles; i++) {
-    usage += mBlockFile[i].SizeOfExcludingThis(aMallocSizeOf);
+  for (auto& block : mBlockFile) {
+    usage += block.SizeOfExcludingThis(aMallocSizeOf);
   }
 
   return usage;
 }
 
 nsresult
 nsDiskCacheMap::InitCacheClean(nsIFile *  cacheDirectory,
                                nsDiskCache::CorruptCacheInfo *  corruptInfo)
--- a/netwerk/cache/nsMemoryCacheDevice.cpp
+++ b/netwerk/cache/nsMemoryCacheDevice.cpp
@@ -35,18 +35,18 @@ nsMemoryCacheDevice::nsMemoryCacheDevice
       mHardLimit(4 * 1024 * 1024),       // default, if no pref
       mSoftLimit((mHardLimit * 9) / 10), // default, if no pref
       mTotalSize(0),
       mInactiveSize(0),
       mEntryCount(0),
       mMaxEntryCount(0),
       mMaxEntrySize(-1)  // -1 means "no limit"
 {
-    for (int i=0; i<kQueueCount; ++i)
-        PR_INIT_CLIST(&mEvictionList[i]);
+    for (auto& eviction : mEvictionList)
+        PR_INIT_CLIST(&eviction);
 }
 
 
 nsMemoryCacheDevice::~nsMemoryCacheDevice()
 {
     Shutdown();
 }
 
@@ -267,18 +267,18 @@ nsMemoryCacheDevice::GetFileForEntry( ns
 bool
 nsMemoryCacheDevice::EntryIsTooBig(int64_t entrySize)
 {
     CACHE_LOG_DEBUG(("nsMemoryCacheDevice::EntryIsTooBig "
                      "[size=%" PRId64 " max=%d soft=%d]\n",
                      entrySize, mMaxEntrySize, mSoftLimit));
     if (mMaxEntrySize == -1)
         return entrySize > mSoftLimit;
-    else
-        return (entrySize > mSoftLimit || entrySize > mMaxEntrySize);
+
+    return (entrySize > mSoftLimit || entrySize > mMaxEntrySize);
 }
 
 size_t
 nsMemoryCacheDevice::TotalSize()
 {
     return mTotalSize;
 }
 
@@ -359,17 +359,17 @@ nsMemoryCacheDevice::EvictEntriesIfNeces
 
     uint32_t now = SecondsFromPRTime(PR_Now());
     uint64_t entryCost = 0;
     uint64_t maxCost = 0;
     do {
         // LRU-SP eviction selection: Check the head of each segment (each
         // eviction list, kept in LRU order) and select the maximal-cost
         // entry for eviction. Cost is time-since-accessed * size / nref.
-        maxEntry = 0;
+        maxEntry = nullptr;
         for (int i = kQueueCount - 1; i >= 0; --i) {
             entry = (nsCacheEntry *)PR_LIST_HEAD(&mEvictionList[i]);
 
             // If the head of a list is in use, check the next available entry
             while ((entry != &mEvictionList[i]) &&
                    (entry->IsInUse())) {
                 entry = (nsCacheEntry *)PR_NEXT_LINK(entry);
             }
@@ -532,19 +532,19 @@ nsMemoryCacheDevice::SetMaxEntrySize(int
 
 #ifdef DEBUG
 void
 nsMemoryCacheDevice::CheckEntryCount()
 {
     if (!mInitialized)  return;
 
     int32_t evictionListCount = 0;
-    for (int i=0; i<kQueueCount; ++i) {
-        PRCList * elem = PR_LIST_HEAD(&mEvictionList[i]);
-        while (elem != &mEvictionList[i]) {
+    for (auto& eviction : mEvictionList) {
+        PRCList * elem = PR_LIST_HEAD(&eviction);
+        while (elem != &eviction) {
             elem = PR_NEXT_LINK(elem);
             ++evictionListCount;
         }
     }
     NS_ASSERTION(mEntryCount == evictionListCount, "### mem cache badness");
 
     int32_t entryCount = 0;
     for (auto iter = mMemCacheEntries.Iter(); !iter.Done(); iter.Next()) {
--- a/netwerk/cache/nsMemoryCacheDevice.h
+++ b/netwerk/cache/nsMemoryCacheDevice.h
@@ -112,14 +112,14 @@ public:
     NS_DECL_NSICACHEDEVICEINFO
 
     explicit nsMemoryCacheDeviceInfo(nsMemoryCacheDevice* device)
         :   mDevice(device)
     {
     }
 
 private:
-    virtual ~nsMemoryCacheDeviceInfo() {}
+    virtual ~nsMemoryCacheDeviceInfo() = default;
     nsMemoryCacheDevice* mDevice;
 };
 
 
 #endif // _nsMemoryCacheDevice_h_
--- a/netwerk/cache2/CacheEntry.cpp
+++ b/netwerk/cache2/CacheEntry.cpp
@@ -1920,20 +1920,16 @@ void CacheEntry::StoreFrecency(double aF
 // CacheOutputCloseListener
 
 CacheOutputCloseListener::CacheOutputCloseListener(CacheEntry* aEntry)
   : Runnable("net::CacheOutputCloseListener")
   , mEntry(aEntry)
 {
 }
 
-CacheOutputCloseListener::~CacheOutputCloseListener()
-{
-}
-
 void CacheOutputCloseListener::OnOutputClosed()
 {
   // We need this class and to redispatch since this callback is invoked
   // under the file's lock and to do the job we need to enter the entry's
   // lock too.  That would lead to potential deadlocks.
   NS_DispatchToCurrentThread(this);
 }
 
--- a/netwerk/cache2/CacheEntry.h
+++ b/netwerk/cache2/CacheEntry.h
@@ -485,17 +485,17 @@ private:
 class CacheOutputCloseListener final : public Runnable
 {
 public:
   void OnOutputClosed();
 
 private:
   friend class CacheEntry;
 
-  virtual ~CacheOutputCloseListener();
+  virtual ~CacheOutputCloseListener() = default;
 
   NS_DECL_NSIRUNNABLE
   explicit CacheOutputCloseListener(CacheEntry* aEntry);
 
 private:
   RefPtr<CacheEntry> mEntry;
 };
 
--- a/netwerk/cache2/CacheFile.cpp
+++ b/netwerk/cache2/CacheFile.cpp
@@ -149,19 +149,17 @@ public:
 
   NS_IMETHOD OnFileRenamed(CacheFileHandle *aHandle, nsresult aResult) override
   {
     MOZ_CRASH("DoomFileHelper::OnFileRenamed should not be called!");
     return NS_ERROR_UNEXPECTED;
   }
 
 private:
-  virtual ~DoomFileHelper()
-  {
-  }
+  virtual ~DoomFileHelper() = default;
 
   nsCOMPtr<CacheFileListener>  mListener;
 };
 
 NS_IMPL_ISUPPORTS(DoomFileHelper, CacheFileIOListener)
 
 
 NS_IMPL_ADDREF(CacheFile)
--- a/netwerk/cache2/CacheFileIOManager.cpp
+++ b/netwerk/cache2/CacheFileIOManager.cpp
@@ -547,19 +547,17 @@ public:
   ShutdownEvent()
     : Runnable("net::ShutdownEvent")
     , mMonitor("ShutdownEvent.mMonitor")
     , mNotified(false)
   {
   }
 
 protected:
-  ~ShutdownEvent()
-  {
-  }
+  ~ShutdownEvent() = default;
 
 public:
   NS_IMETHOD Run() override
   {
     MonitorAutoLock mon(mMonitor);
 
     CacheFileIOManager::gInstance->ShutdownInternal();
 
@@ -648,19 +646,17 @@ public:
   {
     mIOMan = CacheFileIOManager::gInstance;
     if (!(mFlags & CacheFileIOManager::SPECIAL_FILE)) {
       Start(mIOMan->mIOThread);
     }
   }
 
 protected:
-  ~OpenFileEvent()
-  {
-  }
+  ~OpenFileEvent() = default;
 
 public:
   NS_IMETHOD Run() override
   {
     nsresult rv = NS_OK;
 
     if (!(mFlags & CacheFileIOManager::SPECIAL_FILE)) {
       SHA1Sum sum;
@@ -716,19 +712,17 @@ public:
     , mCallback(aCallback)
   {
     if (!mHandle->IsSpecialFile()) {
       Start(CacheFileIOManager::gInstance->mIOThread);
     }
   }
 
 protected:
-  ~ReadEvent()
-  {
-  }
+  ~ReadEvent() = default;
 
 public:
   NS_IMETHOD Run() override
   {
     nsresult rv;
 
     if (mHandle->IsClosed() || (mCallback && mCallback->IsKilled())) {
       rv = NS_ERROR_NOT_INITIALIZED;
@@ -830,19 +824,17 @@ public:
   DoomFileEvent(CacheFileHandle* aHandle, CacheFileIOListener* aCallback)
     : Runnable("net::DoomFileEvent")
     , mCallback(aCallback)
     , mHandle(aHandle)
   {
   }
 
 protected:
-  ~DoomFileEvent()
-  {
-  }
+  ~DoomFileEvent() = default;
 
 public:
   NS_IMETHOD Run() override
   {
     nsresult rv;
 
     if (mHandle->IsClosed()) {
       rv = NS_ERROR_NOT_INITIALIZED;
@@ -872,19 +864,17 @@ public:
     SHA1Sum sum;
     sum.update(aKey.BeginReading(), aKey.Length());
     sum.finish(mHash);
 
     mIOMan = CacheFileIOManager::gInstance;
   }
 
 protected:
-  ~DoomFileByKeyEvent()
-  {
-  }
+  ~DoomFileByKeyEvent() = default;
 
 public:
   NS_IMETHOD Run() override
   {
     nsresult rv;
 
     if (!mIOMan) {
       rv = NS_ERROR_NOT_INITIALIZED;
@@ -910,19 +900,17 @@ class ReleaseNSPRHandleEvent : public Ru
 public:
   explicit ReleaseNSPRHandleEvent(CacheFileHandle* aHandle)
     : Runnable("net::ReleaseNSPRHandleEvent")
     , mHandle(aHandle)
   {
   }
 
 protected:
-  ~ReleaseNSPRHandleEvent()
-  {
-  }
+  ~ReleaseNSPRHandleEvent() = default;
 
 public:
   NS_IMETHOD Run() override
   {
     if (!mHandle->IsClosed()) {
       CacheFileIOManager::gInstance->MaybeReleaseNSPRHandleInternal(mHandle);
     }
 
@@ -943,19 +931,17 @@ public:
     , mHandle(aHandle)
     , mTruncatePos(aTruncatePos)
     , mEOFPos(aEOFPos)
     , mCallback(aCallback)
   {
   }
 
 protected:
-  ~TruncateSeekSetEOFEvent()
-  {
-  }
+  ~TruncateSeekSetEOFEvent() = default;
 
 public:
   NS_IMETHOD Run() override
   {
     nsresult rv;
 
     if (mHandle->IsClosed() || (mCallback && mCallback->IsKilled())) {
       rv = NS_ERROR_NOT_INITIALIZED;
@@ -986,19 +972,17 @@ public:
     : Runnable("net::RenameFileEvent")
     , mHandle(aHandle)
     , mNewName(aNewName)
     , mCallback(aCallback)
   {
   }
 
 protected:
-  ~RenameFileEvent()
-  {
-  }
+  ~RenameFileEvent() = default;
 
 public:
   NS_IMETHOD Run() override
   {
     nsresult rv;
 
     if (mHandle->IsClosed()) {
       rv = NS_ERROR_NOT_INITIALIZED;
@@ -1030,19 +1014,17 @@ public:
     , mHandle(aHandle)
     , mOriginAttrsHash(aOriginAttrsHash)
     , mAnonymous(aAnonymous)
     , mPinning(aPinning)
   {
   }
 
 protected:
-  ~InitIndexEntryEvent()
-  {
-  }
+  ~InitIndexEntryEvent() = default;
 
 public:
   NS_IMETHOD Run() override
   {
     if (mHandle->IsClosed() || mHandle->IsDoomed()) {
       return NS_OK;
     }
 
@@ -1101,19 +1083,17 @@ public:
     }
     if (aOnStopTime) {
       mHasOnStopTime = true;
       mOnStopTime = *aOnStopTime;
     }
   }
 
 protected:
-  ~UpdateIndexEntryEvent()
-  {
-  }
+  ~UpdateIndexEntryEvent() = default;
 
 public:
   NS_IMETHOD Run() override
   {
     if (mHandle->IsClosed() || mHandle->IsDoomed()) {
       return NS_OK;
     }
 
@@ -1159,17 +1139,17 @@ public:
                              CacheFile* aFile,
                              EMode aMode)
     : Runnable("net::MetadataWriteScheduleEvent")
     , mMode(aMode)
     , mFile(aFile)
     , mIOMan(aManager)
   { }
 
-  virtual ~MetadataWriteScheduleEvent() { }
+  virtual ~MetadataWriteScheduleEvent() = default;
 
   NS_IMETHOD Run() override
   {
     RefPtr<CacheFileIOManager> ioMan = CacheFileIOManager::gInstance;
     if (!ioMan) {
       NS_WARNING("CacheFileIOManager already gone in MetadataWriteScheduleEvent::Run()");
       return NS_OK;
     }
@@ -3546,30 +3526,29 @@ CacheFileIOManager::RemoveTrashInternal(
     }
 
     nsCOMPtr<nsIFile> file;
     rv = mTrashDirEnumerator->GetNextFile(getter_AddRefs(file));
     if (!file) {
       mTrashDirEnumerator->Close();
       mTrashDirEnumerator = nullptr;
       continue; // check elapsed time
-    } else {
-      bool isDir = false;
-      file->IsDirectory(&isDir);
-      if (isDir) {
-        NS_WARNING("Found a directory in a trash directory! It will be removed "
-                   "recursively, but this can block IO thread for a while!");
-        if (LOG_ENABLED()) {
-          LOG(("CacheFileIOManager::RemoveTrashInternal() - Found a directory in a trash "
-              "directory! It will be removed recursively, but this can block IO "
-              "thread for a while! [file=%s]", file->HumanReadablePath().get()));
-        }
+    }
+    bool isDir = false;
+    file->IsDirectory(&isDir);
+    if (isDir) {
+      NS_WARNING("Found a directory in a trash directory! It will be removed "
+                  "recursively, but this can block IO thread for a while!");
+      if (LOG_ENABLED()) {
+        LOG(("CacheFileIOManager::RemoveTrashInternal() - Found a directory in a trash "
+            "directory! It will be removed recursively, but this can block IO "
+            "thread for a while! [file=%s]", file->HumanReadablePath().get()));
       }
-      file->Remove(isDir);
     }
+    file->Remove(isDir);
   }
 
   NS_NOTREACHED("We should never get here");
   return NS_OK;
 }
 
 nsresult
 CacheFileIOManager::FindTrashDirToRemove()
--- a/netwerk/cache2/CacheFileInputStream.cpp
+++ b/netwerk/cache2/CacheFileInputStream.cpp
@@ -156,19 +156,18 @@ CacheFileInputStream::ReadSegments(nsWri
 
   while (true) {
     if (NS_FAILED(mStatus))
       return mStatus;
 
     if (!mChunk) {
       if (mListeningForChunk == -1) {
         return NS_OK;
-      } else {
-        return NS_BASE_STREAM_WOULD_BLOCK;
       }
+      return NS_BASE_STREAM_WOULD_BLOCK;
     }
 
     if (aCount == 0) {
       break;
     }
 
     CacheFileChunkReadHandle hnd = mChunk->GetReadHandle();
     int64_t canRead = CanRead(&hnd);
@@ -492,19 +491,18 @@ CacheFileInputStream::OnChunkUpdated(Cac
        this, aChunk->Index()));
 
   if (!mWaitingForUpdate) {
     LOG(("CacheFileInputStream::OnChunkUpdated() - Ignoring notification since "
          "mWaitingforUpdate == false. [this=%p]", this));
 
     return NS_OK;
   }
-  else {
-    mWaitingForUpdate = false;
-  }
+
+  mWaitingForUpdate = false;
 
   MOZ_ASSERT(mChunk == aChunk);
 
   MaybeNotifyListener();
 
   return NS_OK;
 }
 
@@ -550,19 +548,18 @@ CacheFileInputStream::EnsureCorrectChunk
 
   if (mChunk) {
     if (mChunk->Index() == chunkIdx) {
       // we have a correct chunk
       LOG(("CacheFileInputStream::EnsureCorrectChunk() - Have correct chunk "
            "[this=%p, idx=%d]", this, chunkIdx));
 
       return;
-    } else {
-      ReleaseChunk();
     }
+    ReleaseChunk();
   }
 
   MOZ_ASSERT(!mWaitingForUpdate);
 
   if (aReleaseOnly)
     return;
 
   if (mListeningForChunk == static_cast<int64_t>(chunkIdx)) {
--- a/netwerk/cache2/CacheFileOutputStream.cpp
+++ b/netwerk/cache2/CacheFileOutputStream.cpp
@@ -393,19 +393,17 @@ CacheFileOutputStream::EnsureCorrectChun
   if (mChunk) {
     if (mChunk->Index() == chunkIdx) {
       // we have a correct chunk
       LOG(("CacheFileOutputStream::EnsureCorrectChunk() - Have correct chunk "
            "[this=%p, idx=%d]", this, chunkIdx));
 
       return;
     }
-    else {
-      ReleaseChunk();
-    }
+    ReleaseChunk();
   }
 
   if (aReleaseOnly)
     return;
 
   nsresult rv;
   rv = mFile->GetChunkLocked(chunkIdx, CacheFile::WRITER, nullptr,
                              getter_AddRefs(mChunk));
--- a/netwerk/cache2/CacheFileUtils.cpp
+++ b/netwerk/cache2/CacheFileUtils.cpp
@@ -261,24 +261,16 @@ KeyMatchesLoadContextInfo(const nsACStri
   *_retval = info->Equals(aInfo);
   return NS_OK;
 }
 
 ValidityPair::ValidityPair(uint32_t aOffset, uint32_t aLen)
   : mOffset(aOffset), mLen(aLen)
 {}
 
-ValidityPair&
-ValidityPair::operator=(const ValidityPair& aOther)
-{
-  mOffset = aOther.mOffset;
-  mLen = aOther.mLen;
-  return *this;
-}
-
 bool
 ValidityPair::CanBeMerged(const ValidityPair& aOther) const
 {
   // The pairs can be merged into a single one if the start of one of the pairs
   // is placed anywhere in the validity interval of other pair or exactly after
   // its end.
   return IsInOrFollows(aOther.mOffset) || aOther.IsInOrFollows(mOffset);
 }
--- a/netwerk/cache2/CacheFileUtils.h
+++ b/netwerk/cache2/CacheFileUtils.h
@@ -35,17 +35,17 @@ nsresult
 KeyMatchesLoadContextInfo(const nsACString &aKey,
                           nsILoadContextInfo *aInfo,
                           bool *_retval);
 
 class ValidityPair {
 public:
   ValidityPair(uint32_t aOffset, uint32_t aLen);
 
-  ValidityPair& operator=(const ValidityPair& aOther);
+  ValidityPair& operator=(const ValidityPair& aOther) = default;
 
   // Returns true when two pairs can be merged, i.e. they do overlap or the one
   // ends exactly where the other begins.
   bool CanBeMerged(const ValidityPair& aOther) const;
 
   // Returns true when aOffset is placed anywhere in the validity interval or
   // exactly after its end.
   bool IsInOrFollows(uint32_t aOffset) const;
--- a/netwerk/cache2/CacheHashUtils.h
+++ b/netwerk/cache2/CacheHashUtils.h
@@ -40,17 +40,17 @@ public:
 
   explicit CacheHash(uint32_t aInitval=0);
 
   void     Update(const char *aData, uint32_t aLen);
   Hash32_t GetHash();
   Hash16_t GetHash16();
 
 private:
-  virtual ~CacheHash() {}
+  virtual ~CacheHash() = default;
 
   void Feed(uint32_t aVal, uint8_t aLen = 4);
 
   uint32_t mA, mB, mC;
   uint8_t  mPos;
   uint32_t mBuf;
   uint8_t  mBufPos;
   uint32_t mLength;
--- a/netwerk/cache2/CacheIOThread.cpp
+++ b/netwerk/cache2/CacheIOThread.cpp
@@ -205,18 +205,18 @@ void BlockingIOWatcher::NotifyOperationD
     ::SetEvent(mEvent);
   }
 }
 
 #else // WIN
 
 // Stub code only (we don't implement IO cancelation for this platform)
 
-BlockingIOWatcher::BlockingIOWatcher() { }
-BlockingIOWatcher::~BlockingIOWatcher() { }
+BlockingIOWatcher::BlockingIOWatcher() = default;
+BlockingIOWatcher::~BlockingIOWatcher() = default;
 void BlockingIOWatcher::InitThread() { }
 void BlockingIOWatcher::WatchAndCancel(Monitor&) { }
 void BlockingIOWatcher::NotifyOperationDone() { }
 
 #endif
 
 } // detail
 
@@ -234,34 +234,34 @@ CacheIOThread::CacheIOThread()
 , mRerunCurrentEvent(false)
 , mShutdown(false)
 , mIOCancelableEvents(0)
 , mEventCounter(0)
 #ifdef DEBUG
 , mInsideLoop(true)
 #endif
 {
-  for (uint32_t i = 0; i < LAST_LEVEL; ++i) {
-    mQueueLength[i] = 0;
+  for (auto& item : mQueueLength) {
+    item = 0;
   }
 
   sSelf = this;
 }
 
 CacheIOThread::~CacheIOThread()
 {
   if (mXPCOMThread) {
     nsIThread *thread = mXPCOMThread;
     thread->Release();
   }
 
   sSelf = nullptr;
 #ifdef DEBUG
-  for (uint32_t level = 0; level < LAST_LEVEL; ++level) {
-    MOZ_ASSERT(!mEventQueue[level].Length());
+  for (auto& event : mEventQueue) {
+    MOZ_ASSERT(!event.Length());
   }
 #endif
 }
 
 nsresult CacheIOThread::Init()
 {
   {
     MonitorAutoLock lock(mMonitor);
@@ -618,18 +618,18 @@ NS_IMETHODIMP CacheIOThread::AfterProces
 // Memory reporting
 
 size_t CacheIOThread::SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
 {
   MonitorAutoLock lock(const_cast<CacheIOThread*>(this)->mMonitor);
 
   size_t n = 0;
   n += mallocSizeOf(mThread);
-  for (uint32_t level = 0; level < LAST_LEVEL; ++level) {
-    n += mEventQueue[level].ShallowSizeOfExcludingThis(mallocSizeOf);
+  for (const auto& event : mEventQueue) {
+    n += event.ShallowSizeOfExcludingThis(mallocSizeOf);
     // Events referenced by the queues are arbitrary objects we cannot be sure
     // are reported elsewhere as well as probably not implementing nsISizeOf
     // interface.  Deliberatly omitting them from reporting here.
   }
 
   return n;
 }
 
--- a/netwerk/cache2/CacheIndex.cpp
+++ b/netwerk/cache2/CacheIndex.cpp
@@ -189,17 +189,17 @@ public:
   {}
 
   void Cancel() {
     CacheIndex::sLock.AssertCurrentThreadOwns();
     mCanceled = true;
   }
 
 private:
-  virtual ~FileOpenHelper() {}
+  virtual ~FileOpenHelper() = default;
 
   NS_IMETHOD OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) override;
   NS_IMETHOD OnDataWritten(CacheFileHandle *aHandle, const char *aBuf,
                            nsresult aResult) override {
     MOZ_CRASH("FileOpenHelper::OnDataWritten should not be called!");
     return NS_ERROR_UNEXPECTED;
   }
   NS_IMETHOD OnDataRead(CacheFileHandle *aHandle, char *aBuf,
@@ -2309,19 +2309,18 @@ CacheIndex::ParseRecords()
 
   rv = CacheFileIOManager::Read(mIndexHandle, fileOffset, mRWBuf + pos, toRead,
                                 this);
   if (NS_FAILED(rv)) {
     LOG(("CacheIndex::ParseRecords() - CacheFileIOManager::Read() failed "
          "synchronously [rv=0x%08" PRIx32 "]", static_cast<uint32_t>(rv)));
     FinishRead(false);
     return;
-  } else {
-    mRWPending = true;
   }
+  mRWPending = true;
 }
 
 void
 CacheIndex::StartReadingJournal()
 {
   LOG(("CacheIndex::StartReadingJournal()"));
 
   nsresult rv;
@@ -2429,19 +2428,18 @@ CacheIndex::ParseJournal()
 
   rv = CacheFileIOManager::Read(mJournalHandle, fileOffset, mRWBuf + pos,
                                 toRead, this);
   if (NS_FAILED(rv)) {
     LOG(("CacheIndex::ParseJournal() - CacheFileIOManager::Read() failed "
          "synchronously [rv=0x%08" PRIx32 "]", static_cast<uint32_t>(rv)));
     FinishRead(false);
     return;
-  } else {
-    mRWPending = true;
   }
+  mRWPending = true;
 }
 
 void
 CacheIndex::MergeJournal()
 {
   LOG(("CacheIndex::MergeJournal()"));
 
   sLock.AssertCurrentThreadOwns();
@@ -3546,19 +3544,18 @@ CacheIndex::OnFileOpenedInternal(FileOpe
       if (aOpener == mIndexFileOpener) {
         mIndexFileOpener = nullptr;
 
         if (NS_SUCCEEDED(aResult)) {
           if (aHandle->FileSize() == 0) {
             FinishRead(false);
             CacheFileIOManager::DoomFile(aHandle, nullptr);
             break;
-          } else {
-            mIndexHandle = aHandle;
           }
+          mIndexHandle = aHandle;
         } else {
           FinishRead(false);
           break;
         }
       } else if (aOpener == mJournalFileOpener) {
         mJournalFileOpener = nullptr;
         mJournalHandle = aHandle;
       } else if (aOpener == mTmpFileOpener) {
--- a/netwerk/cache2/CacheIndexContextIterator.cpp
+++ b/netwerk/cache2/CacheIndexContextIterator.cpp
@@ -14,20 +14,16 @@ namespace net {
 CacheIndexContextIterator::CacheIndexContextIterator(CacheIndex *aIndex,
                                                      bool aAddNew,
                                                      nsILoadContextInfo *aInfo)
   : CacheIndexIterator(aIndex, aAddNew)
   , mInfo(aInfo)
 {
 }
 
-CacheIndexContextIterator::~CacheIndexContextIterator()
-{
-}
-
 void
 CacheIndexContextIterator::AddRecord(CacheIndexRecord *aRecord)
 {
   if (CacheIndexEntry::RecordMatchesLoadContextInfo(aRecord, mInfo)) {
     CacheIndexIterator::AddRecord(aRecord);
   }
 }
 
--- a/netwerk/cache2/CacheIndexContextIterator.h
+++ b/netwerk/cache2/CacheIndexContextIterator.h
@@ -12,17 +12,17 @@ class nsILoadContextInfo;
 namespace mozilla {
 namespace net {
 
 class CacheIndexContextIterator : public CacheIndexIterator
 {
 public:
   CacheIndexContextIterator(CacheIndex *aIndex, bool aAddNew,
                             nsILoadContextInfo *aInfo);
-  virtual ~CacheIndexContextIterator();
+  virtual ~CacheIndexContextIterator() = default;
 
 private:
   virtual void AddRecord(CacheIndexRecord *aRecord) override;
   virtual void AddRecords(const nsTArray<CacheIndexRecord *> &aRecords);
 
   nsCOMPtr<nsILoadContextInfo> mInfo;
 };
 
--- a/netwerk/cache2/CacheObserver.h
+++ b/netwerk/cache2/CacheObserver.h
@@ -12,17 +12,17 @@
 #include <algorithm>
 
 namespace mozilla {
 namespace net {
 
 class CacheObserver : public nsIObserver
                     , public nsSupportsWeakReference
 {
-  virtual ~CacheObserver() {}
+  virtual ~CacheObserver() = default;
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   static nsresult Init();
   static nsresult Shutdown();
   static CacheObserver* Self() { return sSelf; }
 
--- a/netwerk/cache2/CacheStorage.cpp
+++ b/netwerk/cache2/CacheStorage.cpp
@@ -31,20 +31,16 @@ CacheStorage::CacheStorage(nsILoadContex
 : mLoadContextInfo(GetLoadContextInfo(aInfo))
 , mWriteToDisk(aAllowDisk)
 , mLookupAppCache(aLookupAppCache)
 , mSkipSizeCheck(aSkipSizeCheck)
 , mPinning(aPinning)
 {
 }
 
-CacheStorage::~CacheStorage()
-{
-}
-
 NS_IMETHODIMP CacheStorage::AsyncOpenURI(nsIURI *aURI,
                                          const nsACString & aIdExtension,
                                          uint32_t aFlags,
                                          nsICacheEntryOpenCallback *aCallback)
 {
   if (!CacheStorageService::Self())
     return NS_ERROR_NOT_INITIALIZED;
 
--- a/netwerk/cache2/CacheStorage.h
+++ b/netwerk/cache2/CacheStorage.h
@@ -52,17 +52,17 @@ class CacheStorage : public nsICacheStor
 public:
   CacheStorage(nsILoadContextInfo* aInfo,
                bool aAllowDisk,
                bool aLookupAppCache,
                bool aSkipSizeCheck,
                bool aPinning);
 
 protected:
-  virtual ~CacheStorage();
+  virtual ~CacheStorage() = default;
 
   nsresult ChooseApplicationCache(nsIURI* aURI, nsIApplicationCache** aCache);
 
   RefPtr<LoadContextInfo> mLoadContextInfo;
   bool mWriteToDisk : 1;
   bool mLookupAppCache : 1;
   bool mSkipSizeCheck: 1;
   bool mPinning : 1;
--- a/netwerk/cache2/CacheStorageService.cpp
+++ b/netwerk/cache2/CacheStorageService.cpp
@@ -581,17 +581,17 @@ private:
   {
     nsCacheService::GetDiskCacheDirectory(getter_AddRefs(mCache1Dir));
     CacheFileIOManager::GetCacheDirectory(getter_AddRefs(mCache2Dir));
 #if defined(MOZ_WIDGET_ANDROID)
     CacheFileIOManager::GetProfilelessCacheDirectory(getter_AddRefs(mCache2Profileless));
 #endif
   }
 
-  virtual ~CleaupCacheDirectoriesRunnable() {}
+  virtual ~CleaupCacheDirectoriesRunnable() = default;
   nsCOMPtr<nsIFile> mCache1Dir, mCache2Dir;
 #if defined(MOZ_WIDGET_ANDROID)
   nsCOMPtr<nsIFile> mCache2Profileless;
 #endif
 };
 
 // static
 bool CleaupCacheDirectoriesRunnable::Post()
--- a/netwerk/cache2/CacheStorageService.h
+++ b/netwerk/cache2/CacheStorageService.h
@@ -370,17 +370,17 @@ private:
     PurgeFromMemoryRunnable(CacheStorageService* aService, uint32_t aWhat)
       : Runnable("net::CacheStorageService::PurgeFromMemoryRunnable")
       , mService(aService)
       , mWhat(aWhat)
     {
     }
 
   private:
-    virtual ~PurgeFromMemoryRunnable() { }
+    virtual ~PurgeFromMemoryRunnable() = default;
 
     NS_IMETHOD Run() override;
 
     RefPtr<CacheStorageService> mService;
     uint32_t mWhat;
   };
 
   // Used just for telemetry purposes, accessed only on the management thread.
@@ -396,17 +396,17 @@ private:
     IOThreadSuspender()
       : Runnable("net::CacheStorageService::IOThreadSuspender")
       , mMon("IOThreadSuspender")
       , mSignaled(false)
     {
     }
     void Notify();
   private:
-    virtual ~IOThreadSuspender() { }
+    virtual ~IOThreadSuspender() = default;
     NS_IMETHOD Run() override;
 
     Monitor mMon;
     bool mSignaled;
   };
 
   RefPtr<IOThreadSuspender> mActiveIOSuspender;
 };
--- a/netwerk/cache2/OldWrappers.cpp
+++ b/netwerk/cache2/OldWrappers.cpp
@@ -43,19 +43,17 @@ public:
   explicit DoomCallbackSynchronizer(nsICacheEntryDoomCallback* cb)
     : Runnable("net::DoomCallbackSynchronizer")
     , mCB(cb)
   {
   }
   nsresult Dispatch();
 
 private:
-  virtual ~DoomCallbackSynchronizer()
-  {
-  }
+  virtual ~DoomCallbackSynchronizer() = default;
 
   NS_DECL_NSIRUNNABLE
   nsCOMPtr<nsICacheEntryDoomCallback> mCB;
 };
 
 nsresult DoomCallbackSynchronizer::Dispatch()
 {
   nsresult rv;
@@ -93,19 +91,17 @@ class DoomCallbackWrapper : public nsICa
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSICACHELISTENER
 
   explicit DoomCallbackWrapper(nsICacheEntryDoomCallback* cb) : mCB(cb)
   {
   }
 
 private:
-  virtual ~DoomCallbackWrapper()
-  {
-  }
+  virtual ~DoomCallbackWrapper() = default;
 
   nsCOMPtr<nsICacheEntryDoomCallback> mCB;
 };
 
 NS_IMPL_ISUPPORTS(DoomCallbackWrapper, nsICacheListener);
 
 NS_IMETHODIMP DoomCallbackWrapper::OnCacheEntryAvailable(nsICacheEntryDescriptor *descriptor,
                                                          nsCacheAccessMode accessGranted,
@@ -491,17 +487,17 @@ NS_IMETHODIMP _OldCacheEntryWrapper::Has
 
   return NS_OK;
 }
 
 namespace {
 
 class MetaDataVisitorWrapper : public nsICacheMetaDataVisitor
 {
-  virtual ~MetaDataVisitorWrapper() {}
+  virtual ~MetaDataVisitorWrapper() = default;
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSICACHEMETADATAVISITOR
   explicit MetaDataVisitorWrapper(nsICacheEntryMetaDataVisitor* cb) : mCB(cb) {}
   nsCOMPtr<nsICacheEntryMetaDataVisitor> mCB;
 };
 
 NS_IMPL_ISUPPORTS(MetaDataVisitorWrapper, nsICacheMetaDataVisitor)
@@ -904,19 +900,17 @@ NS_IMPL_ISUPPORTS(_OldStorage, nsICacheS
 : mLoadInfo(GetLoadContextInfo(aInfo))
 , mAppCache(aAppCache)
 , mWriteToDisk(aAllowDisk)
 , mLookupAppCache(aLookupAppCache)
 , mOfflineStorage(aOfflineStorage)
 {
 }
 
-_OldStorage::~_OldStorage()
-{
-}
+_OldStorage::~_OldStorage() = default;
 
 NS_IMETHODIMP _OldStorage::AsyncOpenURI(nsIURI *aURI,
                                         const nsACString & aIdExtension,
                                         uint32_t aFlags,
                                         nsICacheEntryOpenCallback *aCallback)
 {
   NS_ENSURE_ARG(aURI);
   NS_ENSURE_ARG(aCallback);
--- a/netwerk/cache2/OldWrappers.h
+++ b/netwerk/cache2/OldWrappers.h
@@ -280,17 +280,17 @@ private:
 class _OldGetDiskConsumption : public Runnable,
                                public nsICacheVisitor
 {
 public:
   static nsresult Get(nsICacheStorageConsumptionObserver* aCallback);
 
 private:
   explicit _OldGetDiskConsumption(nsICacheStorageConsumptionObserver* aCallback);
-  virtual ~_OldGetDiskConsumption() {}
+  virtual ~_OldGetDiskConsumption() = default;
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSICACHEVISITOR
   NS_DECL_NSIRUNNABLE
 
   nsCOMPtr<nsICacheStorageConsumptionObserver> mCallback;
   int64_t mSize;
 };
 
--- a/netwerk/cookie/CookieServiceParent.cpp
+++ b/netwerk/cookie/CookieServiceParent.cpp
@@ -65,20 +65,16 @@ CookieServiceParent::CookieServiceParent
   nsCOMPtr<nsICookieService> cs = do_GetService(NS_COOKIESERVICE_CONTRACTID);
 
   // Get the nsCookieService instance directly, so we can call internal methods.
   mCookieService = nsCookieService::GetSingleton();
   NS_ASSERTION(mCookieService, "couldn't get nsICookieService");
   mProcessingCookie = false;
 }
 
-CookieServiceParent::~CookieServiceParent()
-{
-}
-
 void
 GetInfoFromCookie(nsCookie         *aCookie,
                   CookieStruct     &aCookieStruct)
 {
   aCookieStruct.name() = aCookie->Name();
   aCookieStruct.value() = aCookie->Value();
   aCookieStruct.host() = aCookie->Host();
   aCookieStruct.path() = aCookie->Path();
--- a/netwerk/cookie/CookieServiceParent.h
+++ b/netwerk/cookie/CookieServiceParent.h
@@ -15,17 +15,17 @@ namespace mozilla { class OriginAttribut
 
 namespace mozilla {
 namespace net {
 
 class CookieServiceParent : public PCookieServiceParent
 {
 public:
   CookieServiceParent();
-  virtual ~CookieServiceParent();
+  virtual ~CookieServiceParent() = default;
 
   void TrackCookieLoad(nsIChannel *aChannel);
 
   void RemoveBatchDeletedCookies(nsIArray *aCookieList);
 
   void RemoveAll();
 
   void RemoveCookie(nsICookie *aCookie);
--- a/netwerk/cookie/nsCookie.h
+++ b/netwerk/cookie/nsCookie.h
@@ -121,17 +121,17 @@ class nsCookie final : public nsICookie2
     inline void SetIsSession(bool aIsSession)     { mIsSession = aIsSession; }
     // Set the creation time manually, overriding the monotonicity checks in
     // Create(). Use with caution!
     inline void SetCreationTime(int64_t aTime)    { mCreationTime = aTime; }
 
     bool IsStale() const;
 
   protected:
-    virtual ~nsCookie() {}
+    virtual ~nsCookie() = default;
 
   private:
     // member variables
     // we use char* ptrs to store the strings in a contiguous block,
     // so we save on the overhead of using nsCStrings. However, we
     // store a terminating null for each string, so we can hand them
     // out as nsCStrings.
     //
--- a/netwerk/cookie/nsCookieKey.h
+++ b/netwerk/cookie/nsCookieKey.h
@@ -11,37 +11,33 @@
 namespace mozilla {
 namespace net {
 class nsCookieKey : public PLDHashEntryHdr
 {
 public:
   typedef const nsCookieKey& KeyType;
   typedef const nsCookieKey* KeyTypePointer;
 
-  nsCookieKey()
-  {}
+  nsCookieKey() = default;
 
   nsCookieKey(const nsCString &baseDomain, const OriginAttributes &attrs)
     : mBaseDomain(baseDomain)
     , mOriginAttributes(attrs)
   {}
 
   explicit nsCookieKey(KeyTypePointer other)
     : mBaseDomain(other->mBaseDomain)
     , mOriginAttributes(other->mOriginAttributes)
   {}
 
   nsCookieKey(KeyType other)
     : mBaseDomain(other.mBaseDomain)
     , mOriginAttributes(other.mOriginAttributes)
   {}
 
-  ~nsCookieKey()
-  {}
-
   bool KeyEquals(KeyTypePointer other) const
   {
     return mBaseDomain == other->mBaseDomain &&
            mOriginAttributes == other->mOriginAttributes;
   }
 
   static KeyTypePointer KeyToPointer(KeyType aKey)
   {
--- a/netwerk/cookie/nsCookieService.h
+++ b/netwerk/cookie/nsCookieService.h
@@ -76,18 +76,17 @@ class nsCookieEntry : public nsCookieKey
 
     nsCookieEntry(const nsCookieEntry& toCopy)
     {
       // if we end up here, things will break. nsTHashtable shouldn't
       // allow this, since we set ALLOW_MEMMOVE to true.
       NS_NOTREACHED("nsCookieEntry copy constructor is forbidden!");
     }
 
-    ~nsCookieEntry()
-    {}
+    ~nsCookieEntry() = default;
 
     inline ArrayType& GetCookies() { return mCookies; }
 
     size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
   private:
     ArrayType mCookies;
 };
@@ -145,19 +144,17 @@ struct CookieDomainTuple
 struct DBState final
 {
   DBState() : cookieCount(0), cookieOldestTime(INT64_MAX), corruptFlag(OK)
   {
   }
 
 private:
   // Private destructor, to discourage deletion outside of Release():
-  ~DBState()
-  {
-  }
+  ~DBState() = default;
 
 public:
   NS_INLINE_DECL_REFCOUNTING(DBState)
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
   // State of the database connection.
   enum CorruptFlag {
--- a/netwerk/dns/ChildDNSService.cpp
+++ b/netwerk/dns/ChildDNSService.cpp
@@ -48,21 +48,16 @@ NS_IMPL_ISUPPORTS(ChildDNSService,
 ChildDNSService::ChildDNSService()
   : mFirstTime(true)
   , mDisablePrefetch(false)
   , mPendingRequestsLock("DNSPendingRequestsLock")
 {
   MOZ_ASSERT(IsNeckoChild());
 }
 
-ChildDNSService::~ChildDNSService()
-{
-
-}
-
 void
 ChildDNSService::GetDNSRecordHashKey(const nsACString &aHost,
                                      const OriginAttributes &aOriginAttributes,
                                      uint32_t aFlags,
                                      const nsACString &aNetworkInterface,
                                      nsIDNSListener* aListener,
                                      nsACString &aHashKey)
 {
--- a/netwerk/dns/ChildDNSService.h
+++ b/netwerk/dns/ChildDNSService.h
@@ -33,17 +33,17 @@ public:
   ChildDNSService();
 
   static already_AddRefed<ChildDNSService> GetSingleton();
 
   void NotifyRequestDone(DNSRequestChild *aDnsRequest);
 
   bool GetOffline() const;
 private:
-  virtual ~ChildDNSService();
+  virtual ~ChildDNSService() = default;
 
   void MOZ_ALWAYS_INLINE GetDNSRecordHashKey(const nsACString &aHost,
                                              const OriginAttributes &aOriginAttributes,
                                              uint32_t aFlags,
                                              const nsACString &aNetworkInterface,
                                              nsIDNSListener* aListener,
                                              nsACString &aHashKey);
 
--- a/netwerk/dns/DNSRequestChild.cpp
+++ b/netwerk/dns/DNSRequestChild.cpp
@@ -31,17 +31,17 @@ class ChildDNSRecord : public nsIDNSReco
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIDNSRECORD
 
   ChildDNSRecord(const DNSRecord& reply, uint16_t flags);
 
 private:
-  virtual ~ChildDNSRecord();
+  virtual ~ChildDNSRecord() = default;
 
   nsCString mCanonicalName;
   nsTArray<NetAddr> mAddresses;
   uint32_t mCurrent; // addr iterator
   uint32_t mLength;  // number of addrs
   uint16_t mFlags;
 };
 
@@ -57,20 +57,16 @@ ChildDNSRecord::ChildDNSRecord(const DNS
   const nsTArray<NetAddr>& addrs = reply.addrs();
   uint32_t i = 0;
   mLength = addrs.Length();
   for (; i < mLength; i++) {
     mAddresses.AppendElement(addrs[i]);
   }
 }
 
-ChildDNSRecord::~ChildDNSRecord()
-{
-}
-
 //-----------------------------------------------------------------------------
 // ChildDNSRecord::nsIDNSRecord
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 ChildDNSRecord::GetCanonicalName(nsACString &result)
 {
   if (!(mFlags & nsHostResolver::RES_CANON_NAME)) {
--- a/netwerk/dns/DNSRequestParent.cpp
+++ b/netwerk/dns/DNSRequestParent.cpp
@@ -21,21 +21,16 @@ namespace net {
 
 DNSRequestParent::DNSRequestParent()
   : mFlags(0)
   , mIPCClosed(false)
 {
 
 }
 
-DNSRequestParent::~DNSRequestParent()
-{
-
-}
-
 void
 DNSRequestParent::DoAsyncResolve(const nsACString &hostname,
                                  const OriginAttributes &originAttributes,
                                  uint32_t flags,
                                  const nsACString &networkInterface)
 {
   nsresult rv;
   mFlags = flags;
--- a/netwerk/dns/DNSRequestParent.h
+++ b/netwerk/dns/DNSRequestParent.h
@@ -36,17 +36,17 @@ public:
                                                const uint32_t& flags,
                                                const nsCString& networkInterface,
                                                const nsresult& reason) override;
   mozilla::ipc::IPCResult Recv__delete__() override;
 
 protected:
   virtual void ActorDestroy(ActorDestroyReason why) override;
 private:
-  virtual ~DNSRequestParent();
+  virtual ~DNSRequestParent() = default;
 
   uint32_t mFlags;
   bool mIPCClosed;  // true if IPDL channel has been closed (child crash)
 };
 
 } // namespace net
 } // namespace mozilla
 
--- a/netwerk/dns/TRR.cpp
+++ b/netwerk/dns/TRR.cpp
@@ -102,17 +102,17 @@ TRR::DohEncode(nsCString &aBody)
     aBody += static_cast<unsigned char>(labelLength);
     nsDependentCSubstring label = Substring(mHost, offset, labelLength);
     aBody.Append(label);
     if(!dotFound) {
       aBody += '\0'; // terminate with a final zero
       break;
     }
     offset += labelLength + 1; // move over label and dot
-  } while(1);
+  } while(true);
 
   aBody += '\0'; // upper 8 bit TYPE
   aBody += static_cast<uint8_t>(mType);
   aBody += '\0'; // upper 8 bit CLASS
   aBody += kDNS_CLASS_IN;  // IN - "the Internet"
 
   return NS_OK;
 }
--- a/netwerk/dns/TRRService.cpp
+++ b/netwerk/dns/TRRService.cpp
@@ -82,17 +82,17 @@ TRRService::Init()
     if ((captiveState == nsICaptivePortalService::UNLOCKED_PORTAL) ||
         (captiveState == nsICaptivePortalService::NOT_CAPTIVE)) {
       mCaptiveIsPassed = true;
     }
     LOG(("TRRService::Init mCaptiveState=%d mCaptiveIsPassed=%d\n",
          captiveState, (int)mCaptiveIsPassed));
   }
 
-  ReadPrefs(NULL);
+  ReadPrefs(nullptr);
 
   gTRRService = this;
 
   LOG(("Initialized TRRService\n"));
   return NS_OK;
 }
 
 bool
@@ -434,31 +434,30 @@ TRRService::IsTRRBlacklisted(const nsACS
 
   if (!val.IsEmpty()) {
     nsresult code;
     int32_t until = val.ToInteger(&code) + mTRRBlacklistExpireTime;
     int32_t expire = NowInSeconds();
     if (NS_SUCCEEDED(code) && (until > expire)) {
       LOG(("Host [%s] is TRR blacklisted\n", nsCString(aHost).get()));
       return true;
+    }
+    // the blacklisted entry has expired
+    RefPtr<DataStorage> storage = mTRRBLStorage;
+    nsCOMPtr<nsIRunnable> runnable =
+      NS_NewRunnableFunction("proxyStorageRemove",
+                              [storage, hashkey, privateBrowsing]() {
+                                storage->Remove(hashkey, privateBrowsing ?
+                                                DataStorage_Private :
+                                                DataStorage_Persistent);
+                              });
+    if (!NS_IsMainThread()) {
+      NS_DispatchToMainThread(runnable);
     } else {
-      // the blacklisted entry has expired
-      RefPtr<DataStorage> storage = mTRRBLStorage;
-      nsCOMPtr<nsIRunnable> runnable =
-        NS_NewRunnableFunction("proxyStorageRemove",
-                               [storage, hashkey, privateBrowsing]() {
-                                 storage->Remove(hashkey, privateBrowsing ?
-                                                 DataStorage_Private :
-                                                 DataStorage_Persistent);
-                               });
-      if (!NS_IsMainThread()) {
-        NS_DispatchToMainThread(runnable);
-      } else {
-        runnable->Run();
-      }
+      runnable->Run();
     }
   }
   return false;
 }
 
 class ProxyBlacklist : public Runnable
 {
 public:
--- a/netwerk/dns/mdns/libmdns/MDNSResponderReply.cpp
+++ b/netwerk/dns/mdns/libmdns/MDNSResponderReply.cpp
@@ -162,20 +162,16 @@ ResolveReplyRunnable::ResolveReplyRunnab
   , mTxtRecord(new unsigned char[aTxtLen])
   , mContext(aContext)
 {
   if (mTxtRecord) {
     memcpy(mTxtRecord.get(), aTxtRecord, aTxtLen);
   }
 }
 
-ResolveReplyRunnable::~ResolveReplyRunnable()
-{
-}
-
 NS_IMETHODIMP
 ResolveReplyRunnable::Run()
 {
   MOZ_ASSERT(mContext);
   mContext->Reply(mSdRef,
                   mFlags,
                   mInterfaceIndex,
                   mErrorCode,
@@ -239,20 +235,16 @@ GetAddrInfoReplyRunnable::GetAddrInfoRep
   , mErrorCode(aErrorCode)
   , mHostName(aHostName)
   , mAddress(aAddress)
   , mTTL(aTTL)
   , mContext(aContext)
 {
 }
 
-GetAddrInfoReplyRunnable::~GetAddrInfoReplyRunnable()
-{
-}
-
 NS_IMETHODIMP
 GetAddrInfoReplyRunnable::Run()
 {
   MOZ_ASSERT(mContext);
   mContext->Reply(mSdRef,
                   mFlags,
                   mInterfaceIndex,
                   mErrorCode,
--- a/netwerk/dns/mdns/libmdns/MDNSResponderReply.h
+++ b/netwerk/dns/mdns/libmdns/MDNSResponderReply.h
@@ -90,17 +90,17 @@ public:
                        uint32_t aInterfaceIndex,
                        DNSServiceErrorType aErrorCode,
                        const nsACString& aFullName,
                        const nsACString& aHostTarget,
                        uint16_t aPort,
                        uint16_t aTxtLen,
                        const unsigned char* aTxtRecord,
                        ResolveOperator* aContext);
-  ~ResolveReplyRunnable();
+  ~ResolveReplyRunnable() = default;
 
   NS_IMETHOD Run() override;
 
   static void Reply(DNSServiceRef aSdRef,
                     DNSServiceFlags aFlags,
                     uint32_t aInterfaceIndex,
                     DNSServiceErrorType aErrorCode,
                     const char* aFullName,
@@ -129,17 +129,17 @@ public:
   GetAddrInfoReplyRunnable(DNSServiceRef aSdRef,
                            DNSServiceFlags aFlags,
                            uint32_t aInterfaceIndex,
                            DNSServiceErrorType aErrorCode,
                            const nsACString& aHostName,
                            const mozilla::net::NetAddr& aAddress,
                            uint32_t aTTL,
                            GetAddrInfoOperator* aContext);
-  ~GetAddrInfoReplyRunnable();
+  ~GetAddrInfoReplyRunnable() = default;
 
   NS_IMETHOD Run() override;
 
   static void Reply(DNSServiceRef aSdRef,
                     DNSServiceFlags aFlags,
                     uint32_t aInterfaceIndex,
                     DNSServiceErrorType aErrorCode,
                     const char* aHostName,
--- a/netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.cpp
+++ b/netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.cpp
@@ -128,20 +128,16 @@ RegisterRequest::Cancel(nsresult aReason
   mService = nullptr;
   return NS_OK;
 }
 
 } // namespace anonymous
 
 NS_IMPL_ISUPPORTS(nsDNSServiceDiscovery, nsIDNSServiceDiscovery)
 
-nsDNSServiceDiscovery::~nsDNSServiceDiscovery()
-{
-}
-
 nsresult
 nsDNSServiceDiscovery::Init()
 {
   if (!XRE_IsParentProcess()) {
     MOZ_ASSERT(false, "nsDNSServiceDiscovery can only be used in parent process");
     return NS_ERROR_FAILURE;
   }
   return NS_OK;
--- a/netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.h
+++ b/netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.h
@@ -31,17 +31,17 @@ public:
   ** and get error code |kDNSServiceErr_ServiceNotRunning| defined in dns_sd.h.
   **/
   nsresult Init();
 
   nsresult StopDiscovery(nsIDNSServiceDiscoveryListener* aListener);
   nsresult UnregisterService(nsIDNSRegistrationListener* aListener);
 
 private:
-  virtual ~nsDNSServiceDiscovery();
+  virtual ~nsDNSServiceDiscovery() = default;
 
   nsRefPtrHashtable<nsISupportsHashKey, BrowseOperator> mDiscoveryMap;
   nsRefPtrHashtable<nsISupportsHashKey, RegisterOperator> mRegisterMap;
 };
 
 } // namespace net
 } // namespace mozilla
 
--- a/netwerk/dns/nsHostResolver.h
+++ b/netwerk/dns/nsHostResolver.h
@@ -264,18 +264,18 @@ public:
     virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf) const = 0;
 protected:
     virtual ~nsResolveHostCallback() = default;
 };
 
 class AHostResolver
 {
 public:
-    AHostResolver() {}
-    virtual ~AHostResolver() {}
+    AHostResolver() = default;
+    virtual ~AHostResolver() = default;
     NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING
 
      enum LookupStatus {
         LOOKUP_OK,
         LOOKUP_RESOLVEAGAIN,
     };
 
     virtual LookupStatus CompleteLookup(nsHostRecord *, nsresult, mozilla::net::AddrInfo *, bool pb) = 0;
--- a/netwerk/ipc/ChannelEventQueue.cpp
+++ b/netwerk/ipc/ChannelEventQueue.cpp
@@ -158,17 +158,17 @@ ChannelEventQueue::ResumeInternal()
 
       NS_IMETHOD Run() override
       {
         mQueue->CompleteResume();
         return NS_OK;
       }
 
     private:
-      virtual ~CompleteResumeRunnable() {}
+      virtual ~CompleteResumeRunnable() = default;
 
       RefPtr<ChannelEventQueue> mQueue;
       nsCOMPtr<nsISupports> mOwner;
     };
 
     // Worker thread requires a CancelableRunnable.
     RefPtr<Runnable> event = new CompleteResumeRunnable(this, mOwner);
 
--- a/netwerk/ipc/NeckoChild.cpp
+++ b/netwerk/ipc/NeckoChild.cpp
@@ -40,19 +40,16 @@ using mozilla::dom::TCPServerSocketChild
 using mozilla::dom::UDPSocketChild;
 
 namespace mozilla {
 namespace net {
 
 PNeckoChild *gNeckoChild = nullptr;
 
 // C++ file contents
-NeckoChild::NeckoChild()
-{
-}
 
 NeckoChild::~NeckoChild()
 {
   //Send__delete__(gNeckoChild);
   gNeckoChild = nullptr;
 }
 
 void NeckoChild::InitNeckoChild()
--- a/netwerk/ipc/NeckoChild.h
+++ b/netwerk/ipc/NeckoChild.h
@@ -14,17 +14,17 @@
 namespace mozilla {
 namespace net {
 
 // Header file contents
 class NeckoChild :
   public PNeckoChild
 {
 public:
-  NeckoChild();
+  NeckoChild() = default;
   virtual ~NeckoChild();
 
   static void InitNeckoChild();
 
 protected:
   virtual PHttpChannelChild*
     AllocPHttpChannelChild(const PBrowserOrId&, const SerializedLoadContext&,
                            const HttpChannelCreationArgs& aOpenArgs) override;
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -84,20 +84,16 @@ NeckoParent::NeckoParent()
   static bool registeredBool = false;
   if (!registeredBool) {
     Preferences::AddBoolVarCache(&NeckoCommonInternal::gSecurityDisabled,
                                  "network.disable.ipc.security");
     registeredBool = true;
   }
 }
 
-NeckoParent::~NeckoParent()
-{
-}
-
 static PBOverrideStatus
 PBOverrideStatusFromLoadContext(const SerializedLoadContext& aSerialized)
 {
   if (!aSerialized.IsNotNull() && aSerialized.IsPrivateBitValid()) {
     return (aSerialized.mOriginAttributes.mPrivateBrowsingId > 0) ?
       kPBOverride_Private :
       kPBOverride_NotPrivate;
   }
@@ -975,19 +971,18 @@ NeckoParent::RecvGetExtensionStream(cons
 
   // If NewStream failed, we send back an invalid stream to the child so
   // it can handle the error. MozPromise rejection is reserved for channel
   // errors/disconnects.
   aResolve(inputStream);
 
   if (terminateSender) {
     return IPC_FAIL_NO_REASON(this);
-  } else {
-    return IPC_OK();
   }
+  return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 NeckoParent::RecvGetExtensionFD(const URIParams& aURI,
                                 GetExtensionFDResolver&& aResolve)
 {
   nsCOMPtr<nsIURI> deserializedURI = DeserializeURI(aURI);
   if (!deserializedURI) {
--- a/netwerk/ipc/NeckoParent.h
+++ b/netwerk/ipc/NeckoParent.h
@@ -26,17 +26,17 @@ enum PBOverrideStatus {
 };
 
 // Header file contents
 class NeckoParent
   : public PNeckoParent
 {
 public:
   NeckoParent();
-  virtual ~NeckoParent();
+  virtual ~NeckoParent() = default;
 
   MOZ_MUST_USE
   static const char *
   GetValidatedOriginAttributes(const SerializedLoadContext& aSerialized,
                                PContentParent* aBrowser,
                                nsIPrincipal* aRequestingPrincipal,
                                mozilla::OriginAttributes& aAttrs);
 
--- a/netwerk/mime/nsMIMEHeaderParamImpl.h
+++ b/netwerk/mime/nsMIMEHeaderParamImpl.h
@@ -8,19 +8,19 @@
 #ifndef __nsmimeheaderparamimpl_h___
 #define __nsmimeheaderparamimpl_h___
 class nsMIMEHeaderParamImpl : public nsIMIMEHeaderParam
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIMIMEHEADERPARAM
 
-  nsMIMEHeaderParamImpl() {}
+  nsMIMEHeaderParamImpl() = default;
 private:
-  virtual ~nsMIMEHeaderParamImpl() {}
+  virtual ~nsMIMEHeaderParamImpl() = default;
   enum ParamDecoding {
     MIME_FIELD_ENCODING = 1,
     HTTP_FIELD_ENCODING
   };
 
   nsresult DoGetParameter(const nsACString& aHeaderVal,
                           const char *aParamName,
                           ParamDecoding aDecoding,
--- a/netwerk/protocol/about/nsAboutBlank.h
+++ b/netwerk/protocol/about/nsAboutBlank.h
@@ -10,23 +10,23 @@
 
 class nsAboutBlank : public nsIAboutModule
 {
 public:
     NS_DECL_ISUPPORTS
 
     NS_DECL_NSIABOUTMODULE
 
-    nsAboutBlank() {}
+    nsAboutBlank() = default;
 
     static nsresult
     Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
 
 private:
-    virtual ~nsAboutBlank() {}
+    virtual ~nsAboutBlank() = default;
 };
 
 #define NS_ABOUT_BLANK_MODULE_CID                    \
 { /* 3decd6c8-30ef-11d3-8cd0-0060b0fc14a3 */         \
     0x3decd6c8,                                      \
     0x30ef,                                          \
     0x11d3,                                          \
     {0x8c, 0xd0, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3} \
--- a/netwerk/protocol/about/nsAboutCache.h
+++ b/netwerk/protocol/about/nsAboutCache.h
@@ -42,42 +42,42 @@
   NS_IMETHOD GetIsDocument(bool *aIsDocument) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsDocument(aIsDocument); }; \
 
 class nsAboutCache final : public nsIAboutModule
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIABOUTMODULE
 
-    nsAboutCache() {}
+    nsAboutCache() = default;
 
     static MOZ_MUST_USE nsresult
     Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
 
     static MOZ_MUST_USE nsresult
     GetStorage(nsACString const & storageName, nsILoadContextInfo* loadInfo,
                nsICacheStorage **storage);
 
 protected:
-    virtual ~nsAboutCache() {}
+    virtual ~nsAboutCache() = default;
 
     class Channel final : public nsIChannel
                         , public nsICacheStorageVisitor
     {
         NS_DECL_ISUPPORTS
         NS_DECL_NSICACHESTORAGEVISITOR
         NS_FORWARD_SAFE_NSIREQUEST(mChannel)
         NS_FORWARD_SAFE_NSICHANNEL_SUBSET(mChannel)
         NS_IMETHOD AsyncOpen(nsIStreamListener *aListener, nsISupports *aContext) override;
         NS_IMETHOD AsyncOpen2(nsIStreamListener *aListener) override;
         NS_IMETHOD Open(nsIInputStream * *_retval) override;
         NS_IMETHOD Open2(nsIInputStream * *_retval) override;
 
     private:
-        virtual ~Channel() {}
+        virtual ~Channel() = default;
 
     public:
         MOZ_MUST_USE nsresult Init(nsIURI* aURI, nsILoadInfo* aLoadInfo);
         MOZ_MUST_USE nsresult ParseURI(nsIURI * uri, nsACString & storage);
 
         // Finds a next storage we wish to visit (we use this method
         // even there is a specified storage name, which is the only
         // one in the list then.)  Posts FireVisitStorage() when found.
--- a/netwerk/protocol/about/nsAboutCacheEntry.h
+++ b/netwerk/protocol/about/nsAboutCacheEntry.h
@@ -20,17 +20,17 @@ class nsIURI;
 
 class nsAboutCacheEntry final : public nsIAboutModule
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIABOUTMODULE
 
 private:
-    virtual ~nsAboutCacheEntry() {}
+    virtual ~nsAboutCacheEntry() = default;
 
     class Channel final : public nsICacheEntryOpenCallback
                         , public nsICacheEntryMetaDataVisitor
                         , public nsIStreamListener
                         , public nsIChannel
     {
     public:
         NS_DECL_ISUPPORTS
@@ -43,17 +43,17 @@ private:
 
         Channel()
             : mBuffer(nullptr)
             , mWaitingForData(false)
             , mHexDumpState(0)
         {}
 
     private:
-        virtual ~Channel() {}
+        virtual ~Channel() = default;
 
     public:
         MOZ_MUST_USE nsresult Init(nsIURI* uri, nsILoadInfo* aLoadInfo);
 
         MOZ_MUST_USE nsresult GetContentStream(nsIURI *, nsIInputStream **);
         MOZ_MUST_USE nsresult OpenCacheEntry(nsIURI *);
         MOZ_MUST_USE nsresult OpenCacheEntry();
         MOZ_MUST_USE nsresult WriteCacheEntryDescription(nsICacheEntry *);
--- a/netwerk/protocol/about/nsAboutProtocolHandler.h
+++ b/netwerk/protocol/about/nsAboutProtocolHandler.h
@@ -24,50 +24,50 @@ class nsAboutProtocolHandler : public ns
 public:
     NS_DECL_ISUPPORTS
 
     // nsIProtocolHandler methods:
     NS_DECL_NSIPROTOCOLHANDLER
     NS_DECL_NSIPROTOCOLHANDLERWITHDYNAMICFLAGS
 
     // nsAboutProtocolHandler methods:
-    nsAboutProtocolHandler() {}
+    nsAboutProtocolHandler() = default;
 
 private:
-    virtual ~nsAboutProtocolHandler() {}
+    virtual ~nsAboutProtocolHandler() = default;
 };
 
 class nsSafeAboutProtocolHandler final : public nsIProtocolHandler
                                        , public nsSupportsWeakReference
 {
 public:
     NS_DECL_ISUPPORTS
 
     // nsIProtocolHandler methods:
     NS_DECL_NSIPROTOCOLHANDLER
 
     // nsSafeAboutProtocolHandler methods:
-    nsSafeAboutProtocolHandler() {}
+    nsSafeAboutProtocolHandler() = default;
 
 private:
-    ~nsSafeAboutProtocolHandler() {}
+    ~nsSafeAboutProtocolHandler() = default;
 };
 
 
 // Class to allow us to propagate the base URI to about:blank correctly
 class nsNestedAboutURI final
     : public nsSimpleNestedURI
 {
 private:
     nsNestedAboutURI(nsIURI* aInnerURI, nsIURI* aBaseURI)
         : nsSimpleNestedURI(aInnerURI)
         , mBaseURI(aBaseURI)
     {}
     nsNestedAboutURI() : nsSimpleNestedURI() {}
-    virtual ~nsNestedAboutURI() {}
+    virtual ~nsNestedAboutURI() = default;
 
 public:
     // Override QI so we can QI to our CID as needed
     NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override;
 
     // Override StartClone(), the nsISerializable methods, and
     // GetClassIDNoAlloc; this last is needed to make our nsISerializable impl
     // work right.
@@ -92,19 +92,19 @@ public:
         : public nsIURIMutator
         , public BaseURIMutator<nsNestedAboutURI>
         , public nsISerializable
         , public nsINestedAboutURIMutator
     {
         NS_DECL_ISUPPORTS
         NS_FORWARD_SAFE_NSIURISETTERS_RET(mURI)
 
-        explicit Mutator() { }
+        explicit Mutator() = default;
     private:
-        virtual ~Mutator() { }
+        virtual ~Mutator() = default;
 
         MOZ_MUST_USE NS_IMETHOD
         Deserialize(const mozilla::ipc::URIParams& aParams) override
         {
             return InitFromIPCParams(aParams);
         }
 
         NS_IMETHOD
--- a/netwerk/protocol/data/DataChannelChild.cpp
+++ b/netwerk/protocol/data/DataChannelChild.cpp
@@ -16,20 +16,16 @@ namespace net {
 NS_IMPL_ISUPPORTS_INHERITED(DataChannelChild, nsDataChannel, nsIChildChannel)
 
 DataChannelChild::DataChannelChild(nsIURI* aURI)
     : nsDataChannel(aURI)
     , mIPCOpen(false)
 {
 }
 
-DataChannelChild::~DataChannelChild()
-{
-}
-
 NS_IMETHODIMP
 DataChannelChild::ConnectParent(uint32_t aId)
 {
     mozilla::dom::ContentChild* cc =
         static_cast<mozilla::dom::ContentChild*>(gNeckoChild->Manager());
     if (cc->IsShuttingDown()) {
         return NS_ERROR_FAILURE;
     }
--- a/netwerk/protocol/data/DataChannelChild.h
+++ b/netwerk/protocol/data/DataChannelChild.h
@@ -25,17 +25,17 @@ public:
 
     NS_DECL_ISUPPORTS_INHERITED
     NS_DECL_NSICHILDCHANNEL
 
 protected:
     virtual void ActorDestroy(ActorDestroyReason why) override;
 
 private:
-    ~DataChannelChild();
+    ~DataChannelChild() = default;
 
     void AddIPDLReference();
 
     bool mIPCOpen;
 };
 
 } // namespace net
 } // namespace mozilla
--- a/netwerk/protocol/data/DataChannelParent.cpp
+++ b/netwerk/protocol/data/DataChannelParent.cpp
@@ -9,20 +9,16 @@
 #include "nsNetUtil.h"
 #include "nsIChannel.h"
 
 namespace mozilla {
 namespace net {
 
 NS_IMPL_ISUPPORTS(DataChannelParent, nsIParentChannel, nsIStreamListener)
 
-DataChannelParent::~DataChannelParent()
-{
-}
-
 bool
 DataChannelParent::Init(const uint32_t &channelId)
 {
     nsCOMPtr<nsIChannel> channel;
     MOZ_ALWAYS_SUCCEEDS(
         NS_LinkRedirectChannels(channelId, this, getter_AddRefs(channel)));
 
     return true;
--- a/netwerk/protocol/data/DataChannelParent.h
+++ b/netwerk/protocol/data/DataChannelParent.h
@@ -25,17 +25,17 @@ public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIPARENTCHANNEL
     NS_DECL_NSIREQUESTOBSERVER
     NS_DECL_NSISTREAMLISTENER
 
     MOZ_MUST_USE bool Init(const uint32_t& aArgs);
 
 private:
-    ~DataChannelParent();
+    ~DataChannelParent() = default;
 
     virtual void ActorDestroy(ActorDestroyReason why) override;
 };
 
 } // namespace net
 } // namespace mozilla
 
 #endif /* NS_DATACHANNELPARENT_H */
--- a/netwerk/protocol/data/nsDataChannel.cpp
+++ b/netwerk/protocol/data/nsDataChannel.cpp
@@ -26,17 +26,17 @@ using namespace mozilla;
  * @return Reference to the string containing the unescaped data.
  */
 const nsACString& Unescape(const nsACString& aStr, nsACString& aBuffer,
                            nsresult* rv)
 {
     MOZ_ASSERT(rv);
 
     bool appended = false;
-    *rv = NS_UnescapeURL(aStr.Data(), aStr.Length(), /* flags = */ 0,
+    *rv = NS_UnescapeURL(aStr.Data(), aStr.Length(), /* aFlags = */ 0,
                          aBuffer, appended, mozilla::fallible);
     if (NS_FAILED(*rv) || !appended) {
         return aStr;
     }
 
     return aBuffer;
 }
 
--- a/netwerk/protocol/data/nsDataHandler.cpp
+++ b/netwerk/protocol/data/nsDataHandler.cpp
@@ -9,22 +9,16 @@
 #include "nsError.h"
 #include "nsIOService.h"
 #include "DataChannelChild.h"
 #include "plstr.h"
 #include "nsSimpleURI.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 
-nsDataHandler::nsDataHandler() {
-}
-
-nsDataHandler::~nsDataHandler() {
-}
-
 NS_IMPL_ISUPPORTS(nsDataHandler, nsIProtocolHandler, nsISupportsWeakReference)
 
 nsresult
 nsDataHandler::Create(nsISupports* aOuter, const nsIID& aIID, void* *aResult) {
 
     nsDataHandler* ph = new nsDataHandler();
     if (ph == nullptr)
         return NS_ERROR_OUT_OF_MEMORY;
--- a/netwerk/protocol/data/nsDataHandler.h
+++ b/netwerk/protocol/data/nsDataHandler.h
@@ -7,26 +7,26 @@
 #define nsDataHandler_h___
 
 #include "nsIProtocolHandler.h"
 #include "nsWeakReference.h"
 
 class nsDataHandler : public nsIProtocolHandler
                     , public nsSupportsWeakReference
 {
-    virtual ~nsDataHandler();
+    virtual ~nsDataHandler() = default;
 
 public:
     NS_DECL_ISUPPORTS
 
     // nsIProtocolHandler methods:
     NS_DECL_NSIPROTOCOLHANDLER
 
     // nsDataHandler methods:
-    nsDataHandler();
+    nsDataHandler() = default;
 
     // Define a Create method to be used with a factory:
     static MOZ_MUST_USE nsresult
     Create(nsISupports* aOuter, const nsIID& aIID, void* *aResult);
 
     // Parse a data: URI and return the individual parts
     // (the given spec will temporarily be modified but will be returned
     //  to the original before returning)
--- a/netwerk/protocol/file/FileChannelChild.h
+++ b/netwerk/protocol/file/FileChannelChild.h
@@ -25,17 +25,17 @@ public:
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSICHILDCHANNEL
 
 protected:
   virtual void ActorDestroy(ActorDestroyReason why) override;
 
 private:
-  ~FileChannelChild() { };
+  ~FileChannelChild() = default;;
 
   void AddIPDLReference();
 
   bool mIPCOpen;
 };
 
 } // namespace net
 } // namespace mozilla
--- a/netwerk/protocol/file/FileChannelParent.cpp
+++ b/netwerk/protocol/file/FileChannelParent.cpp
@@ -9,20 +9,16 @@
 #include "nsNetUtil.h"
 #include "nsIChannel.h"
 
 namespace mozilla {
 namespace net {
 
 NS_IMPL_ISUPPORTS(FileChannelParent, nsIParentChannel, nsIStreamListener)
 
-FileChannelParent::~FileChannelParent()
-{
-}
-
 bool
 FileChannelParent::Init(const uint32_t &channelId)
 {
   nsCOMPtr<nsIChannel> channel;
   MOZ_ALWAYS_SUCCEEDS(
       NS_LinkRedirectChannels(channelId, this, getter_AddRefs(channel)));
 
   return true;
--- a/netwerk/protocol/file/FileChannelParent.h
+++ b/netwerk/protocol/file/FileChannelParent.h
@@ -25,17 +25,17 @@ public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPARENTCHANNEL
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
 
   MOZ_MUST_USE bool Init(const uint32_t& aArgs);
 
 private:
-  ~FileChannelParent();
+  ~FileChannelParent() = default;
 
   virtual void ActorDestroy(ActorDestroyReason why) override;
 };
 
 } // namespace net
 } // namespace mozilla
 
 #endif /* mozilla__net__FileChannelParent_h */
--- a/netwerk/protocol/file/nsFileChannel.cpp
+++ b/netwerk/protocol/file/nsFileChannel.cpp
@@ -189,17 +189,17 @@ public:
   }
 
   NS_IMETHOD ReadSegments(nsWriteSegmentFun fun, void *closure,
                           uint32_t count, uint32_t *result) override;
   NS_IMETHOD AsyncWait(nsIInputStreamCallback *callback, uint32_t flags,
                        uint32_t count, nsIEventTarget *target) override;
 
 private:
-  virtual ~nsFileUploadContentStream() {}
+  virtual ~nsFileUploadContentStream() = default;
 
   void OnCopyComplete();
 
   RefPtr<nsFileCopyEvent> mCopyEvent;
   nsCOMPtr<nsITransportEventSink> mSink;
 };
 
 NS_IMETHODIMP
@@ -314,20 +314,16 @@ nsFileChannel::Init()
     mLoadInfo->SetResultPrincipalURI(targetURI);
   } else {
     SetURI(mFileURI);
   }
 
   return NS_OK;
 }
 
-nsFileChannel::~nsFileChannel()
-{
-}
-
 nsresult
 nsFileChannel::MakeFileInputStream(nsIFile *file,
                                    nsCOMPtr<nsIInputStream> &stream,
                                    nsCString &contentType,
                                    bool async)
 {
   // we accept that this might result in a disk hit to stat the file
   bool isDir;
--- a/netwerk/protocol/file/nsFileChannel.h
+++ b/netwerk/protocol/file/nsFileChannel.h
@@ -20,17 +20,17 @@ public:
   NS_DECL_NSIFILECHANNEL
   NS_DECL_NSIUPLOADCHANNEL
 
   explicit nsFileChannel(nsIURI *uri);
 
   nsresult Init();
 
 protected:
-  ~nsFileChannel();
+  ~nsFileChannel() = default;
 
   // Called to construct a blocking file input stream for the given file.  This
   // method also returns a best guess at the content-type for the data stream.
   // NOTE: If the channel has a type hint set, contentType will be left
   // untouched. The caller should not use it in that case.
   MOZ_MUST_USE nsresult MakeFileInputStream(nsIFile *file,
                                             nsCOMPtr<nsIInputStream> &stream,
                                             nsCString &contentType, bool async);
--- a/netwerk/protocol/file/nsFileProtocolHandler.cpp
+++ b/netwerk/protocol/file/nsFileProtocolHandler.cpp
@@ -28,20 +28,16 @@
 // URL file handling for freedesktop.org
 #ifdef XP_UNIX
 #include "nsINIParser.h"
 #define DESKTOP_ENTRY_SECTION "Desktop Entry"
 #endif
 
 //-----------------------------------------------------------------------------
 
-nsFileProtocolHandler::nsFileProtocolHandler()
-{
-}
-
 nsresult
 nsFileProtocolHandler::Init()
 {
     return NS_OK;
 }
 
 NS_IMPL_ISUPPORTS(nsFileProtocolHandler,
                   nsIFileProtocolHandler,
--- a/netwerk/protocol/file/nsFileProtocolHandler.h
+++ b/netwerk/protocol/file/nsFileProtocolHandler.h
@@ -9,21 +9,21 @@
 #include "nsIFileProtocolHandler.h"
 #include "nsWeakReference.h"
 
 class nsIURIMutator;
 
 class nsFileProtocolHandler : public nsIFileProtocolHandler
                             , public nsSupportsWeakReference
 {
-    virtual ~nsFileProtocolHandler() {}
+    virtual ~nsFileProtocolHandler() = default;
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIPROTOCOLHANDLER
     NS_DECL_NSIFILEPROTOCOLHANDLER
 
-    nsFileProtocolHandler();
+    nsFileProtocolHandler() = default;
 
     MOZ_MUST_USE nsresult Init();
 };
 
 #endif // !nsFileProtocolHandler_h__
--- a/netwerk/protocol/ftp/FTPChannelChild.cpp
+++ b/netwerk/protocol/ftp/FTPChannelChild.cpp
@@ -527,23 +527,21 @@ FTPChannelChild::RecvOnStopRequest(const
 }
 
 class nsFtpChildAsyncAlert : public Runnable
 {
 public:
   nsFtpChildAsyncAlert(nsIPrompt *aPrompter, nsString aResponseMsg)
     : Runnable("nsFtpChildAsyncAlert")
     , mPrompter(aPrompter)
-    , mResponseMsg(aResponseMsg)
+    , mResponseMsg(std::move(aResponseMsg))
   {
   }
 protected:
-  virtual ~nsFtpChildAsyncAlert()
-  {
-  }
+  virtual ~nsFtpChildAsyncAlert() = default;
 public:
   NS_IMETHOD Run() override
   {
     if (mPrompter) {
       mPrompter->Alert(nullptr, mResponseMsg.get());
     }
     return NS_OK;
   }
--- a/netwerk/protocol/ftp/FTPChannelParent.cpp
+++ b/netwerk/protocol/ftp/FTPChannelParent.cpp
@@ -634,31 +634,29 @@ FTPChannelParent::GetInterface(const nsI
 
 nsresult
 FTPChannelParent::SuspendChannel()
 {
   nsCOMPtr<nsIChannelWithDivertableParentListener> chan =
     do_QueryInterface(mChannel);
   if (chan) {
     return chan->SuspendInternal();
-  } else {
-    return mChannel->Suspend();
   }
+  return mChannel->Suspend();
 }
 
 nsresult
 FTPChannelParent::ResumeChannel()
 {
   nsCOMPtr<nsIChannelWithDivertableParentListener> chan =
     do_QueryInterface(mChannel);
   if (chan) {
     return chan->ResumeInternal();
-  } else {
-    return mChannel->Resume();
   }
+  return mChannel->Resume();
 }
 
 //-----------------------------------------------------------------------------
 // FTPChannelParent::ADivertableParentChannel
 //-----------------------------------------------------------------------------
 nsresult
 FTPChannelParent::SuspendForDiversion()
 {
--- a/netwerk/protocol/ftp/nsFTPChannel.cpp
+++ b/netwerk/protocol/ftp/nsFTPChannel.cpp
@@ -129,17 +129,17 @@ nsFtpChannel::OnCallbacksChanged()
 }
 
 //-----------------------------------------------------------------------------
 
 namespace {
 
 class FTPEventSinkProxy final : public nsIFTPEventSink
 {
-    ~FTPEventSinkProxy() {}
+    ~FTPEventSinkProxy() = default;
 
 public:
     explicit FTPEventSinkProxy(nsIFTPEventSink* aTarget)
         : mTarget(aTarget)
         , mEventTarget(GetCurrentThreadEventTarget())
     { }
 
     NS_DECL_THREADSAFE_ISUPPORTS
--- a/netwerk/protocol/ftp/nsFTPChannel.h
+++ b/netwerk/protocol/ftp/nsFTPChannel.h
@@ -101,17 +101,17 @@ public:
 
     NS_IMETHOD Suspend() override;
     NS_IMETHOD Resume() override;
 
 public:
     NS_IMETHOD ForcePending(bool aForcePending) override;
 
 protected:
-    virtual ~nsFtpChannel() {}
+    virtual ~nsFtpChannel() = default;
     virtual nsresult OpenContentStream(bool async, nsIInputStream **result,
                                        nsIChannel** channel) override;
     virtual bool GetStatusArg(nsresult status, nsString &statusArg) override;
     virtual void OnCallbacksChanged() override;
 
 private:
     nsCOMPtr<nsIProxyInfo>           mProxyInfo;
     nsCOMPtr<nsIFTPEventSink>        mFTPEventSink;
--- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
+++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
@@ -1794,23 +1794,21 @@ nsFtpState::KillControlConnection()
 }
 
 class nsFtpAsyncAlert : public Runnable
 {
 public:
   nsFtpAsyncAlert(nsIPrompt* aPrompter, nsString aResponseMsg)
     : mozilla::Runnable("nsFtpAsyncAlert")
     , mPrompter(aPrompter)
-    , mResponseMsg(aResponseMsg)
+    , mResponseMsg(std::move(aResponseMsg))
   {
     }
 protected:
-    virtual ~nsFtpAsyncAlert()
-    {
-    }
+    virtual ~nsFtpAsyncAlert() = default;
 public:
     NS_IMETHOD Run() override
     {
         if (mPrompter) {
             mPrompter->Alert(nullptr, mResponseMsg.get());
         }
         return NS_OK;
     }
--- a/netwerk/protocol/http/ASpdySession.cpp
+++ b/netwerk/protocol/http/ASpdySession.cpp
@@ -19,22 +19,16 @@
 #include "Http2Push.h"
 #include "Http2Session.h"
 
 #include "mozilla/Telemetry.h"
 
 namespace mozilla {
 namespace net {
 
-ASpdySession::ASpdySession()
-{
-}
-
-ASpdySession::~ASpdySession() = default;
-
 ASpdySession *
 ASpdySession::NewSpdySession(uint32_t version,
                              nsISocketTransport *aTransport,
                              bool attemptingEarlyData)
 {
   // This is a necko only interface, so we can enforce version
   // requests as a precondition
   MOZ_ASSERT(version == HTTP_VERSION_2,
@@ -83,20 +77,16 @@ SpdyInformation::GetNPNIndex(const nsACS
 
   return NS_ERROR_FAILURE;
 }
 
 //////////////////////////////////////////
 // SpdyPushCache
 //////////////////////////////////////////
 
-SpdyPushCache::SpdyPushCache()
-{
-}
-
 SpdyPushCache::~SpdyPushCache()
 {
   mHashHttp2.Clear();
 }
 
 bool
 SpdyPushCache::RegisterPushedStreamHttp2(const nsCString& key,
                                          Http2PushedStream *stream)
--- a/netwerk/protocol/http/ASpdySession.h
+++ b/netwerk/protocol/http/ASpdySession.h
@@ -13,18 +13,18 @@
 
 class nsISocketTransport;
 
 namespace mozilla { namespace net {
 
 class ASpdySession : public nsAHttpTransaction
 {
 public:
-  ASpdySession();
-  virtual ~ASpdySession();
+  ASpdySession() = default;
+  virtual ~ASpdySession() = default;
 
   virtual MOZ_MUST_USE bool
   AddStream(nsAHttpTransaction *, int32_t, bool, nsIInterfaceRequestor *) = 0;
   virtual bool CanReuse() = 0;
   virtual bool RoomForMoreStreams() = 0;
   virtual PRIntervalTime IdleTime() = 0;
   virtual uint32_t ReadTimeoutTick(PRIntervalTime now) = 0;
   virtual void DontReuse() = 0;
@@ -92,17 +92,17 @@ typedef bool (*ALPNCallback) (nsISupport
 
 // this is essentially a single instantiation as a member of nsHttpHandler.
 // It could be all static except using static ctors of XPCOM objects is a
 // bad idea.
 class SpdyInformation
 {
 public:
   SpdyInformation();
-  ~SpdyInformation() {}
+  ~SpdyInformation() = default;
 
   static const uint32_t kCount = 1;
 
   // determine the index (0..kCount-1) of the spdy information that
   // correlates to the npn string. NS_FAILED() if no match is found.
   MOZ_MUST_USE nsresult GetNPNIndex(const nsACString &npnString, uint32_t *result) const;
 
   // determine if a version of the protocol is enabled for index < kCount
--- a/netwerk/protocol/http/AltDataOutputStreamChild.cpp
+++ b/netwerk/protocol/http/AltDataOutputStreamChild.cpp
@@ -37,20 +37,16 @@ NS_INTERFACE_MAP_END
 
 AltDataOutputStreamChild::AltDataOutputStreamChild()
   : mIPCOpen(false)
   , mError(NS_OK)
 {
   MOZ_ASSERT(NS_IsMainThread(), "Main thread only");
 }
 
-AltDataOutputStreamChild::~AltDataOutputStreamChild()
-{
-}
-
 void
 AltDataOutputStreamChild::AddIPDLReference()
 {
   MOZ_ASSERT(!mIPCOpen, "Attempt to retain more than one IPDL reference");
   mIPCOpen = true;
   AddRef();
 }
 
--- a/netwerk/protocol/http/AltDataOutputStreamChild.h
+++ b/netwerk/protocol/http/AltDataOutputStreamChild.h
@@ -25,17 +25,17 @@ public:
 
   void AddIPDLReference();
   void ReleaseIPDLReference();
   // Saves an error code which will be reported to the writer on the next call.
   virtual mozilla::ipc::IPCResult RecvError(const nsresult& err) override;
   virtual mozilla::ipc::IPCResult RecvDeleteSelf() override;
 
 private:
-  virtual ~AltDataOutputStreamChild();
+  virtual ~AltDataOutputStreamChild() = default;
   // Sends data to the parent process in 256k chunks.
   bool WriteDataInChunks(const nsCString& data);
 
   bool mIPCOpen;
   // If there was an error opening the output stream or writing to it on the
   // parent side, this will be set to the error code. We check it before we
   // write so we can report an error to the consumer.
   nsresult mError;
--- a/netwerk/protocol/http/AlternateServices.h
+++ b/netwerk/protocol/http/AlternateServices.h
@@ -92,17 +92,17 @@ public:
   static void MakeHashKey(nsCString &outKey,
                           const nsACString &originScheme,
                           const nsACString &originHost,
                           int32_t originPort,
                           bool privateBrowsing,
                           const OriginAttributes &originAttributes);
 
 private:
-  virtual ~AltSvcMapping() {};
+  virtual ~AltSvcMapping() = default;
   void     SyncString(const nsCString& val);
   RefPtr<DataStorage> mStorage;
   int32_t             mStorageEpoch;
   void Serialize (nsCString &out);
 
   nsCString mHashKey;
 
   // If you change any of these members, update Serialize()
@@ -133,49 +133,49 @@ public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSISPECULATIVECONNECTIONOVERRIDER
   NS_DECL_NSIINTERFACEREQUESTOR
 
   explicit AltSvcOverride(nsIInterfaceRequestor *aRequestor)
     : mCallbacks(aRequestor) {}
 
 private:
-  virtual ~AltSvcOverride() {}
+  virtual ~AltSvcOverride() = default;
   nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
 };
 
 class TransactionObserver final : public nsIStreamListener
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSIREQUESTOBSERVER
 
   TransactionObserver(nsHttpChannel *channel, WellKnownChecker *checker);
   void Complete(nsHttpTransaction *, nsresult);
 private:
   friend class WellKnownChecker;
-  virtual ~TransactionObserver() {}
+  virtual ~TransactionObserver() = default;
 
   nsCOMPtr<nsISupports> mChannelRef;
   nsHttpChannel        *mChannel;
   WellKnownChecker     *mChecker;
   nsCString             mWKResponse;
 
   bool mRanOnce;
   bool mAuthOK; // confirmed no TLS failure
   bool mVersionOK; // connection h2
   bool mStatusOK; // HTTP Status 200
 };
 
 class AltSvcCache
 {
 public:
   AltSvcCache() : mStorageEpoch(0) {}
-  virtual ~AltSvcCache () {};
+  virtual ~AltSvcCache () = default;
   void UpdateAltServiceMapping(AltSvcMapping *map, nsProxyInfo *pi,
                                nsIInterfaceRequestor *, uint32_t caps,
                                const OriginAttributes &originAttributes); // main thread
   already_AddRefed<AltSvcMapping> GetAltServiceMapping(const nsACString &scheme,
                                                        const nsACString &host,
                                                        int32_t port, bool pb,
                                                        const OriginAttributes &originAttributes);
   void ClearAltServiceMappings();
--- a/netwerk/protocol/http/Http2Compression.cpp
+++ b/netwerk/protocol/http/Http2Compression.cpp
@@ -25,34 +25,34 @@ namespace net {
 
 static nsDeque *gStaticHeaders = nullptr;
 
 class HpackStaticTableReporter final : public nsIMemoryReporter
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  HpackStaticTableReporter() {}
+  HpackStaticTableReporter() = default;
 
   NS_IMETHOD
   CollectReports(nsIHandleReportCallback* aHandleReport, nsISupports* aData,
                  bool aAnonymize) override
   {
     MOZ_COLLECT_REPORT(
       "explicit/network/hpack/static-table", KIND_HEAP, UNITS_BYTES,
       gStaticHeaders->SizeOfIncludingThis(MallocSizeOf),
       "Memory usage of HPACK static table.");
 
     return NS_OK;
   }
 
 private:
   MOZ_DEFINE_MALLOC_SIZE_OF(MallocSizeOf)
 
-  ~HpackStaticTableReporter() {}
+  ~HpackStaticTableReporter() = default;
 };
 
 NS_IMPL_ISUPPORTS(HpackStaticTableReporter, nsIMemoryReporter)
 
 class HpackDynamicTableReporter final : public nsIMemoryReporter
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
@@ -72,17 +72,17 @@ public:
         "Aggregate memory usage of HPACK dynamic tables.");
     }
     return NS_OK;
   }
 
 private:
   MOZ_DEFINE_MALLOC_SIZE_OF(MallocSizeOf)
 
-  ~HpackDynamicTableReporter() {}
+  ~HpackDynamicTableReporter() = default;
 
   Http2BaseCompressor* mCompressor;
 
   friend class Http2BaseCompressor;
 };
 
 NS_IMPL_ISUPPORTS(HpackDynamicTableReporter, nsIMemoryReporter)
 
--- a/netwerk/protocol/http/Http2Compression.h
+++ b/netwerk/protocol/http/Http2Compression.h
@@ -99,17 +99,17 @@ class Http2Compressor;
 class Http2Decompressor final : public Http2BaseCompressor
 {
 public:
   Http2Decompressor()
   {
     mPeakSizeID = Telemetry::HPACK_PEAK_SIZE_DECOMPRESSOR;
     mPeakCountID = Telemetry::HPACK_PEAK_COUNT_DECOMPRESSOR;
   };
-  virtual ~Http2Decompressor() { } ;
+  virtual ~Http2Decompressor() = default;
 
   // NS_OK: Produces the working set of HTTP/1 formatted headers
   MOZ_MUST_USE nsresult DecodeHeaderBlock(const uint8_t *data,
                                           uint32_t datalen, nsACString &output,
                                           bool isPush);
 
   void GetStatus(nsACString &hdr) { hdr = mHeaderStatus; }
   void GetHost(nsACString &hdr) { hdr = mHeaderHost; }
@@ -160,17 +160,17 @@ class Http2Compressor final : public Htt
 public:
   Http2Compressor() : mParsedContentLength(-1),
                       mBufferSizeChangeWaiting(false),
                       mLowestBufferSizeWaiting(0)
   {
     mPeakSizeID = Telemetry::HPACK_PEAK_SIZE_COMPRESSOR;
     mPeakCountID = Telemetry::HPACK_PEAK_COUNT_COMPRESSOR;
   };
-  virtual ~Http2Compressor() { }
+  virtual ~Http2Compressor() = default;
 
   // HTTP/1 formatted header block as input - HTTP/2 formatted
   // header block as output
   MOZ_MUST_USE nsresult EncodeHeaderBlock(const nsCString &nvInput,
                                           const nsACString &method,
                                           const nsACString &path,
                                           const nsACString &host,
                                           const nsACString &scheme,
--- a/netwerk/protocol/http/Http2Push.h
+++ b/netwerk/protocol/http/Http2Push.h
@@ -29,17 +29,17 @@ class Http2PushTransactionBuffer;
 class Http2PushedStream final : public Http2Stream
 {
 public:
   Http2PushedStream(Http2PushTransactionBuffer *aTransaction,
                     Http2Session *aSession,
                     Http2Stream *aAssociatedStream,
                     uint32_t aID,
                     uint64_t aCurrentForegroundTabOuterContentWindowId);
-  virtual ~Http2PushedStream() {}
+  virtual ~Http2PushedStream() = default;
 
   bool GetPushComplete();
 
   // The consumer stream is the synthetic pull stream hooked up to this push
   virtual Http2Stream *GetConsumerStream() override { return mConsumerStream; };
 
   void SetConsumerStream(Http2Stream *aStream);
   MOZ_MUST_USE bool GetHashKey(nsCString &key);
--- a/netwerk/protocol/http/Http2Session.cpp
+++ b/netwerk/protocol/http/Http2Session.cpp
@@ -1108,17 +1108,17 @@ Http2Session::VerifyStream(Http2Stream *
         test++;
         if (idStream->StreamID() != aOptionalID)
           break;
       }
     }
 
     // tests passed
     return true;
-  } while (0);
+  } while (false);
 
   LOG3(("Http2Session %p VerifyStream Failure %p stream->id=0x%X "
        "optionalID=0x%X trans=%p test=%d\n",
        this, aStream, aStream->StreamID(),
        aOptionalID, aStream->Transaction(), test));
 
   MOZ_ASSERT(false, "VerifyStream");
   return false;
@@ -3106,17 +3106,17 @@ Http2Session::WriteSegmentsAgain(nsAHttp
     mInputFrameID = NetworkEndian::readUint32(
         mInputFrameBuffer.get() + kFrameLengthBytes + kFrameTypeBytes + kFrameFlagBytes);
     mInputFrameID &= 0x7fffffff;
     mInputFrameDataRead = 0;
 
     if (mInputFrameType == FRAME_TYPE_DATA || mInputFrameType == FRAME_TYPE_HEADERS)  {
       mInputFrameFinal = mInputFrameFlags & kFlag_END_STREAM;
     } else {
-      mInputFrameFinal = 0;
+      mInputFrameFinal = false;
     }
 
     mPaddingLength = 0;
 
     LOG3(("Http2Session::WriteSegments[%p::%" PRIu64 "] Frame Header Read "
           "type %X data len %u flags %x id 0x%X",
           this, mSerial, mInputFrameType, mInputFrameDataSize, mInputFrameFlags,
           mInputFrameID));
@@ -4371,17 +4371,17 @@ Http2Session::SetDNSWasRefreshed()
 
 nsHttpRequestHead *
 Http2Session::RequestHead()
 {
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
   MOZ_ASSERT(false,
              "Http2Session::RequestHead() "
              "should not be called after http/2 is setup");
-  return NULL;
+  return nullptr;
 }
 
 uint32_t
 Http2Session::Http1xTransactionCount()
 {
   return 0;
 }
 
--- a/netwerk/protocol/http/Http2Session.h
+++ b/netwerk/protocol/http/Http2Session.h
@@ -546,17 +546,17 @@ private:
   {
   public:
     CachePushCheckCallback(Http2Session *session, uint32_t promisedID, const nsACString &requestString);
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSICACHEENTRYOPENCALLBACK
 
   private:
-    ~CachePushCheckCallback() { }
+    ~CachePushCheckCallback() = default;
 
     RefPtr<Http2Session> mSession;
     uint32_t mPromisedID;
     nsHttpRequestHead mRequestHead;
   };
 
   // A h2 session will be created before all socket events are trigered,
   // e.g. NS_NET_STATUS_TLS_HANDSHAKE_ENDED and for TFO many others.
--- a/netwerk/protocol/http/HttpBackgroundChannelChild.cpp
+++ b/netwerk/protocol/http/HttpBackgroundChannelChild.cpp
@@ -19,23 +19,19 @@
 
 using mozilla::ipc::BackgroundChild;
 using mozilla::ipc::IPCResult;
 
 namespace mozilla {
 namespace net {
 
 // HttpBackgroundChannelChild
-HttpBackgroundChannelChild::HttpBackgroundChannelChild()
-{
-}
+HttpBackgroundChannelChild::HttpBackgroundChannelChild() = default;
 
-HttpBackgroundChannelChild::~HttpBackgroundChannelChild()
-{
-}
+HttpBackgroundChannelChild::~HttpBackgroundChannelChild() = default;
 
 nsresult
 HttpBackgroundChannelChild::Init(HttpChannelChild* aChannelChild)
 {
   LOG(("HttpBackgroundChannelChild::Init [this=%p httpChannel=%p channelId=%"
        PRIu64 "]\n", this, aChannelChild, aChannelChild->ChannelId()));
   MOZ_ASSERT(OnSocketThread());
   NS_ENSURE_ARG(aChannelChild);
@@ -71,17 +67,17 @@ HttpBackgroundChannelChild::OnStartReque
   MOZ_ASSERT(mChannelChild);
   MOZ_ASSERT(!mStartReceived); // Should only be called once.
 
   mStartReceived = true;
 
   nsTArray<nsCOMPtr<nsIRunnable>> runnables;
   runnables.SwapElements(mQueuedRunnables);
 
-  for (auto event : runnables) {
+  for (const auto& event : runnables) {
     // Note: these runnables call Recv* methods on HttpBackgroundChannelChild
     // but not the Process* methods on HttpChannelChild.
     event->Run();
   }
 
   // Ensure no new message is enqueued.
   MOZ_ASSERT(mQueuedRunnables.IsEmpty());
 }
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -141,19 +141,17 @@ public:
     nsHttpAtom atom = nsHttp::ResolveAtom(aHeader);
     if (!IsHeaderBlacklistedForRedirectCopy(atom)) {
       DebugOnly<nsresult> rv = mChannel->SetRequestHeader(aHeader, aValue, false);
       MOZ_ASSERT(NS_SUCCEEDED(rv));
     }
     return NS_OK;
   }
 private:
-  ~AddHeadersToChannelVisitor()
-  {
-  }
+  ~AddHeadersToChannelVisitor() = default;
 
   nsCOMPtr<nsIHttpChannel> mChannel;
 };
 
 NS_IMPL_ISUPPORTS(AddHeadersToChannelVisitor, nsIHttpHeaderVisitor)
 
 HttpBaseChannel::HttpBaseChannel()
   : mCanceled(false)
@@ -1136,17 +1134,17 @@ HttpBaseChannel::DoApplyContentConversio
 // may need a call to OnStopRequest to identify its completion state.. and if it
 // creates an error there the channel status code needs to be updated before calling
 // the terminal listener. Having the decompress do it via cancel() means channels cannot
 // effectively be used in two contexts (specifically this one and a peek context for
 // sniffing)
 //
 class InterceptFailedOnStop : public nsIStreamListener
 {
-  virtual ~InterceptFailedOnStop() {}
+  virtual ~InterceptFailedOnStop() = default;
   nsCOMPtr<nsIStreamListener> mNext;
   HttpBaseChannel *mChannel;
 
 public:
   InterceptFailedOnStop(nsIStreamListener *arg, HttpBaseChannel *chan)
   : mNext(arg)
   , mChannel(chan) {}
   NS_DECL_THREADSAFE_ISUPPORTS
@@ -1302,20 +1300,16 @@ HttpBaseChannel::nsContentEncodings::nsC
   : mEncodingHeader(aEncodingHeader)
   , mChannel(aChannel)
   , mReady(false)
 {
   mCurEnd = aEncodingHeader + strlen(aEncodingHeader);
   mCurStart = mCurEnd;
 }
 
-HttpBaseChannel::nsContentEncodings::~nsContentEncodings()
-{
-}
-
 //-----------------------------------------------------------------------------
 // HttpBaseChannel::nsContentEncodings::nsISimpleEnumerator
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpBaseChannel::nsContentEncodings::HasMore(bool* aMoreEncodings)
 {
   if (mReady) {
--- a/netwerk/protocol/http/HttpBaseChannel.h
+++ b/netwerk/protocol/http/HttpBaseChannel.h
@@ -323,17 +323,17 @@ public:
     {
     public:
         NS_DECL_ISUPPORTS
         NS_DECL_NSIUTF8STRINGENUMERATOR
 
         nsContentEncodings(nsIHttpChannel* aChannel, const char* aEncodingHeader);
 
     private:
-        virtual ~nsContentEncodings();
+        virtual ~nsContentEncodings() = default;
 
         MOZ_MUST_USE nsresult PrepareForNext(void);
 
         // We do not own the buffer.  The channel owns it.
         const char* mEncodingHeader;
         const char* mCurStart;  // points to start of current header
         const char* mCurEnd;  // points to end of current header
 
@@ -827,17 +827,17 @@ public:
   NS_IMETHOD
   Run() override
   {
     mDoomed.Clear();
     return NS_OK;
   }
 
 private:
-  virtual ~ProxyReleaseRunnable() {}
+  virtual ~ProxyReleaseRunnable() = default;
 
   nsTArray<nsCOMPtr<nsISupports>> mDoomed;
 };
 
 } // namespace net
 } // namespace mozilla
 
 #endif // mozilla_net_HttpBaseChannel_h
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -666,19 +666,17 @@ HttpChannelChild::OnStartRequest(const n
 
   DoOnStartRequest(this, mListenerContext);
 }
 
 class SyntheticDiversionListener final : public nsIStreamListener
 {
   RefPtr<HttpChannelChild> mChannel;
 
-  ~SyntheticDiversionListener()
-  {
-  }
+  ~SyntheticDiversionListener() = default;
 
 public:
   explicit SyntheticDiversionListener(HttpChannelChild* aChannel)
     : mChannel(aChannel)
   {
     MOZ_ASSERT(mChannel);
   }
 
--- a/netwerk/protocol/http/HttpChannelChild.h
+++ b/netwerk/protocol/http/HttpChannelChild.h
@@ -491,17 +491,17 @@ private:
 // A stream listener interposed between the nsInputStreamPump used for intercepted channels
 // and this channel's original listener. This is only used to ensure the original listener
 // sees the channel as the request object, and to synthesize OnStatus and OnProgress notifications.
 class InterceptStreamListener : public nsIStreamListener
                               , public nsIProgressEventSink
 {
   RefPtr<HttpChannelChild> mOwner;
   nsCOMPtr<nsISupports> mContext;
-  virtual ~InterceptStreamListener() {}
+  virtual ~InterceptStreamListener() = default;
  public:
   InterceptStreamListener(HttpChannelChild* aOwner, nsISupports* aContext)
   : mOwner(aOwner)
   , mContext(aContext)
   {
   }
 
   NS_DECL_ISUPPORTS
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -1134,17 +1134,17 @@ HttpChannelParent::RecvDocumentChannelCl
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 HttpChannelParent::RecvMarkOfflineCacheEntryAsForeign()
 {
   if (mOfflineForeignMarker) {
     mOfflineForeignMarker->MarkAsForeign();
-    mOfflineForeignMarker = 0;
+    mOfflineForeignMarker = nullptr;
   }
 
   return IPC_OK();
 }
 
 class DivertDataAvailableEvent : public MainThreadChannelEvent
 {
 public:
--- a/netwerk/protocol/http/HttpChannelParentListener.cpp
+++ b/netwerk/protocol/http/HttpChannelParentListener.cpp
@@ -38,20 +38,16 @@ HttpChannelParentListener::HttpChannelPa
   LOG(("HttpChannelParentListener::HttpChannelParentListener [this=%p, next=%p]",
        this, aInitialChannel));
 
   if (ServiceWorkerParentInterceptEnabled()) {
     mInterceptController = new ServiceWorkerInterceptController();
   }
 }
 
-HttpChannelParentListener::~HttpChannelParentListener()
-{
-}
-
 //-----------------------------------------------------------------------------
 // HttpChannelParentListener::nsISupports
 //-----------------------------------------------------------------------------
 
 NS_IMPL_ADDREF(HttpChannelParentListener)
 NS_IMPL_RELEASE(HttpChannelParentListener)
 NS_INTERFACE_MAP_BEGIN(HttpChannelParentListener)
   NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
@@ -294,19 +290,17 @@ HttpChannelParentListener::ShouldPrepare
   }
   *aShouldIntercept = mShouldIntercept;
   return NS_OK;
 }
 
 class HeaderVisitor final : public nsIHttpHeaderVisitor
 {
   nsCOMPtr<nsIInterceptedChannel> mChannel;
-  ~HeaderVisitor()
-  {
-  }
+  ~HeaderVisitor() = default;
 public:
   explicit HeaderVisitor(nsIInterceptedChannel* aChannel) : mChannel(aChannel)
   {
   }
 
   NS_DECL_ISUPPORTS
 
   NS_IMETHOD VisitHeader(const nsACString& aHeader, const nsACString& aValue) override
--- a/netwerk/protocol/http/HttpChannelParentListener.h
+++ b/netwerk/protocol/http/HttpChannelParentListener.h
@@ -50,17 +50,17 @@ public:
   MOZ_MUST_USE nsresult DivertTo(nsIStreamListener *aListener);
   MOZ_MUST_USE nsresult SuspendForDiversion();
 
   void SetupInterception(const nsHttpResponseHead& aResponseHead);
   void SetupInterceptionAfterRedirect(bool aShouldIntercept);
   void ClearInterceptedChannel(nsIStreamListener* aListener);
 
 private:
-  virtual ~HttpChannelParentListener();
+  virtual ~HttpChannelParentListener() = default;
 
   // Private partner function to SuspendForDiversion.
   MOZ_MUST_USE nsresult ResumeForDiversion();
 
   // Can be the original HttpChannelParent that created this object (normal
   // case), a different {HTTP|FTP}ChannelParent that we've been redirected to,
   // or some other listener that we have been diverted to via
   // nsIDivertableChannel.
--- a/netwerk/protocol/http/InterceptedChannel.cpp
+++ b/netwerk/protocol/http/InterceptedChannel.cpp
@@ -41,20 +41,16 @@ NS_IMPL_ISUPPORTS(InterceptedChannelBase
 InterceptedChannelBase::InterceptedChannelBase(nsINetworkInterceptController* aController)
   : mController(aController)
   , mReportCollector(new ConsoleReportCollector())
   , mClosed(false)
   , mSynthesizedOrReset(Invalid)
 {
 }
 
-InterceptedChannelBase::~InterceptedChannelBase()
-{
-}
-
 void
 InterceptedChannelBase::EnsureSynthesizedResponse()
 {
   if (mSynthesizedResponseHead.isNothing()) {
     mSynthesizedResponseHead.emplace(new nsHttpResponseHead());
   }
 }
 
--- a/netwerk/protocol/http/InterceptedChannel.h
+++ b/netwerk/protocol/http/InterceptedChannel.h
@@ -55,17 +55,17 @@ protected:
   TimeStamp mFinishResponseStart;
   TimeStamp mFinishResponseEnd;
   enum {
     Invalid = 0,
     Synthesized,
     Reset
   } mSynthesizedOrReset;
 
-  virtual ~InterceptedChannelBase();
+  virtual ~InterceptedChannelBase() = default;
 public:
   explicit InterceptedChannelBase(nsINetworkInterceptController* aController);
 
   // Notify the interception controller that the channel has been intercepted
   // and prepare the response body output stream.
   virtual void NotifyController() = 0;
 
   NS_DECL_ISUPPORTS
--- a/netwerk/protocol/http/NullHttpChannel.h
+++ b/netwerk/protocol/http/NullHttpChannel.h
@@ -37,17 +37,17 @@ class NullHttpChannel final
   // passed channel to this object, to be used for resource timing checks
   explicit NullHttpChannel(nsIHttpChannel * chan);
 
   // Same signature as nsHttpChannel::Init
   MOZ_MUST_USE nsresult Init(nsIURI *aURI, uint32_t aCaps,
                              nsProxyInfo *aProxyInfo,
                              uint32_t aProxyResolveFlags, nsIURI *aProxyURI);
 private:
-  ~NullHttpChannel() { }
+  ~NullHttpChannel() = default;
 
 protected:
   nsCOMPtr<nsIURI> mURI;
   nsCOMPtr<nsIURI> mOriginalURI;
 
   nsString  mInitiatorType;
   PRTime    mChannelCreationTime;
   TimeStamp mAsyncOpenTime;
--- a/netwerk/protocol/http/NullHttpTransaction.cpp
+++ b/netwerk/protocol/http/NullHttpTransaction.cpp
@@ -17,19 +17,17 @@
 #include "nsNetUtil.h"
 #include "TCPFastOpenLayer.h"
 
 namespace mozilla {
 namespace net {
 
 class CallObserveActivity final : public nsIRunnable
 {
-  ~CallObserveActivity()
-  {
-  }
+  ~CallObserveActivity() = default;
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   CallObserveActivity(nsIHttpActivityObserver *aActivityDistributor,
                       const nsCString &aHost,
                       int32_t aPort,
                       bool aEndToEndSSL,
                       uint32_t aActivityType,
                       uint32_t aActivitySubtype,
--- a/netwerk/protocol/http/PSpdyPush.h
+++ b/netwerk/protocol/http/PSpdyPush.h
@@ -35,17 +35,17 @@ namespace net {
 
 class Http2PushedStream;
 
 // One cache per load group
 class SpdyPushCache
 {
 public:
   // The cache holds only weak pointers - no references
-  SpdyPushCache();
+  SpdyPushCache() = default;
   virtual ~SpdyPushCache();
   MOZ_MUST_USE bool  RegisterPushedStreamHttp2(const nsCString& key,
                                                Http2PushedStream *stream);
   Http2PushedStream *RemovePushedStreamHttp2(const nsCString& key);
   Http2PushedStream *RemovePushedStreamHttp2ByID(const nsCString& key, const uint32_t& streamID);
 private:
   nsDataHashtable<nsCStringHashKey, Http2PushedStream *> mHashHttp2;
 };
--- a/netwerk/protocol/http/TunnelUtils.cpp
+++ b/netwerk/protocol/http/TunnelUtils.cpp
@@ -754,17 +754,17 @@ class SocketInWrapper : public nsIAsyncI
     return mStream->ReadSegments(aWriter, aClosure, aCount, _retval);
   }
 
   // finally, ones that don't get forwarded :)
   NS_IMETHOD Read(char *aBuf, uint32_t aCount, uint32_t *_retval) override;
   virtual nsresult OnWriteSegment(char *segment, uint32_t count, uint32_t *countWritten) override;
 
 private:
-  virtual ~SocketInWrapper() {};
+  virtual ~SocketInWrapper() = default;;
 
   nsCOMPtr<nsIAsyncInputStream> mStream;
   RefPtr<TLSFilterTransaction> mTLSFilter;
 };
 
 nsresult
 SocketInWrapper::OnWriteSegment(char *segment, uint32_t count, uint32_t *countWritten)
 {
@@ -826,17 +826,17 @@ class SocketOutWrapper : public nsIAsync
     return mStream->WriteFrom(aFromStream, aCount, _retval);
   }
 
   // finally, ones that don't get forwarded :)
   NS_IMETHOD Write(const char *aBuf, uint32_t aCount, uint32_t *_retval) override;
   virtual nsresult OnReadSegment(const char *segment, uint32_t count, uint32_t *countRead) override;
 
 private:
-  virtual ~SocketOutWrapper() {};
+  virtual ~SocketOutWrapper() = default;;
 
   nsCOMPtr<nsIAsyncOutputStream> mStream;
   RefPtr<TLSFilterTransaction> mTLSFilter;
 };
 
 nsresult
 SocketOutWrapper::OnReadSegment(const char *segment, uint32_t count, uint32_t *countWritten)
 {
@@ -889,17 +889,17 @@ public:
   NS_DECL_NSITRANSPORT
   NS_DECL_NSISOCKETTRANSPORT
 
   explicit SocketTransportShim(nsISocketTransport *aWrapped)
     : mWrapped(aWrapped)
   {};
 
 private:
-  virtual ~SocketTransportShim() {};
+  virtual ~SocketTransportShim() = default;;
 
   nsCOMPtr<nsISocketTransport> mWrapped;
 };
 
 class OutputStreamShim : public nsIAsyncOutputStream
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
@@ -911,17 +911,17 @@ public:
   explicit OutputStreamShim(SpdyConnectTransaction *aTrans)
     : mCallback(nullptr)
     , mStatus(NS_OK)
   {
     mWeakTrans = do_GetWeakReference(aTrans);
   }
 
 private:
-  virtual ~OutputStreamShim() {};
+  virtual ~OutputStreamShim() = default;;
 
   nsWeakPtr mWeakTrans; // SpdyConnectTransaction *
   nsIOutputStreamCallback *mCallback;
   nsresult mStatus;
 };
 
 class InputStreamShim : public nsIAsyncInputStream
 {
@@ -935,17 +935,17 @@ public:
   explicit InputStreamShim(SpdyConnectTransaction *aTrans)
     : mCallback(nullptr)
     , mStatus(NS_OK)
   {
     mWeakTrans = do_GetWeakReference(aTrans);
   }
 
 private:
-  virtual ~InputStreamShim() {};
+  virtual ~InputStreamShim() = default;;
 
   nsWeakPtr mWeakTrans; // SpdyConnectTransaction *
   nsIInputStreamCallback *mCallback;
   nsresult mStatus;
 };
 
 SpdyConnectTransaction::SpdyConnectTransaction(nsHttpConnectionInfo *ci,
                                                nsIInterfaceRequestor *callbacks,
--- a/netwerk/protocol/http/nsCORSListenerProxy.cpp
+++ b/netwerk/protocol/http/nsCORSListenerProxy.cpp
@@ -418,20 +418,16 @@ nsCORSListenerProxy::nsCORSListenerProxy
     mOriginHeaderPrincipal(aRequestingPrincipal),
     mWithCredentials(aWithCredentials && !gDisableCORSPrivateData),
     mRequestApproved(false),
     mHasBeenCrossSite(false),
     mMutex("nsCORSListenerProxy")
 {
 }
 
-nsCORSListenerProxy::~nsCORSListenerProxy()
-{
-}
-
 nsresult
 nsCORSListenerProxy::Init(nsIChannel* aChannel, DataURIHandling aAllowDataURI)
 {
   aChannel->GetNotificationCallbacks(getter_AddRefs(mOuterNotificationCallbacks));
   aChannel->SetNotificationCallbacks(this);
 
   nsresult rv = UpdateChannel(aChannel, aAllowDataURI, UpdateType::Default);
   if (NS_FAILED(rv)) {
@@ -523,18 +519,17 @@ public:
       return NS_ERROR_DOM_BAD_URI;
     }
     return NS_OK;
   }
 
 private:
   uint32_t mHeaderCount;
 
-  ~CheckOriginHeader()
-  {}
+  ~CheckOriginHeader() = default;
 
 };
 
 NS_IMPL_ISUPPORTS(CheckOriginHeader, nsIHttpHeaderVisitor)
 }
 
 nsresult
 nsCORSListenerProxy::CheckRequestApproved(nsIRequest* aRequest)
@@ -1133,17 +1128,17 @@ public:
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSIINTERFACEREQUESTOR
   NS_DECL_NSICHANNELEVENTSINK
 
   nsresult CheckPreflightRequestApproved(nsIRequest* aRequest);
 
 private:
-  ~nsCORSPreflightListener() {}
+  ~nsCORSPreflightListener() = default;
 
   void AddResultToCache(nsIRequest* aRequest);
 
   nsCString mPreflightMethod;
   nsTArray<nsCString> mPreflightHeaders;
   nsCOMPtr<nsIPrincipal> mReferrerPrincipal;
   nsCOMPtr<nsICorsPreflightCallback> mCallback;
   nsCOMPtr<nsILoadContext> mLoadContext;
--- a/netwerk/protocol/http/nsCORSListenerProxy.h
+++ b/netwerk/protocol/http/nsCORSListenerProxy.h
@@ -86,17 +86,17 @@ private:
   static void RemoveFromCorsPreflightCache(nsIURI* aURI,
                                            nsIPrincipal* aRequestingPrincipal);
   static MOZ_MUST_USE nsresult
   StartCORSPreflight(nsIChannel* aRequestChannel,
                      nsICorsPreflightCallback* aCallback,
                      nsTArray<nsCString>& aACUnsafeHeaders,
                      nsIChannel** aPreflightChannel);
 
-  ~nsCORSListenerProxy();
+  ~nsCORSListenerProxy() = default;
 
   MOZ_MUST_USE nsresult UpdateChannel(nsIChannel* aChannel,
                                       DataURIHandling aAllowDataURI,
                                       UpdateType aUpdateType);
   MOZ_MUST_USE nsresult CheckRequestApproved(nsIRequest* aRequest);
   MOZ_MUST_USE nsresult CheckPreflightNeeded(nsIChannel* aChannel,
                                              UpdateType aUpdateType);
 
--- a/netwerk/protocol/http/nsHttp.cpp
+++ b/netwerk/protocol/http/nsHttp.cpp
@@ -378,20 +378,19 @@ ValidationRequired(bool isForcedValid, n
     // Even if the VALIDATE_NEVER flag is set, there are still some cases in
     // which we must validate the cached response with the server.
     if (loadFlags & nsIRequest::VALIDATE_NEVER) {
         LOG(("VALIDATE_NEVER set\n"));
         // if no-store validate cached response (see bug 112564)
         if (cachedResponseHead->NoStore()) {
             LOG(("Validating based on no-store logic\n"));
             return true;
-        } else {
-            LOG(("NOT validating based on VALIDATE_NEVER load flag\n"));
-            return false;
         }
+        LOG(("NOT validating based on VALIDATE_NEVER load flag\n"));
+        return false;
     }
 
     // check if validation is strictly required...
     if (cachedResponseHead->MustValidate()) {
         LOG(("Validating based on MustValidate() returning TRUE\n"));
         return true;
     }
 
@@ -488,29 +487,29 @@ GetHttpResponseHeadFromCacheEntry(nsICac
     nsresult rv = entry->GetMetaDataElement("original-response-headers", getter_Copies(buf));
     if (NS_SUCCEEDED(rv)) {
         rv = cachedResponseHead->ParseCachedOriginalHeaders((char *) buf.get());
         if (NS_FAILED(rv)) {
             LOG(("  failed to parse original-response-headers\n"));
         }
     }
 
-    buf.Adopt(0);
+    buf.Adopt(nullptr);
     // A "response-head" metadata element holds response head, e.g. response status
     // line and headers in the form Firefox uses them internally (no dupicate
     // headers, etc.).
     rv = entry->GetMetaDataElement("response-head", getter_Copies(buf));
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Parse string stored in a "response-head" metadata element.
     // These response headers will be merged with the orignal headers (i.e. the
     // headers stored in a "original-response-headers" metadata element).
     rv = cachedResponseHead->ParseCachedHead(buf.get());
     NS_ENSURE_SUCCESS(rv, rv);
-    buf.Adopt(0);
+    buf.Adopt(nullptr);
 
     return NS_OK;
 }
 
 nsresult
 CheckPartial(nsICacheEntry* aEntry, int64_t *aSize, int64_t *aContentLength,
              nsHttpResponseHead *responseHead)
 {
--- a/netwerk/protocol/http/nsHttpActivityDistributor.cpp
+++ b/netwerk/protocol/http/nsHttpActivityDistributor.cpp
@@ -46,19 +46,17 @@ public:
                                                mActivitySubtype, mTimestamp,
                                                mExtraSizeData,
                                                mExtraStringData);
         }
         return NS_OK;
     }
 
 private:
-    virtual ~nsHttpActivityEvent()
-    {
-    }
+    virtual ~nsHttpActivityEvent() = default;
 
     nsCOMPtr<nsISupports> mHttpChannel;
     uint32_t mActivityType;
     uint32_t mActivitySubtype;
     PRTime mTimestamp;
     uint64_t mExtraSizeData;
     nsCString mExtraStringData;
 
@@ -69,20 +67,16 @@ NS_IMPL_ISUPPORTS(nsHttpActivityDistribu
                   nsIHttpActivityDistributor,
                   nsIHttpActivityObserver)
 
 nsHttpActivityDistributor::nsHttpActivityDistributor()
     : mLock("nsHttpActivityDistributor.mLock")
 {
 }
 
-nsHttpActivityDistributor::~nsHttpActivityDistributor()
-{
-}
-
 NS_IMETHODIMP
 nsHttpActivityDistributor::ObserveActivity(nsISupports *aHttpChannel,
                                            uint32_t aActivityType,
                                            uint32_t aActivitySubtype,
                                            PRTime aTimestamp,
                                            uint64_t aExtraSizeData,
                                            const nsACString & aExtraStringData)
 {
--- a/netwerk/protocol/http/nsHttpActivityDistributor.h
+++ b/netwerk/protocol/http/nsHttpActivityDistributor.h
@@ -18,17 +18,17 @@ public:
     typedef nsTArray<nsMainThreadPtrHandle<nsIHttpActivityObserver> > ObserverArray;
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIHTTPACTIVITYOBSERVER
     NS_DECL_NSIHTTPACTIVITYDISTRIBUTOR
 
     nsHttpActivityDistributor();
 
 protected:
-    virtual ~nsHttpActivityDistributor();
+    virtual ~nsHttpActivityDistributor() = default;
 
     ObserverArray mObservers;
     Mutex mLock;
 };
 
 } // namespace net
 } // namespace mozilla
 
--- a/netwerk/protocol/http/nsHttpAuthCache.h
+++ b/netwerk/protocol/http/nsHttpAuthCache.h
@@ -229,17 +229,17 @@ public:
 private:
     nsHttpAuthNode *LookupAuthNode(const char *scheme,
                                    const char *host,
                                    int32_t     port,
                                    nsACString const &originSuffix,
                                    nsCString  &key);
 
     class OriginClearObserver : public nsIObserver {
-      virtual ~OriginClearObserver() {}
+      virtual ~OriginClearObserver() = default;
     public:
       NS_DECL_ISUPPORTS
       NS_DECL_NSIOBSERVER
       explicit OriginClearObserver(nsHttpAuthCache* aOwner) : mOwner(aOwner) {}
       nsHttpAuthCache* mOwner;
     };
 
     void ClearOriginData(OriginAttributesPattern const &pattern);
--- a/netwerk/protocol/http/nsHttpAuthManager.cpp
+++ b/netwerk/protocol/http/nsHttpAuthManager.cpp
@@ -11,20 +11,16 @@
 #include "nsNetUtil.h"
 #include "nsIPrincipal.h"
 
 namespace mozilla {
 namespace net {
 
 NS_IMPL_ISUPPORTS(nsHttpAuthManager, nsIHttpAuthManager)
 
-nsHttpAuthManager::nsHttpAuthManager()
-{
-}
-
 nsresult nsHttpAuthManager::Init()
 {
   // get reference to the auth cache.  we assume that we will live
   // as long as gHttpHandler.  instantiate it if necessary.
 
   if (!gHttpHandler) {
     nsresult rv;
     nsCOMPtr<nsIIOService> ios = do_GetIOService(&rv);
@@ -42,20 +38,16 @@ nsresult nsHttpAuthManager::Init()
 
   mAuthCache = gHttpHandler->AuthCache(false);
   mPrivateAuthCache = gHttpHandler->AuthCache(true);
   NS_ENSURE_TRUE(mAuthCache, NS_ERROR_FAILURE);
   NS_ENSURE_TRUE(mPrivateAuthCache, NS_ERROR_FAILURE);
   return NS_OK;
 }
 
-nsHttpAuthManager::~nsHttpAuthManager()
-{
-}
-
 NS_IMETHODIMP
 nsHttpAuthManager::GetAuthIdentity(const nsACString & aScheme,
                                    const nsACString & aHost,
                                    int32_t aPort,
                                    const nsACString & aAuthType,
                                    const nsACString & aRealm,
                                    const nsACString & aPath,
                                    nsAString & aUserDomain,
--- a/netwerk/protocol/http/nsHttpAuthManager.h
+++ b/netwerk/protocol/http/nsHttpAuthManager.h
@@ -14,21 +14,21 @@ namespace net {
 class nsHttpAuthCache;
 
 class nsHttpAuthManager : public nsIHttpAuthManager
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIHTTPAUTHMANAGER
 
-  nsHttpAuthManager();
+  nsHttpAuthManager() = default;
   MOZ_MUST_USE nsresult Init();
 
 protected:
-  virtual ~nsHttpAuthManager();
+  virtual ~nsHttpAuthManager() = default;
 
   nsHttpAuthCache *mAuthCache;
   nsHttpAuthCache *mPrivateAuthCache;
 };
 
 } // namespace net
 } // namespace mozilla
 
--- a/netwerk/protocol/http/nsHttpBasicAuth.cpp
+++ b/netwerk/protocol/http/nsHttpBasicAuth.cpp
@@ -10,28 +10,16 @@
 #include "plstr.h"
 #include "nsString.h"
 #include "mozilla/Base64.h"
 
 namespace mozilla {
 namespace net {
 
 //-----------------------------------------------------------------------------
-// nsHttpBasicAuth <public>
-//-----------------------------------------------------------------------------
-
-nsHttpBasicAuth::nsHttpBasicAuth()
-{
-}
-
-nsHttpBasicAuth::~nsHttpBasicAuth()
-{
-}
-
-//-----------------------------------------------------------------------------
 // nsHttpBasicAuth::nsISupports
 //-----------------------------------------------------------------------------
 
 NS_IMPL_ISUPPORTS(nsHttpBasicAuth, nsIHttpAuthenticator)
 
 //-----------------------------------------------------------------------------
 // nsHttpBasicAuth::nsIHttpAuthenticator
 //-----------------------------------------------------------------------------
--- a/netwerk/protocol/http/nsHttpBasicAuth.h
+++ b/netwerk/protocol/http/nsHttpBasicAuth.h
@@ -16,17 +16,17 @@ namespace mozilla { namespace net {
 //-----------------------------------------------------------------------------
 
 class nsHttpBasicAuth : public nsIHttpAuthenticator
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIHTTPAUTHENTICATOR
 
-	nsHttpBasicAuth();
+    nsHttpBasicAuth() = default;
 private:
-	virtual ~nsHttpBasicAuth();
+    virtual ~nsHttpBasicAuth() = default;
 };
 
 } // namespace net
 } // namespace mozilla
 
 #endif // !nsHttpBasicAuth_h__
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -662,44 +662,44 @@ nsHttpChannel::OnInputAvailableComplete(
     } else {
         // fall back to synchronous on the error path. should not happen.
         if (NS_SUCCEEDED(mUploadStream->Available(&size))) {
             mReqContentLength = size;
         }
     }
 
     LOG(("nsHttpChannel::DetermineContentLength %p from sts\n", this));
-    mReqContentLengthDetermined = 1;
+    mReqContentLengthDetermined = true;
     nsresult rv = mCanceled ? mStatus : ContinueConnect();
     if (NS_FAILED(rv)) {
         CloseCacheEntry(false);
         Unused << AsyncAbort(rv);
     }
     return NS_OK;
 }
 
 void
 nsHttpChannel::DetermineContentLength()
 {
     nsCOMPtr<nsIStreamTransportService> sts(services::GetStreamTransportService());
 
     if (!mUploadStream || !sts) {
         LOG(("nsHttpChannel::DetermineContentLength %p no body\n", this));
         mReqContentLength = 0U;
-        mReqContentLengthDetermined = 1;
+        mReqContentLengthDetermined = true;
         return;
     }
 
     // If this is a stream is blocking, it needs to be sent to a worker thread
     // to do Available() as it may cause disk/IO.
     bool nonBlocking = false;
     if (NS_FAILED(mUploadStream->IsNonBlocking(&nonBlocking)) || nonBlocking) {
         mUploadStream->Available(&mReqContentLength);
         LOG(("nsHttpChannel::DetermineContentLength %p from mem\n", this));
-        mReqContentLengthDetermined = 1;
+        mReqContentLengthDetermined = true;
         return;
     }
 
     LOG(("nsHttpChannel::DetermineContentLength Async [this=%p]\n", this));
     sts->InputAvailable(mUploadStream, this);
 }
 
 nsresult
@@ -750,17 +750,17 @@ nsHttpChannel::ContinueConnect()
             if (NS_FAILED(rv) && event) {
                 event->Revoke();
             }
 
             AccumulateCacheHitTelemetry(kCacheHit);
 
             return rv;
         }
-        else if (mLoadFlags & LOAD_ONLY_FROM_CACHE) {
+        if (mLoadFlags & LOAD_ONLY_FROM_CACHE) {
             // the cache contains the requested resource, but it must be
             // validated before we can reuse it.  since we are not allowed
             // to hit the net, there's nothing more to do.  the document
             // is effectively not in the cache.
             LOG(("  !mCachedContentIsValid && mLoadFlags & LOAD_ONLY_FROM_CACHE"));
             return NS_ERROR_DOCUMENT_NOT_CACHED;
         }
     }
@@ -2186,17 +2186,17 @@ nsHttpChannel::ProcessResponse()
                               mConnectionInfo->EndToEndSSL());
     }
 
     if (gHttpHandler->IsTelemetryEnabled()) {
         // how often do we see something like Alt-Svc: "443:quic,p=1"
         nsAutoCString alt_service;
         Unused << mResponseHead->GetHeader(nsHttp::Alternate_Service, alt_service);
         bool saw_quic = (!alt_service.IsEmpty() &&
-                         PL_strstr(alt_service.get(), "quic")) ? 1 : 0;
+                         PL_strstr(alt_service.get(), "quic")) ? true : false;
         Telemetry::Accumulate(Telemetry::HTTP_SAW_QUIC_ALT_PROTOCOL, saw_quic);
 
         // Gather data on how many URLS get redirected
         switch (httpStatus) {
             case 200:
                 Telemetry::Accumulate(Telemetry::HTTP_RESPONSE_STATUS_CODE, 0);
                 break;
             case 301:
@@ -3963,17 +3963,17 @@ nsHttpChannel::OnCacheEntryCheck(nsICach
 
     if (methodWasHead) {
         // The cached response does not contain an entity.  We can only reuse
         // the response if the current request is also HEAD.
         if (!mRequestHead.IsHead()) {
             return NS_OK;
         }
     }
-    buf.Adopt(0);
+    buf.Adopt(nullptr);
 
     // We'll need this value in later computations...
     uint32_t lastModifiedTime;
     rv = entry->GetLastModified(&lastModifiedTime);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Determine if this is the first time that this cache entry
     // has been accessed during this session.
@@ -7387,21 +7387,20 @@ nsHttpChannel::OnStopRequest(nsIRequest 
                     mCachedContentIsPartial = 1;
 
                     // Perform the range request
                     rv = ContinueConnect();
                     if (NS_SUCCEEDED(rv)) {
                         LOG(("  performing range request"));
                         mCachePump = nullptr;
                         return NS_OK;
-                    } else {
-                        LOG(("  but range request perform failed 0x%08" PRIx32,
-                             static_cast<uint32_t>(rv)));
-                        status = NS_ERROR_NET_INTERRUPT;
                     }
+                    LOG(("  but range request perform failed 0x%08" PRIx32,
+                            static_cast<uint32_t>(rv)));
+                    status = NS_ERROR_NET_INTERRUPT;
                 }
                 else {
                     LOG(("  but range request setup failed rv=0x%08" PRIx32 ", failing load",
                          static_cast<uint32_t>(rv)));
                 }
             }
         }
     }
--- a/netwerk/protocol/http/nsHttpChunkedDecoder.cpp
+++ b/netwerk/protocol/http/nsHttpChunkedDecoder.cpp
@@ -116,17 +116,17 @@ nsHttpChunkedDecoder::ParseChunkRemainin
         if (mWaitEOF) {
             if (*buf) {
                 LOG(("got trailer: %s\n", buf));
                 // allocate a header array for the trailers on demand
                 if (!mTrailers) {
                     mTrailers = new nsHttpHeaderArray();
                 }
 
-                nsHttpAtom hdr = {0};
+                nsHttpAtom hdr = {nullptr};
                 nsAutoCString headerNameOriginal;
                 nsAutoCString val;
                 if (NS_SUCCEEDED(mTrailers->ParseHeaderLine(nsDependentCSubstring(buf, count),
                                                             &hdr, &headerNameOriginal, &val))) {
                     if (hdr == nsHttp::Server_Timing) {
                         Unused << mTrailers->SetHeaderFromNet(hdr, headerNameOriginal,
                                                               val, true);
                     }
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -216,17 +216,17 @@ class BoolWrapper : public ARefBase
 public:
     BoolWrapper() : mBool(false) {}
     NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BoolWrapper, override)
 
 public: // intentional!
     bool mBool;
 
 private:
-    virtual ~BoolWrapper() {}
+    virtual ~BoolWrapper() = default;
 };
 
 nsresult
 nsHttpConnectionMgr::Shutdown()
 {
     LOG(("nsHttpConnectionMgr::Shutdown\n"));
 
     RefPtr<BoolWrapper> shutdownWrapper = new BoolWrapper();
@@ -275,17 +275,17 @@ public:
 
   NS_IMETHOD Run() override
   {
     (mMgr->*mHandler)(mIParam, mVParam);
     return NS_OK;
     }
 
 private:
-    virtual ~ConnEvent() {}
+    virtual ~ConnEvent() = default;
 
     RefPtr<nsHttpConnectionMgr>  mMgr;
     nsConnEventHandler           mHandler;
     int32_t                      mIParam;
     RefPtr<ARefBase>             mVParam;
 };
 
 nsresult
@@ -472,17 +472,17 @@ public: // intentional!
 
     bool mOverridesOK;
     uint32_t mParallelSpeculativeConnectLimit;
     bool mIgnoreIdle;
     bool mIsFromPredictor;
     bool mAllow1918;
 
 private:
-    virtual ~SpeculativeConnectArgs() {}
+    virtual ~SpeculativeConnectArgs() = default;
     NS_DECL_OWNINGTHREAD
 };
 
 nsresult
 nsHttpConnectionMgr::SpeculativeConnect(nsHttpConnectionInfo *ci,
                                         nsIInterfaceRequestor *callbacks,
                                         uint32_t caps,
                                         NullHttpTransaction *nullTransaction)
@@ -562,17 +562,17 @@ public:
         : mConn(aConn)
         , mUpgradeListener(aListener) { }
 
     NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nsCompleteUpgradeData, override)
 
     RefPtr<nsAHttpConnection> mConn;
     nsCOMPtr<nsIHttpUpgradeListener> mUpgradeListener;
 private:
-    virtual ~nsCompleteUpgradeData() { }
+    virtual ~nsCompleteUpgradeData() = default;
 };
 
 nsresult
 nsHttpConnectionMgr::CompleteUpgrade(nsAHttpConnection *aConn,
                                      nsIHttpUpgradeListener *aUpgradeListener)
 {
     RefPtr<nsCompleteUpgradeData> data =
         new nsCompleteUpgradeData(aConn, aUpgradeListener);
@@ -720,20 +720,20 @@ nsHttpConnectionMgr::FindCoalescableConn
             couldJoin = potentialMatch->TestJoinConnection(ci->GetOrigin(), ci->OriginPort());
         } else {
             couldJoin = potentialMatch->JoinConnection(ci->GetOrigin(), ci->OriginPort());
         }
         if (couldJoin) {
             LOG(("FindCoalescableConnectionByHashKey() found match conn=%p key=%s newCI=%s matchedCI=%s join ok\n",
                  potentialMatch.get(), key.get(), ci->HashKey().get(), potentialMatch->ConnectionInfo()->HashKey().get()));
             return potentialMatch.get();
-        } else {
-            LOG(("FindCoalescableConnectionByHashKey() found match conn=%p key=%s newCI=%s matchedCI=%s join failed\n",
-                 potentialMatch.get(), key.get(), ci->HashKey().get(), potentialMatch->ConnectionInfo()->HashKey().get()));
         }
+        LOG(("FindCoalescableConnectionByHashKey() found match conn=%p key=%s newCI=%s matchedCI=%s join failed\n",
+             potentialMatch.get(), key.get(), ci->HashKey().get(), potentialMatch->ConnectionInfo()->HashKey().get()));
+
         ++j; // bypassed by continue when weakptr fails
     }
 
     if (!listLen) { // shrunk to 0 while iterating
         LOG(("FindCoalescableConnectionByHashKey() removing empty list element\n"));
         mCoalescingHash.Remove(key);
     }
     return nullptr;
@@ -1134,22 +1134,22 @@ nsHttpConnectionMgr::ProcessPendingQForE
          "[ci=%s ent=%p active=%zu idle=%zu urgent-start-queue=%zu"
          " queued=%zu]\n",
          ent->mConnInfo->HashKey().get(), ent, ent->mActiveConns.Length(),
          ent->mIdleConns.Length(), ent->mUrgentStartQ.Length(),
          ent->PendingQLength()));
 
     if (LOG_ENABLED()) {
       LOG(("urgent queue ["));
-      for (auto info : ent->mUrgentStartQ) {
+      for (const auto& info : ent->mUrgentStartQ) {
         LOG(("  %p", info->mTransaction.get()));
       }
       for (auto it = ent->mPendingTransactionTable.Iter(); !it.Done(); it.Next()) {
         LOG(("] window id = %" PRIx64 " queue [", it.Key()));
-        for (auto info : *it.UserData()) {
+        for (const auto& info : *it.UserData()) {
           LOG(("  %p", info->mTransaction.get()));
         }
       }
       LOG(("] active urgent conns ["));
       for (nsHttpConnection* conn : ent->mActiveConns) {
         if (conn->IsUrgentStartPreferred()) {
           LOG(("  %p", conn));
         }
@@ -3066,17 +3066,17 @@ bool nsHttpConnectionMgr::InThrottlingTi
 void nsHttpConnectionMgr::TouchThrottlingTimeWindow(bool aEnsureTicker)
 {
     LOG(("nsHttpConnectionMgr::TouchThrottlingTimeWindow"));
 
     MOZ_ASSERT(OnSocketThread(), "not on socket thread");
 
     mThrottlingWindowEndsAt = TimeStamp::NowLoRes() + mThrottleMaxTime;
 
-    if (!mThrottleTicker && 
+    if (!mThrottleTicker &&
         MOZ_LIKELY(aEnsureTicker) && MOZ_LIKELY(mThrottleEnabled)) {
         EnsureThrottleTickerIfNeeded();
     }
 }
 
 void nsHttpConnectionMgr::LogActiveTransactions(char operation)
 {
     if (!LOG_ENABLED()) {
@@ -3132,18 +3132,18 @@ nsHttpConnectionMgr::AddActiveTransactio
         if (!throttled) {
             mActiveTabUnthrottledTransactionsExist = true;
         }
     }
 
     // Shift the throttling window to the future (actually, makes sure
     // that throttling will engage when there is anything to throttle.)
     // The |false| argument means we don't need this call to ensure
-    // the ticker, since we do it just below.  Calling 
-    // EnsureThrottleTickerIfNeeded directly does a bit more than call 
+    // the ticker, since we do it just below.  Calling
+    // EnsureThrottleTickerIfNeeded directly does a bit more than call
     // from inside of TouchThrottlingTimeWindow.
     TouchThrottlingTimeWindow(false);
 
     if (!mThrottleEnabled) {
         return;
     }
 
     EnsureThrottleTickerIfNeeded();
@@ -3334,17 +3334,17 @@ nsHttpConnectionMgr::ShouldThrottle(nsHt
 
         // There are only unthrottled transactions for background tabs: don't throttle.
         LOG(("  backround tab(s) load throttled, don't throttle"));
         return false;
     }();
 
     if (forActiveTab && !stop) {
         // This is an active-tab transaction and is allowed to read.  Hence,
-        // prolong the throttle time window to make sure all 'lower-decks' 
+        // prolong the throttle time window to make sure all 'lower-decks'
         // transactions will actually throttle.
         TouchThrottlingTimeWindow();
         return false;
     }
 
     // Only stop reading when in the configured throttle max-time (aka time window).
     // This window is prolonged (restarted) by a call to TouchThrottlingTimeWindow
     // called on new transaction activation or on receive of response bytes of an
@@ -3582,17 +3582,17 @@ nsHttpConnectionMgr::ResumeReadOf(
     }
 }
 
 void
 nsHttpConnectionMgr::ResumeReadOf(nsTArray<RefPtr<nsHttpTransaction>>* transactions)
 {
     MOZ_ASSERT(transactions);
 
-    for (auto trans : *transactions) {
+    for (const auto& trans : *transactions) {
         trans->ResumeReading();
     }
 }
 
 void
 nsHttpConnectionMgr::NotifyConnectionOfWindowIdChange(uint64_t previousWindowId)
 {
     MOZ_ASSERT(OnSocketThread(), "not on socket thread");
@@ -3601,17 +3601,17 @@ nsHttpConnectionMgr::NotifyConnectionOfW
     nsTArray<RefPtr<nsAHttpConnection>> connections;
 
     auto addConnectionHelper =
         [&connections](nsTArray<RefPtr<nsHttpTransaction>> *trans) {
             if (!trans) {
                 return;
             }
 
-            for (auto t : *trans) {
+            for (const auto& t : *trans) {
                 RefPtr<nsAHttpConnection> conn = t->Connection();
                 if (conn && !connections.Contains(conn)) {
                     connections.AppendElement(conn);
                 }
             }
         };
 
     // Get unthrottled transactions with the previous and current window id.
@@ -3623,17 +3623,17 @@ nsHttpConnectionMgr::NotifyConnectionOfW
 
     // Get throttled transactions with the previous and current window id.
     transactions = mActiveTransactions[true].Get(previousWindowId);
     addConnectionHelper(transactions);
     transactions =
         mActiveTransactions[true].Get(mCurrentTopLevelOuterContentWindowId);
     addConnectionHelper(transactions);
 
-    for (auto conn : connections) {
+    for (const auto& conn : connections) {
         conn->TopLevelOuterContentWindowIdChanged(mCurrentTopLevelOuterContentWindowId);
     }
 }
 
 void
 nsHttpConnectionMgr::OnMsgUpdateCurrentTopLevelOuterContentWindowId(
     int32_t aLoading, ARefBase *param)
 {
@@ -4619,17 +4619,17 @@ nsHalfOpenSocket::SetFastOpenConnected(n
     // in case nsHttpConnection::Activate fails will be done in StartFastOpen.
     // Also OnMsgReclaimConnection can decided that we do not need this
     // transaction and cancel it as well.
     // In all other cases mConnectionNegotiatingFastOpen must not be nullptr.
     if (!mConnectionNegotiatingFastOpen) {
         return;
     }
 
-    MOZ_ASSERT((mFastOpenStatus == TFO_NOT_TRIED) || 
+    MOZ_ASSERT((mFastOpenStatus == TFO_NOT_TRIED) ||
                (mFastOpenStatus == TFO_DATA_SENT) ||
                (mFastOpenStatus == TFO_TRIED) ||
                (mFastOpenStatus == TFO_DATA_COOKIE_NOT_ACCEPTED) ||
                (mFastOpenStatus == TFO_DISABLED));
 
     RefPtr<nsHalfOpenSocket> deleteProtector(this);
 
     mEnt->mDoNotDestroy = true;
--- a/netwerk/protocol/http/nsHttpConnectionMgr.h
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.h
@@ -519,17 +519,17 @@ private:
 
         void PrintDiagnostics(nsCString &log);
     public: // meant to be public.
         RefPtr<nsHttpTransaction> mTransaction;
         nsWeakPtr mHalfOpen;
         nsWeakPtr mActiveConn;
 
     private:
-        virtual ~PendingTransactionInfo() {}
+        virtual ~PendingTransactionInfo() = default;
     };
     friend class PendingTransactionInfo;
 
     class PendingComparator
     {
     public:
         bool Equals(const PendingTransactionInfo *aPendingTrans,
                     const nsAHttpTransaction *aTrans) const {
--- a/netwerk/protocol/http/nsHttpDigestAuth.cpp
+++ b/netwerk/protocol/http/nsHttpDigestAuth.cpp
@@ -21,26 +21,16 @@
 #include "nsCRT.h"
 #include "nsICryptoHash.h"
 #include "nsComponentManagerUtils.h"
 
 namespace mozilla {
 namespace net {
 
 //-----------------------------------------------------------------------------
-// nsHttpDigestAuth <public>
-//-----------------------------------------------------------------------------
-
-nsHttpDigestAuth::nsHttpDigestAuth()
-{}
-
-nsHttpDigestAuth::~nsHttpDigestAuth()
-{}
-
-//-----------------------------------------------------------------------------
 // nsHttpDigestAuth::nsISupports
 //-----------------------------------------------------------------------------
 
 NS_IMPL_ISUPPORTS(nsHttpDigestAuth, nsIHttpAuthenticator)
 
 //-----------------------------------------------------------------------------
 // nsHttpDigestAuth <protected>
 //-----------------------------------------------------------------------------
--- a/netwerk/protocol/http/nsHttpDigestAuth.h
+++ b/netwerk/protocol/http/nsHttpDigestAuth.h
@@ -31,20 +31,20 @@ namespace mozilla { namespace net {
 //-----------------------------------------------------------------------------
 
 class nsHttpDigestAuth final : public nsIHttpAuthenticator
 {
   public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIHTTPAUTHENTICATOR
 
-    nsHttpDigestAuth();
+    nsHttpDigestAuth() = default;
 
   protected:
-    ~nsHttpDigestAuth();
+    ~nsHttpDigestAuth() = default;
 
     MOZ_MUST_USE nsresult ExpandToHex(const char * digest, char * result);
 
     MOZ_MUST_USE nsresult CalculateResponse(const char * ha1_digest,
                                             const char * ha2_digest,
                                             const nsCString&  nonce,
                                             uint16_t qop,
                                             const char * nonce_count,
--- a/netwerk/protocol/http/nsHttpHandler.h
+++ b/netwerk/protocol/http/nsHttpHandler.h
@@ -739,28 +739,28 @@ extern StaticRefPtr<nsHttpHandler> gHttp
 // nsHttpsHandler - thin wrapper to distinguish the HTTP handler from the
 //                  HTTPS handler (even though they share the same impl).
 //-----------------------------------------------------------------------------
 
 class nsHttpsHandler : public nsIHttpProtocolHandler
                      , public nsSupportsWeakReference
                      , public nsISpeculativeConnect
 {
-    virtual ~nsHttpsHandler() { }
+    virtual ~nsHttpsHandler() = default;
 public:
     // we basically just want to override GetScheme and GetDefaultPort...
     // all other methods should be forwarded to the nsHttpHandler instance.
 
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIPROTOCOLHANDLER
     NS_FORWARD_NSIPROXIEDPROTOCOLHANDLER (gHttpHandler->)
     NS_FORWARD_NSIHTTPPROTOCOLHANDLER    (gHttpHandler->)
     NS_FORWARD_NSISPECULATIVECONNECT     (gHttpHandler->)
 
-    nsHttpsHandler() { }
+    nsHttpsHandler() = default;
 
     MOZ_MUST_USE nsresult Init();
 };
 
 } // namespace net
 } // namespace mozilla
 
 #endif // nsHttpHandler_h__
--- a/netwerk/protocol/http/nsHttpHeaderArray.cpp
+++ b/netwerk/protocol/http/nsHttpHeaderArray.cpp
@@ -80,20 +80,19 @@ nsHttpHeaderArray::SetHeader(nsHttpAtom 
     } else if (merge && !IsSingletonHeader(header)) {
         return MergeHeader(header, entry, value, variety);
     } else if (!IsIgnoreMultipleHeader(header)) {
         // Replace the existing string with the new value
         if (entry->variety == eVarietyResponseNetOriginalAndResponse) {
             MOZ_ASSERT(variety == eVarietyResponse);
             entry->variety = eVarietyResponseNetOriginal;
             return SetHeader_internal(header, headerName, value, variety);
-        } else {
-            entry->value = value;
-            entry->variety = variety;
         }
+        entry->value = value;
+        entry->variety = variety;
     }
 
     return NS_OK;
 }
 
 nsresult
 nsHttpHeaderArray::SetHeader_internal(nsHttpAtom header,
                                       const nsACString &headerName,
@@ -208,37 +207,35 @@ nsHttpHeaderArray::SetResponseHeaderFrom
     MOZ_ASSERT((variety == eVarietyResponse) ||
                (variety == eVarietyResponseNetOriginal),
                "Headers from cache can only be eVarietyResponse and "
                "eVarietyResponseNetOriginal");
 
     if (variety == eVarietyResponseNetOriginal) {
         return SetHeader_internal(header, headerNameOriginal, value,
                                   eVarietyResponseNetOriginal);
-    } else {
-        nsTArray<nsEntry>::index_type index = 0;
-        do {
-            index = mHeaders.IndexOf(header, index, nsEntry::MatchHeader());
-            if (index != mHeaders.NoIndex) {
-                nsEntry &entry = mHeaders[index];
-                if (value.Equals(entry.value)) {
-                    MOZ_ASSERT((entry.variety == eVarietyResponseNetOriginal) ||
-                               (entry.variety == eVarietyResponseNetOriginalAndResponse),
-                               "This array must contain only eVarietyResponseNetOriginal"
-                               " and eVarietyResponseNetOriginalAndRespons headers!");
-                    entry.variety = eVarietyResponseNetOriginalAndResponse;
-                    return NS_OK;
-                }
-                index++;
+    }
+    nsTArray<nsEntry>::index_type index = 0;
+    do {
+        index = mHeaders.IndexOf(header, index, nsEntry::MatchHeader());
+        if (index != mHeaders.NoIndex) {
+            nsEntry &entry = mHeaders[index];
+            if (value.Equals(entry.value)) {
+                MOZ_ASSERT((entry.variety == eVarietyResponseNetOriginal) ||
+                            (entry.variety == eVarietyResponseNetOriginalAndResponse),
+                            "This array must contain only eVarietyResponseNetOriginal"
+                            " and eVarietyResponseNetOriginalAndRespons headers!");
+                entry.variety = eVarietyResponseNetOriginalAndResponse;
+                return NS_OK;
             }
-        } while (index != mHeaders.NoIndex);
-        // If we are here, we have not found an entry so add a new one.
-        return SetHeader_internal(header, headerNameOriginal, value,
-                                  eVarietyResponse);
-    }
+            index++;
+        }
+    } while (index != mHeaders.NoIndex);
+    // If we are here, we have not found an entry so add a new one.
+    return SetHeader_internal(header, headerNameOriginal, value, eVarietyResponse);
 }
 
 void
 nsHttpHeaderArray::ClearHeader(nsHttpAtom header)
 {
     nsEntry *entry = nullptr;
     int32_t index = LookupEntry(header, &entry);
     if (entry) {
--- a/netwerk/protocol/http/nsHttpNTLMAuth.cpp
+++ b/netwerk/protocol/http/nsHttpNTLMAuth.cpp
@@ -132,17 +132,17 @@ CanUseDefaultCredentials(nsIHttpAuthenti
     LOG(("Default credentials allowed for host: %d\n", isTrustedHost));
     return isTrustedHost;
 }
 
 // Dummy class for session state object.  This class doesn't hold any data.
 // Instead we use its existence as a flag.  See ChallengeReceived.
 class nsNTLMSessionState final : public nsISupports
 {
-    ~nsNTLMSessionState() {}
+    ~nsNTLMSessionState() = default;
 public:
     NS_DECL_ISUPPORTS
 };
 NS_IMPL_ISUPPORTS0(nsNTLMSessionState)
 
 //-----------------------------------------------------------------------------
 
 NS_IMPL_ISUPPORTS(nsHttpNTLMAuth, nsIHttpAuthenticator)
--- a/netwerk/protocol/http/nsHttpNTLMAuth.h
+++ b/netwerk/protocol/http/nsHttpNTLMAuth.h
@@ -10,20 +10,20 @@
 namespace mozilla { namespace net {
 
 class nsHttpNTLMAuth : public nsIHttpAuthenticator
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIHTTPAUTHENTICATOR
 
-    nsHttpNTLMAuth() {}
+    nsHttpNTLMAuth() = default;
 
 private:
-    virtual ~nsHttpNTLMAuth() {}
+    virtual ~nsHttpNTLMAuth() = default;
 
     // This flag indicates whether we are using the native NTLM implementation
     // or the internal one.
     bool  mUseNative;
 };
 
 } // namespace net
 } // namespace mozilla
--- a/netwerk/protocol/http/nsHttpResponseHead.cpp
+++ b/netwerk/protocol/http/nsHttpResponseHead.cpp
@@ -316,17 +316,17 @@ nsHttpResponseHead::ParseCachedHead(cons
             break;
 
         p = PL_strstr(block, "\r\n");
         if (!p)
             return NS_ERROR_UNEXPECTED;
 
         Unused << ParseHeaderLine_locked(nsDependentCSubstring(block, p - block), false);
 
-    } while (1);
+    } while (true);
 
     return NS_OK;
 }
 
 nsresult
 nsHttpResponseHead::ParseCachedOriginalHeaders(char *block)
 {
     RecursiveMutexAutoLock monitor(mRecursiveMutex);
@@ -335,17 +335,17 @@ nsHttpResponseHead::ParseCachedOriginalH
     // this command works on a buffer as prepared by FlattenOriginalHeader,
     // as such it is not very forgiving ;-)
 
     if (!block) {
         return NS_ERROR_UNEXPECTED;
     }
 
     char *p = block;
-    nsHttpAtom hdr = {0};
+    nsHttpAtom hdr = {nullptr};
     nsAutoCString headerNameOriginal;
     nsAutoCString val;
     nsresult rv;
 
     do {
         block = p;
 
         if (*block == 0)
@@ -367,17 +367,17 @@ nsHttpResponseHead::ParseCachedOriginalH
                                                  val,
                                                  nsHttpHeaderArray::eVarietyResponseNetOriginal);
 
         if (NS_FAILED(rv)) {
             return rv;
         }
 
         p = p + 2;
-    } while (1);
+    } while (true);
 
     return NS_OK;
 }
 
 void
 nsHttpResponseHead::AssignDefaultStatusText()
 {
     LOG(("response status line needs default reason phrase\n"));
@@ -588,17 +588,17 @@ nsHttpResponseHead::ParseHeaderLine(cons
 {
     RecursiveMutexAutoLock monitor(mRecursiveMutex);
     return ParseHeaderLine_locked(line, true);
 }
 
 nsresult
 nsHttpResponseHead::ParseHeaderLine_locked(const nsACString &line, bool originalFromNetHeaders)
 {
-    nsHttpAtom hdr = {0};
+    nsHttpAtom hdr = {nullptr};
     nsAutoCString headerNameOriginal;
     nsAutoCString val;
 
     if (NS_FAILED(nsHttpHeaderArray::ParseHeaderLine(line, &hdr, &headerNameOriginal, &val))) {
         return NS_OK;
     }
     nsresult rv;
     if (originalFromNetHeaders) {
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -1328,31 +1328,31 @@ nsHttpTransaction::LocateHttpStart(char 
                            checkChars) == 0) {
             mLineBuf.Append(buf, checkChars);
             if (mLineBuf.Length() == HTTPHeaderLen) {
                 // We've found whole HTTPHeader sequence. Return pointer at the
                 // end of matched sequence since it is stored in mLineBuf.
                 return (buf + checkChars);
             }
             // Response matches pattern but is still incomplete.
-            return 0;
+            return nullptr;
         }
         // Previous partial match together with new data doesn't match the
         // pattern. Start the search again.
         mLineBuf.Truncate();
     }
 
     bool firstByte = true;
     while (len > 0) {
         if (PL_strncasecmp(buf, HTTPHeader, std::min<uint32_t>(len, HTTPHeaderLen)) == 0) {
             if (len < HTTPHeaderLen) {
                 // partial HTTPHeader sequence found
                 // save partial match to mLineBuf
                 mLineBuf.Assign(buf, len);
-                return 0;
+                return nullptr;
             }
 
             // whole HTTPHeader sequence found
             return buf;
         }
 
         // At least "SmarterTools/2.0.3974.16813" generates nonsensical
         // HTTP/2.0 responses to our HTTP/1 requests. Treat the minimal case of
@@ -1375,17 +1375,17 @@ nsHttpTransaction::LocateHttpStart(char 
             return buf;
         }
 
         if (!nsCRT::IsAsciiSpace(*buf))
             firstByte = false;
         buf++;
         len--;
     }
-    return 0;
+    return nullptr;
 }
 
 nsresult
 nsHttpTransaction::ParseLine(nsACString &line)
 {
     LOG(("nsHttpTransaction::ParseLine [%s]\n", PromiseFlatCString(line).get()));
     nsresult rv = NS_OK;
 
--- a/netwerk/protocol/res/ExtensionProtocolHandler.cpp
+++ b/netwerk/protocol/res/ExtensionProtocolHandler.cpp
@@ -98,17 +98,17 @@ class ExtensionStreamGetter : public Ref
       MOZ_ASSERT(aURI);
       MOZ_ASSERT(aLoadInfo);
       MOZ_ASSERT(mJarChannel);
       MOZ_ASSERT(aJarFile);
 
       SetupEventTarget();
     }
 
-    ~ExtensionStreamGetter() {}
+    ~ExtensionStreamGetter() = default;
 
     void SetupEventTarget()
     {
       mMainThreadEventTarget =
         nsContentUtils::GetEventTargetByLoadInfo(mLoadInfo, TaskCategory::Other);
       if (!mMainThreadEventTarget) {
         mMainThreadEventTarget = GetMainThreadSerialEventTarget();
       }
@@ -185,17 +185,17 @@ public:
     MOZ_ASSERT(NS_IsMainThread());
     mResolve(mFD);
     return NS_OK;
   }
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
 private:
-  virtual ~ExtensionJARFileOpener() {}
+  virtual ~ExtensionJARFileOpener() = default;
 
   nsCOMPtr<nsIFile> mFile;
   NeckoParent::GetExtensionFDResolver mResolve;
   FileDescriptor mFD;
 };
 
 NS_IMPL_ISUPPORTS(ExtensionJARFileOpener, nsISupports)
 
--- a/netwerk/protocol/res/ExtensionProtocolHandler.h
+++ b/netwerk/protocol/res/ExtensionProtocolHandler.h
@@ -68,17 +68,17 @@ public:
    *         extension and doesn't result in |aTerminateSender| being
    *         set to true.
    */
   Result<Ok, nsresult> NewFD(nsIURI* aChildURI,
                              bool* aTerminateSender,
                              NeckoParent::GetExtensionFDResolver& aResolve);
 
 protected:
-  ~ExtensionProtocolHandler() {}
+  ~ExtensionProtocolHandler() = default;
 
 private:
   explicit ExtensionProtocolHandler();
 
   MOZ_MUST_USE bool ResolveSpecialCases(const nsACString& aHost,
                                         const nsACString& aPath,
                                         const nsACString& aPathname,
                                         nsACString& aResult) override;
--- a/netwerk/protocol/res/SubstitutingProtocolHandler.h
+++ b/netwerk/protocol/res/SubstitutingProtocolHandler.h
@@ -36,17 +36,17 @@ public:
   NS_DECL_NON_VIRTUAL_NSIPROTOCOLHANDLER;
   NS_DECL_NON_VIRTUAL_NSISUBSTITUTINGPROTOCOLHANDLER;
 
   bool HasSubstitution(const nsACString& aRoot) const { return mSubstitutions.Get(aRoot, nullptr); }
 
   MOZ_MUST_USE nsresult CollectSubstitutions(InfallibleTArray<SubstitutionMapping>& aResources);
 
 protected:
-  virtual ~SubstitutingProtocolHandler() {}
+  virtual ~SubstitutingProtocolHandler() = default;
   void ConstructInternal();
 
   MOZ_MUST_USE nsresult SendSubstitution(const nsACString& aRoot, nsIURI* aBaseURI, uint32_t aFlags);
 
   nsresult GetSubstitutionFlags(const nsACString& root, uint32_t* flags);
 
   // Override this in the subclass to try additional lookups after checking
   // mSubstitutions.
@@ -79,19 +79,17 @@ protected:
 private:
   struct SubstitutionEntry
   {
     SubstitutionEntry()
         : flags(0)
     {
     }
 
-    ~SubstitutionEntry()
-    {
-    }
+    ~SubstitutionEntry() = default;
 
     nsCOMPtr<nsIURI> baseURI;
     uint32_t flags;
   };
 
   // Notifies all observers that a new substitution from |aRoot| to
   // |aBaseURI| has been set/installed for this protocol handler.
   void NotifyObservers(const nsACString& aRoot, nsIURI* aBaseURI);
--- a/netwerk/protocol/res/nsResProtocolHandler.h
+++ b/netwerk/protocol/res/nsResProtocolHandler.h
@@ -58,17 +58,17 @@ public:
 
     NS_IMETHOD RemoveObserver(nsISubstitutionObserver *aObserver) override
     {
         return mozilla::SubstitutingProtocolHandler::RemoveObserver(aObserver);
     }
 
 protected:
     MOZ_MUST_USE nsresult GetSubstitutionInternal(const nsACString& aRoot, nsIURI** aResult, uint32_t* aFlags) override;
-    virtual ~nsResProtocolHandler() {}
+    virtual ~nsResProtocolHandler() = default;
 
     MOZ_MUST_USE bool ResolveSpecialCases(const nsACString& aHost,
                                           const nsACString& aPath,
                                           const nsACString& aPathname,
                                           nsACString& aResult) override;
 
 private:
     nsCString mAppURI;
--- a/netwerk/protocol/viewsource/nsViewSourceChannel.h
+++ b/netwerk/protocol/viewsource/nsViewSourceChannel.h
@@ -58,17 +58,17 @@ public:
     // Updates or sets the result principal URI of the underlying channel's
     // loadinfo to be prefixed with the "view-source:" schema as:
     //
     // mChannel.loadInfo.resultPrincipalURI = "view-source:" +
     //    (mChannel.loadInfo.resultPrincipalURI | mChannel.orignalURI);
     nsresult UpdateLoadInfoResultPrincipalURI();
 
 protected:
-    ~nsViewSourceChannel() {}
+    ~nsViewSourceChannel() = default;
 
     // Clones aURI and prefixes it with "view-source:" schema,
     nsresult BuildViewSourceURI(nsIURI* aURI, nsIURI** aResult);
 
     nsCOMPtr<nsIChannel>        mChannel;
     nsCOMPtr<nsIHttpChannel>    mHttpChannel;
     nsCOMPtr<nsIHttpChannelInternal>    mHttpChannelInternal;
     nsCOMPtr<nsICachingChannel> mCachingChannel;
--- a/netwerk/protocol/websocket/BaseWebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/BaseWebSocketChannel.cpp
@@ -33,18 +33,18 @@ static uint64_t gNextWebSocketID = 0;
 static const uint64_t kWebSocketIDTotalBits = 53;
 static const uint64_t kWebSocketIDProcessBits = 22;
 static const uint64_t kWebSocketIDWebSocketBits = kWebSocketIDTotalBits - kWebSocketIDProcessBits;
 
 BaseWebSocketChannel::BaseWebSocketChannel()
   : mWasOpened(0)
   , mClientSetPingInterval(0)
   , mClientSetPingTimeout(0)
-  , mEncrypted(0)
-  , mPingForced(0)
+  , mEncrypted(false)
+  , mPingForced(false)
   , mIsServerSide(false)
   , mPingInterval(0)
   , mPingResponseTimeout(10000)
 {
   // Generation of a unique serial ID.
   uint64_t processID = 0;
   if (XRE_IsContentProcess()) {
     ContentChild* cc = ContentChild::GetSingleton();
--- a/netwerk/protocol/websocket/IPCTransportProvider.cpp
+++ b/netwerk/protocol/websocket/IPCTransportProvider.cpp
@@ -12,24 +12,16 @@
 
 namespace mozilla {
 namespace net {
 
 NS_IMPL_ISUPPORTS(TransportProviderParent,
                   nsITransportProvider,
                   nsIHttpUpgradeListener)
 
-TransportProviderParent::TransportProviderParent()
-{
-}
-
-TransportProviderParent::~TransportProviderParent()
-{
-}
-
 NS_IMETHODIMP
 TransportProviderParent::SetListener(nsIHttpUpgradeListener* aListener)
 {
   MOZ_ASSERT(aListener);
   mListener = aListener;
 
   MaybeNotify();
 
@@ -71,20 +63,16 @@ TransportProviderParent::MaybeNotify()
                                                            mSocketOut);
   MOZ_ASSERT(NS_SUCCEEDED(rv));
 }
 
 
 NS_IMPL_ISUPPORTS(TransportProviderChild,
                   nsITransportProvider)
 
-TransportProviderChild::TransportProviderChild()
-{
-}
-
 TransportProviderChild::~TransportProviderChild()
 {
   Send__delete__(this);
 }
 
 NS_IMETHODIMP
 TransportProviderChild::SetListener(nsIHttpUpgradeListener* aListener)
 {
--- a/netwerk/protocol/websocket/IPCTransportProvider.h
+++ b/netwerk/protocol/websocket/IPCTransportProvider.h
@@ -48,40 +48,40 @@ class nsIAsyncOutputStream;
 namespace mozilla {
 namespace net {
 
 class TransportProviderParent final : public PTransportProviderParent
                                     , public nsITransportProvider
                                     , public nsIHttpUpgradeListener
 {
 public:
-  TransportProviderParent();
+  TransportProviderParent() = default;
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSITRANSPORTPROVIDER
   NS_DECL_NSIHTTPUPGRADELISTENER
 
   void ActorDestroy(ActorDestroyReason aWhy) override {};
 
 private:
-  ~TransportProviderParent();
+  ~TransportProviderParent() = default;
 
   void MaybeNotify();
 
   nsCOMPtr<nsIHttpUpgradeListener> mListener;
   nsCOMPtr<nsISocketTransport> mTransport;
   nsCOMPtr<nsIAsyncInputStream> mSocketIn;
   nsCOMPtr<nsIAsyncOutputStream> mSocketOut;
 };
 
 class TransportProviderChild final : public PTransportProviderChild
                                    , public nsITransportProvider
 {
 public:
-  TransportProviderChild();
+  TransportProviderChild() = default;
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSITRANSPORTPROVIDER
 
 private:
   ~TransportProviderChild();
 };
 
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -130,17 +130,17 @@ const uint32_t kWSReconnectBaseLifeTime 
 const uint32_t kWSReconnectMaxDelay             = 60 * 1000;
 
 // hold record of failed connections, and calculates needed delay for reconnects
 // to same host/port.
 class FailDelay
 {
 public:
   FailDelay(nsCString address, int32_t port)
-    : mAddress(address), mPort(port)
+    : mAddress(std::move(address)), mPort(port)
   {
     mLastFailure = TimeStamp::Now();
     mNextDelay = kWSReconnectInitialBaseDelay +
                  (rand() % kWSReconnectInitialRandomDelay);
   }
 
   // Called to update settings when connection fails again.
   void FailedAgain()
@@ -602,17 +602,17 @@ public:
              "failed with 0x%08" PRIx32, static_cast<uint32_t>(rv)));
       }
     }
 
     return NS_OK;
   }
 
 private:
-  ~CallOnMessageAvailable() {}
+  ~CallOnMessageAvailable() = default;
 
   RefPtr<WebSocketChannel> mChannel;
   RefPtr<BaseWebSocketChannel::ListenerAndContextContainer> mListenerMT;
   nsCString mData;
   int32_t mLen;
 };
 NS_IMPL_ISUPPORTS(CallOnMessageAvailable, nsIRunnable)
 
@@ -644,17 +644,17 @@ public:
       }
       mChannel->mListenerMT = nullptr;
     }
 
     return NS_OK;
   }
 
 private:
-  ~CallOnStop() {}
+  ~CallOnStop() = default;
 
   RefPtr<WebSocketChannel> mChannel;
   RefPtr<BaseWebSocketChannel::ListenerAndContextContainer> mListenerMT;
   nsresult mReason;
 };
 NS_IMPL_ISUPPORTS(CallOnStop, nsIRunnable)
 
 //-----------------------------------------------------------------------------
@@ -686,17 +686,17 @@ public:
         LOG(("WebSocketChannel::CallOnServerClose "
              "OnServerClose failed (%08" PRIx32 ")\n", static_cast<uint32_t>(rv)));
       }
     }
     return NS_OK;
   }
 
 private:
-  ~CallOnServerClose() {}
+  ~CallOnServerClose() = default;
 
   RefPtr<WebSocketChannel> mChannel;
   RefPtr<BaseWebSocketChannel::ListenerAndContextContainer> mListenerMT;
   uint16_t mCode;
   nsCString mReason;
 };
 NS_IMPL_ISUPPORTS(CallOnServerClose, nsIRunnable)
 
@@ -726,17 +726,17 @@ public:
         LOG(("WebSocketChannel::CallAcknowledge: Acknowledge failed (%08" PRIx32 ")\n",
              static_cast<uint32_t>(rv)));
       }
     }
     return NS_OK;
   }
 
 private:
-  ~CallAcknowledge() {}
+  ~CallAcknowledge() = default;
 
   RefPtr<WebSocketChannel> mChannel;
   RefPtr<BaseWebSocketChannel::ListenerAndContextContainer> mListenerMT;
   uint32_t mSize;
 };
 
 //-----------------------------------------------------------------------------
 // CallOnTransportAvailable
@@ -758,17 +758,17 @@ public:
 
   NS_IMETHOD Run() override
   {
     LOG(("WebSocketChannel::CallOnTransportAvailable %p\n", this));
     return mChannel->OnTransportAvailable(mTransport, mSocketIn, mSocketOut);
   }
 
 private:
-  ~CallOnTransportAvailable() {}
+  ~CallOnTransportAvailable() = default;
 
   RefPtr<WebSocketChannel>     mChannel;
   nsCOMPtr<nsISocketTransport>   mTransport;
   nsCOMPtr<nsIAsyncInputStream>  mSocketIn;
   nsCOMPtr<nsIAsyncOutputStream> mSocketOut;
 };
 NS_IMPL_ISUPPORTS(CallOnTransportAvailable, nsIRunnable)
 
@@ -1135,17 +1135,17 @@ public:
 
   NS_IMETHOD Run() override
   {
     mChannel->EnqueueOutgoingMessage(mChannel->mOutgoingMessages, mMessage);
     return NS_OK;
   }
 
 private:
-  ~OutboundEnqueuer() {}
+  ~OutboundEnqueuer() = default;
 
   RefPtr<WebSocketChannel>  mChannel;
   OutboundMessage            *mMessage;
 };
 NS_IMPL_ISUPPORTS(OutboundEnqueuer, nsIRunnable)
 
 
 //-----------------------------------------------------------------------------
@@ -1159,26 +1159,26 @@ WebSocketChannel::WebSocketChannel() :
   mConnecting(NOT_CONNECTING),
   mMaxConcurrentConnections(200),
   mGotUpgradeOK(0),
   mRecvdHttpUpgradeTransport(0),
   mAutoFollowRedirects(0),
   mAllowPMCE(1),
   mPingOutstanding(0),
   mReleaseOnTransmit(0),
-  mDataStarted(0),
-  mRequestedClose(0),
-  mClientClosed(0),
-  mServerClosed(0),
-  mStopped(0),
-  mCalledOnStop(0),
-  mTCPClosed(0),
-  mOpenedHttpChannel(0),
-  mIncrementedSessionCount(0),
-  mDecrementedSessionCount(0),
+  mDataStarted(false),
+  mRequestedClose(false),
+  mClientClosed(false),
+  mServerClosed(false),
+  mStopped(false),
+  mCalledOnStop(false),
+  mTCPClosed(false),
+  mOpenedHttpChannel(false),
+  mIncrementedSessionCount(false),
+  mDecrementedSessionCount(false),
   mMaxMessageSize(INT32_MAX),
   mStopOnClose(NS_OK),
   mServerCloseCode(CLOSE_ABNORMAL),
   mScriptCloseCode(0),
   mFragmentOpcode(nsIWebSocketFrame::OPCODE_CONTINUATION),
   mFragmentAccumulator(0),
   mBuffered(0),
   mBufferSize(kIncomingBufferInitialSize),
@@ -1325,17 +1325,17 @@ WebSocketChannel::OnNetworkChanged()
     if (!mPingTimer) {
       LOG(("WebSocket: unable to create ping timer!"));
       NS_WARNING("unable to create ping timer!");
       return NS_ERROR_OUT_OF_MEMORY;
     }
   }
   // Trigger the ping timeout asap to fire off a new ping. Wait just
   // a little bit to better avoid multi-triggers.
-  mPingForced = 1;
+  mPingForced = true;
   mPingTimer->InitWithCallback(this, 200, nsITimer::TYPE_ONE_SHOT);
 
   return NS_OK;
 }
 
 void
 WebSocketChannel::Shutdown()
 {
@@ -1413,17 +1413,17 @@ WebSocketChannel::BeginOpenInternal()
 
   rv = NS_MaybeOpenChannelUsingAsyncOpen2(localChannel, this);
 
   if (NS_FAILED(rv)) {
     LOG(("WebSocketChannel::BeginOpenInternal: cannot async open\n"));
     AbortSession(NS_ERROR_CONNECTION_REFUSED);
     return;
   }
-  mOpenedHttpChannel = 1;
+  mOpenedHttpChannel = true;
 
   rv = NS_NewTimerWithCallback(getter_AddRefs(mOpenTimer),
                                this, mOpenTimeout,
                                nsITimer::TYPE_ONE_SHOT);
   if (NS_FAILED(rv)) {
     LOG(("WebSocketChannel::BeginOpenInternal: cannot initialize open "
          "timer\n"));
     AbortSession(NS_ERROR_UNEXPECTED);
@@ -1761,17 +1761,17 @@ WebSocketChannel::ProcessInput(uint8_t *
 
       RefPtr<WebSocketFrame> frame =
         mService->CreateFrameIfNeeded(finBit, rsvBit1, rsvBit2, rsvBit3,
                                       opcode, maskBit, mask, payload,
                                       payloadLength);
 
       if (opcode == nsIWebSocketFrame::OPCODE_CLOSE) {
         LOG(("WebSocketChannel:: close received\n"));
-        mServerClosed = 1;
+        mServerClosed = true;
 
         mServerCloseCode = CLOSE_NO_STATUS;
         if (payloadLength >= 2) {
           mServerCloseCode = NetworkEndian::readUint16(payload);
           LOG(("WebSocketChannel:: close recvd code %u\n", mServerCloseCode));
           uint16_t msglen = static_cast<uint16_t>(payloadLength - 2);
           if (msglen > 0) {
             mServerCloseReason.SetLength(msglen);
@@ -2077,17 +2077,17 @@ WebSocketChannel::PrimeNewOutgoingMessag
     // This is a demand to create a close message
     if (mClientClosed) {
       DeleteCurrentOutGoingMessage();
       PrimeNewOutgoingMessage();
       cleanupAfterFailure.release();
       return;
     }
 
-    mClientClosed = 1;
+    mClientClosed = true;
     mOutHeader[0] = kFinalFragBit | nsIWebSocketFrame::OPCODE_CLOSE;
     mOutHeader[1] = maskBit;
 
     // payload is offset 2 plus size of the mask
     payload = mOutHeader + 2 + maskSize;
 
     // The close reason code sits in the first 2 bytes of payload
     // If the channel user provided a code and reason during Close()
@@ -2363,17 +2363,17 @@ void
 WebSocketChannel::StopSession(nsresult reason)
 {
   LOG(("WebSocketChannel::StopSession() %p [%" PRIx32 "]\n",
        this, static_cast<uint32_t>(reason)));
 
   // normally this should be called on socket thread, but it is ok to call it
   // from OnStartRequest before the socket thread machine has gotten underway
 
-  mStopped = 1;
+  mStopped = true;
 
   if (!mOpenedHttpChannel) {
     // The HTTP channel information will never be used in this case
     NS_ReleaseOnMainThreadSystemGroup("WebSocketChannel::mChannel",
                                       mChannel.forget());
     NS_ReleaseOnMainThreadSystemGroup("WebSocketChannel::mHttpChannel",
                                       mHttpChannel.forget());
     NS_ReleaseOnMainThreadSystemGroup("WebSocketChannel::mLoadGroup",
@@ -2454,17 +2454,17 @@ WebSocketChannel::StopSession(nsresult r
   if (mCancelable) {
     mCancelable->Cancel(NS_ERROR_UNEXPECTED);
     mCancelable = nullptr;
   }
 
   mPMCECompressor = nullptr;
 
   if (!mCalledOnStop) {
-    mCalledOnStop = 1;
+    mCalledOnStop = true;
 
     nsWSAdmissionManager::OnStopSession(this, reason);
 
     RefPtr<CallOnStop> runnable = new CallOnStop(this, reason);
     mTargetThread->Dispatch(runnable, NS_DISPATCH_NORMAL);
   }
 }
 
@@ -2485,21 +2485,21 @@ WebSocketChannel::AbortSession(nsresult 
     MOZ_ASSERT(mStopped, "Lingering without Stop");
     LOG(("WebSocketChannel:: Cleanup connection based on TCP Close"));
     CleanupConnection();
     return;
   }
 
   if (mStopped)
     return;
-  mStopped = 1;
+  mStopped = true;
 
   if (mTransport && reason != NS_BASE_STREAM_CLOSED && !mRequestedClose &&
       !mClientClosed && !mServerClosed && mConnecting == NOT_CONNECTING) {
-    mRequestedClose = 1;
+    mRequestedClose = true;
     mStopOnClose = reason;
     mSocketThread->Dispatch(
       new OutboundEnqueuer(this, new OutboundMessage(kMsgTypeFin, nullptr)),
                            nsIEventTarget::DISPATCH_NORMAL);
   } else {
     StopSession(reason);
   }
 }
@@ -2517,30 +2517,30 @@ WebSocketChannel::ReleaseSession()
   StopSession(NS_OK);
 }
 
 void
 WebSocketChannel::IncrementSessionCount()
 {
   if (!mIncrementedSessionCount) {
     nsWSAdmissionManager::IncrementSessionCount();
-    mIncrementedSessionCount = 1;
+    mIncrementedSessionCount = true;
   }
 }
 
 void
 WebSocketChannel::DecrementSessionCount()
 {
   // Make sure we decrement session count only once, and only if we incremented it.
   // This code is thread-safe: sWebSocketAdmissions->DecrementSessionCount is
   // atomic, and mIncrementedSessionCount/mDecrementedSessionCount are set at
   // times when they'll never be a race condition for checking/setting them.
   if (mIncrementedSessionCount && !mDecrementedSessionCount) {
     nsWSAdmissionManager::DecrementSessionCount();
-    mDecrementedSessionCount = 1;
+    mDecrementedSessionCount = true;
   }
 }
 
 namespace {
 enum ExtensionParseMode { eParseServerSide, eParseClientSide };
 }
 
 static nsresult
@@ -2952,17 +2952,17 @@ WebSocketChannel::StartWebsocketData()
       NewRunnableMethod("net::WebSocketChannel::StartWebsocketData",
                         this,
                         &WebSocketChannel::StartWebsocketData),
       NS_DISPATCH_NORMAL);
   }
 
   LOG(("WebSocketChannel::StartWebsocketData() %p", this));
   MOZ_ASSERT(!mDataStarted, "StartWebsocketData twice");
-  mDataStarted = 1;
+  mDataStarted = true;
 
   rv = mSocketIn->AsyncWait(this, 0, 0, mSocketThread);
   if (NS_FAILED(rv)) {
     LOG(("WebSocketChannel::StartWebsocketData mSocketIn->AsyncWait() failed "
          "with error 0x%08" PRIx32, static_cast<uint32_t>(rv)));
     return mSocketThread->Dispatch(
       NewRunnableMethod<nsresult>("net::WebSocketChannel::AbortSession",
                                   this,
@@ -3232,17 +3232,17 @@ WebSocketChannel::AsyncOnChannelRedirect
 
   // Mark old channel as successfully connected so we'll clear any FailDelay
   // associated with the old URI.  Note: no need to also call OnStopSession:
   // it's a no-op for successful, already-connected channels.
   nsWSAdmissionManager::OnConnected(this);
 
   // ApplyForAdmission as if we were starting from fresh...
   mAddress.Truncate();
-  mOpenedHttpChannel = 0;
+  mOpenedHttpChannel = false;
   rv = ApplyForAdmission();
   if (NS_FAILED(rv)) {
     LOG(("WebSocketChannel: Redirect failed due to DNS failure\n"));
     mRedirectCallback = nullptr;
     return rv;
   }
 
   return NS_OK;
@@ -3293,17 +3293,17 @@ WebSocketChannel::Notify(nsITimer *timer
       return NS_OK;
     }
 
     if (!mPingOutstanding) {
       // Ping interval must be non-null or PING was forced by OnNetworkChanged()
       MOZ_ASSERT(mPingInterval || mPingForced);
       LOG(("nsWebSocketChannel:: Generating Ping\n"));
       mPingOutstanding = 1;
-      mPingForced = 0;
+      mPingForced = false;
       mPingTimer->InitWithCallback(this, mPingResponseTimeout,
                                    nsITimer::TYPE_ONE_SHOT);
       GeneratePing();
     } else {
       LOG(("nsWebSocketChannel:: Timed out Ping\n"));
       mPingTimer = nullptr;
       AbortSession(NS_ERROR_NET_TIMEOUT);
     }
@@ -3579,17 +3579,17 @@ WebSocketChannel::Close(uint16_t code, c
   if (mRequestedClose) {
     return NS_OK;
   }
 
   // The API requires the UTF-8 string to be 123 or less bytes
   if (reason.Length() > 123)
     return NS_ERROR_ILLEGAL_VALUE;
 
-  mRequestedClose = 1;
+  mRequestedClose = true;
   mScriptCloseReason = reason;
   mScriptCloseCode = code;
 
   if (!mTransport || mConnecting != NOT_CONNECTING) {
     nsresult rv;
     if (code == CLOSE_GOING_AWAY) {
       // Not an error: for example, tab has closed or navigated away
       LOG(("WebSocketChannel::Close() GOING_AWAY without transport."));
--- a/netwerk/protocol/websocket/WebSocketChannel.h
+++ b/netwerk/protocol/websocket/WebSocketChannel.h
@@ -301,15 +301,15 @@ private:
   nsCOMPtr<nsIDashboardEventNotifier> mConnectionLogService;
 };
 
 class WebSocketSSLChannel : public WebSocketChannel
 {
 public:
     WebSocketSSLChannel() { BaseWebSocketChannel::mEncrypted = true; }
 protected:
-    virtual ~WebSocketSSLChannel() {}
+    virtual ~WebSocketSSLChannel() = default;
 };
 
 } // namespace net
 } // namespace mozilla
 
 #endif // mozilla_net_WebSocketChannel_h
--- a/netwerk/protocol/websocket/WebSocketChannelParent.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannelParent.cpp
@@ -30,20 +30,16 @@ WebSocketChannelParent::WebSocketChannel
   : mAuthProvider(aAuthProvider)
   , mLoadContext(aLoadContext)
   , mIPCOpen(true)
   , mSerial(aSerial)
 {
   // Websocket channels can't have a private browsing override
   MOZ_ASSERT_IF(!aLoadContext, aOverrideStatus == kPBOverride_Unset);
 }
-
-WebSocketChannelParent::~WebSocketChannelParent()
-{
-}
 //-----------------------------------------------------------------------------
 // WebSocketChannelParent::PWebSocketChannelParent
 //-----------------------------------------------------------------------------
 
 mozilla::ipc::IPCResult
 WebSocketChannelParent::RecvDeleteSelf()
 {
   LOG(("WebSocketChannelParent::RecvDeleteSelf() %p\n", this));
--- a/netwerk/protocol/websocket/WebSocketChannelParent.h
+++ b/netwerk/protocol/websocket/WebSocketChannelParent.h
@@ -20,17 +20,17 @@ class nsIAuthPromptProvider;
 
 namespace mozilla {
 namespace net {
 
 class WebSocketChannelParent : public PWebSocketParent,
                                public nsIWebSocketListener,
                                public nsIInterfaceRequestor
 {
-  ~WebSocketChannelParent();
+  ~WebSocketChannelParent() = default;
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIWEBSOCKETLISTENER
   NS_DECL_NSIINTERFACEREQUESTOR
 
   WebSocketChannelParent(nsIAuthPromptProvider* aAuthProvider,
                          nsILoadContext* aLoadContext,
                          PBOverrideStatus aOverrideStatus,
--- a/netwerk/protocol/websocket/WebSocketEventService.cpp
+++ b/netwerk/protocol/websocket/WebSocketEventService.cpp
@@ -54,18 +54,17 @@ public:
     for (uint32_t i = 0; i < listeners.Length(); ++i) {
       DoWork(listeners[i]);
     }
 
     return NS_OK;
   }
 
 protected:
-  ~WebSocketBaseRunnable()
-  {}
+  ~WebSocketBaseRunnable() = default;
 
   virtual void DoWork(nsIWebSocketEventListener* aListener) = 0;
 
   uint32_t mWebSocketSerialID;
   uint64_t mInnerWindowID;
 };
 
 class WebSocketFrameRunnable final : public WebSocketBaseRunnable
--- a/netwerk/protocol/websocket/WebSocketFrame.cpp
+++ b/netwerk/protocol/websocket/WebSocketFrame.cpp
@@ -31,19 +31,16 @@ WebSocketFrame::WebSocketFrame(bool aFin
                                uint32_t aMask, const nsCString& aPayload)
   : mData(PR_Now(), aFinBit, aRsvBit1, aRsvBit2, aRsvBit3, aOpCode, aMaskBit,
           aMask, aPayload)
 {
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
   mData.mTimeStamp = PR_Now();
 }
 
-WebSocketFrame::~WebSocketFrame()
-{}
-
 #define WSF_GETTER( method, value , type )     \
 NS_IMETHODIMP                                  \
 WebSocketFrame::method(type* aValue)           \
 {                                              \
   MOZ_ASSERT(NS_IsMainThread());               \
   if (!aValue) {                               \
     return NS_ERROR_FAILURE;                   \
   }                                            \
--- a/netwerk/protocol/websocket/WebSocketFrame.h
+++ b/netwerk/protocol/websocket/WebSocketFrame.h
@@ -63,17 +63,17 @@ public:
                  const nsCString& aPayload);
 
   const WebSocketFrameData& Data() const
   {
     return mData;
   }
 
 private:
-  ~WebSocketFrame();
+  ~WebSocketFrame() = default;
 
   WebSocketFrameData mData;
 };
 
 } // net namespace
 } // mozilla namespace
 
 #endif // mozilla_net_WebSocketFrame_h
--- a/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp
+++ b/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp
@@ -23,20 +23,16 @@ namespace mozilla {
 namespace net {
 
 WyciwygChannelParent::WyciwygChannelParent()
  : mIPCClosed(false)
  , mReceivedAppData(false)
 {
 }
 
-WyciwygChannelParent::~WyciwygChannelParent()
-{
-}
-
 void
 WyciwygChannelParent::ActorDestroy(ActorDestroyReason why)
 {
   // We may still have refcount>0 if the channel hasn't called OnStopRequest
   // yet, but we must not send any more msgs to child.
   mIPCClosed = true;
 
   // We need to force the cycle to break here
--- a/netwerk/protocol/wyciwyg/WyciwygChannelParent.h
+++ b/netwerk/protocol/wyciwyg/WyciwygChannelParent.h
@@ -28,17 +28,17 @@ public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSIINTERFACEREQUESTOR
 
   WyciwygChannelParent();
 
 protected:
-  virtual ~WyciwygChannelParent();
+  virtual ~WyciwygChannelParent() = default;
 
   virtual mozilla::ipc::IPCResult RecvInit(const URIParams&          uri,
                                            const ipc::PrincipalInfo& aRequestingPrincipalInfo,
                                            const ipc::PrincipalInfo& aTriggeringPrincipalInfo,
                                            const ipc::PrincipalInfo& aPrincipalToInheritInfo,
                                            const uint32_t&           aSecurityFlags,
                                            const uint32_t&           aContentPolicyType) override;
   virtual mozilla::ipc::IPCResult RecvAsyncOpen(const URIParams& original,
--- a/netwerk/sctp/datachannel/DataChannel.cpp
+++ b/netwerk/sctp/datachannel/DataChannel.cpp
@@ -107,17 +107,17 @@ public:
   // around (singleton likely) unless we want to shutdown sctp whenever
   // we're not using it (and in which case we'd keep a refcnt'd object
   // ref'd by each DataChannelConnection to release the SCTP usrlib via
   // sctp_finish). Right now, the single instance of this class is
   // owned by the observer service and a StaticRefPtr.
 
   NS_DECL_ISUPPORTS
 
-  DataChannelShutdown() {}
+  DataChannelShutdown() = default;
 
   void Init()
     {
       nsCOMPtr<nsIObserverService> observerService =
         mozilla::services::GetObserverService();
       if (!observerService)
         return;
 
@@ -2972,20 +2972,19 @@ DataChannelConnection::SendDataMsgCommon
     return EINVAL; // TODO: Find a better error code
   }
 
   auto &channel = *channelPtr;
 
   if (isBinary) {
     return SendDataMsg(channel, data, len,
                        DATA_CHANNEL_PPID_BINARY_PARTIAL, DATA_CHANNEL_PPID_BINARY);
-  } else {
-    return SendDataMsg(channel, data, len,
-                       DATA_CHANNEL_PPID_DOMSTRING_PARTIAL, DATA_CHANNEL_PPID_DOMSTRING);
   }
+  return SendDataMsg(channel, data, len,
+                     DATA_CHANNEL_PPID_DOMSTRING_PARTIAL, DATA_CHANNEL_PPID_DOMSTRING);
 }
 
 void
 DataChannelConnection::Stop()
 {
   // Note: This will call 'CloseAll' from the main thread
   Dispatch(do_AddRef(new DataChannelOnMessageAvailable(
              DataChannelOnMessageAvailable::ON_DISCONNECTED,
@@ -3247,15 +3246,14 @@ DataChannel::SendOrQueue(DataChannelOnMe
 }
 
 bool
 DataChannel::EnsureValidStream(ErrorResult& aRv)
 {
   MOZ_ASSERT(mConnection);
   if (mConnection && mStream != INVALID_STREAM) {
     return true;
-  } else {
-    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
-    return false;
   }
+  aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
+  return false;
 }
 
 } // namespace mozilla
--- a/netwerk/sctp/datachannel/DataChannel.h
+++ b/netwerk/sctp/datachannel/DataChannel.h
@@ -54,25 +54,25 @@ class DataChannelOnMessageAvailable;
 // For sending outgoing messages.
 // This class only holds a reference to the data and the info structure but does
 // not copy it.
 class OutgoingMsg
 {
 public:
   OutgoingMsg(struct sctp_sendv_spa &info, const uint8_t *data,
               size_t length);
-  ~OutgoingMsg() {};
+  ~OutgoingMsg() = default;;
   void Advance(size_t offset);
   struct sctp_sendv_spa &GetInfo() { return *mInfo; };
   size_t GetLength() { return mLength; };
   size_t GetLeft() { return mLength - mPos; };
   const uint8_t *GetData() { return (const uint8_t *)(mData + mPos); };
 
 protected:
-  OutgoingMsg() {}; // Use this for inheritance only
+  OutgoingMsg() = default;; // Use this for inheritance only
   size_t mLength;
   const uint8_t *mData;
   struct sctp_sendv_spa *mInfo;
   size_t mPos;
 };
 
 // F