Bug 1317954 - Replace default bodies of special member functions with = default; in xpcom/. r=froydnj
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Wed, 16 Nov 2016 14:25:31 +0200
changeset 368270 c270b3d62780530b8431248592c45de7e33cfb3c
parent 368269 0f6bb0d8379bae5b0b8511d29f55c3ccfcb727e5
child 368271 7011bfbad725d998c408ddf89c01db7d9161eb44
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1317954
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1317954 - Replace default bodies of special member functions with = default; in xpcom/. r=froydnj MozReview-Commit-ID: 5GXchMr0VvV
xpcom/build/FileLocation.cpp
xpcom/components/nsCategoryManager.cpp
xpcom/glue/nsArrayEnumerator.cpp
xpcom/glue/nsCategoryCache.cpp
xpcom/glue/nsEnumeratorUtils.cpp
xpcom/tests/gtest/TestHashtables.cpp
xpcom/tests/gtest/TestNsRefPtr.cpp
--- a/xpcom/build/FileLocation.cpp
+++ b/xpcom/build/FileLocation.cpp
@@ -5,23 +5,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "FileLocation.h"
 #include "nsZipArchive.h"
 #include "nsURLHelper.h"
 
 namespace mozilla {
 
-FileLocation::FileLocation()
-{
-}
+FileLocation::FileLocation() = default;
 
-FileLocation::~FileLocation()
-{
-}
+FileLocation::~FileLocation() = default;
 
 FileLocation::FileLocation(nsIFile* aFile)
 {
   Init(aFile);
 }
 
 FileLocation::FileLocation(nsIFile* aFile, const char* aPath)
 {
--- a/xpcom/components/nsCategoryManager.cpp
+++ b/xpcom/components/nsCategoryManager.cpp
@@ -201,19 +201,17 @@ EntryEnumerator::Create(nsTHashtable<Cat
 //
 
 CategoryNode*
 CategoryNode::Create(PLArenaPool* aArena)
 {
   return new (aArena) CategoryNode();
 }
 
-CategoryNode::~CategoryNode()
-{
-}
+CategoryNode::~CategoryNode() = default;
 
 void*
 CategoryNode::operator new(size_t aSize, PLArenaPool* aArena)
 {
   void* p;
   PL_ARENA_ALLOCATE(p, aArena, aSize);
   return p;
 }
--- a/xpcom/glue/nsArrayEnumerator.cpp
+++ b/xpcom/glue/nsArrayEnumerator.cpp
@@ -27,17 +27,17 @@ public:
   // nsSimpleArrayEnumerator methods
   explicit nsSimpleArrayEnumerator(nsIArray* aValueArray)
     : mValueArray(aValueArray)
     , mIndex(0)
   {
   }
 
 private:
-  ~nsSimpleArrayEnumerator() {}
+  ~nsSimpleArrayEnumerator() = default;
 
 protected:
   nsCOMPtr<nsIArray> mValueArray;
   uint32_t mIndex;
 };
 
 NS_IMPL_ISUPPORTS(nsSimpleArrayEnumerator, nsISimpleEnumerator)
 
--- a/xpcom/glue/nsCategoryCache.cpp
+++ b/xpcom/glue/nsCategoryCache.cpp
@@ -57,19 +57,17 @@ nsCategoryObserver::nsCategoryObserver(c
   if (serv) {
     serv->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
     serv->AddObserver(this, NS_XPCOM_CATEGORY_ENTRY_ADDED_OBSERVER_ID, false);
     serv->AddObserver(this, NS_XPCOM_CATEGORY_ENTRY_REMOVED_OBSERVER_ID, false);
     serv->AddObserver(this, NS_XPCOM_CATEGORY_CLEARED_OBSERVER_ID, false);
   }
 }
 
-nsCategoryObserver::~nsCategoryObserver()
-{
-}
+nsCategoryObserver::~nsCategoryObserver() = default;
 
 NS_IMPL_ISUPPORTS(nsCategoryObserver, nsIObserver)
 
 void
 nsCategoryObserver::ListenerDied()
 {
   RemoveObservers();
 }
--- a/xpcom/glue/nsEnumeratorUtils.cpp
+++ b/xpcom/glue/nsEnumeratorUtils.cpp
@@ -117,19 +117,17 @@ protected:
 };
 
 nsSingletonEnumerator::nsSingletonEnumerator(nsISupports* aValue)
   : mValue(aValue)
 {
   mConsumed = (mValue ? false : true);
 }
 
-nsSingletonEnumerator::~nsSingletonEnumerator()
-{
-}
+nsSingletonEnumerator::~nsSingletonEnumerator() = default;
 
 NS_IMPL_ISUPPORTS(nsSingletonEnumerator, nsISimpleEnumerator)
 
 NS_IMETHODIMP
 nsSingletonEnumerator::HasMoreElements(bool* aResult)
 {
   NS_PRECONDITION(aResult != 0, "null ptr");
   if (!aResult) {
@@ -196,19 +194,17 @@ nsUnionEnumerator::nsUnionEnumerator(nsI
                                      nsISimpleEnumerator* aSecondEnumerator)
   : mFirstEnumerator(aFirstEnumerator)
   , mSecondEnumerator(aSecondEnumerator)
   , mConsumed(false)
   , mAtSecond(false)
 {
 }
 
-nsUnionEnumerator::~nsUnionEnumerator()
-{
-}
+nsUnionEnumerator::~nsUnionEnumerator() = default;
 
 NS_IMPL_ISUPPORTS(nsUnionEnumerator, nsISimpleEnumerator)
 
 NS_IMETHODIMP
 nsUnionEnumerator::HasMoreElements(bool* aResult)
 {
   NS_PRECONDITION(aResult != 0, "null ptr");
   if (!aResult) {
--- a/xpcom/tests/gtest/TestHashtables.cpp
+++ b/xpcom/tests/gtest/TestHashtables.cpp
@@ -22,19 +22,17 @@ namespace TestHashtables {
 class TestUniChar // for nsClassHashtable
 {
 public:
   explicit TestUniChar(uint32_t aWord)
   {
     mWord = aWord;
   }
 
-  ~TestUniChar()
-  {
-  }
+  ~TestUniChar() = default;
 
   uint32_t GetChar() const { return mWord; }
 
 private:
   uint32_t mWord;
 };
 
 struct EntityNode {
@@ -66,17 +64,17 @@ EntityNode gEntities[] = {
 class EntityToUnicodeEntry : public PLDHashEntryHdr
 {
 public:
   typedef const char* KeyType;
   typedef const char* KeyTypePointer;
 
   explicit EntityToUnicodeEntry(const char* aKey) { mNode = nullptr; }
   EntityToUnicodeEntry(const EntityToUnicodeEntry& aEntry) { mNode = aEntry.mNode; }
-  ~EntityToUnicodeEntry() { }
+  ~EntityToUnicodeEntry() = default;
 
   bool KeyEquals(const char* aEntity) const { return !strcmp(mNode->mStr, aEntity); }
   static const char* KeyToPointer(const char* aEntity) { return aEntity; }
   static PLDHashNumber HashKey(const char* aEntity) { return mozilla::HashString(aEntity); }
   enum { ALLOW_MEMMOVE = true };
 
   const EntityNode* mNode;
 };
--- a/xpcom/tests/gtest/TestNsRefPtr.cpp
+++ b/xpcom/tests/gtest/TestNsRefPtr.cpp
@@ -414,19 +414,17 @@ NS_METHOD_(MozExternalRefCountType) Rele
 protected:                                                                  \
 mutable ::mozilla::ThreadSafeAutoRefCnt mRefCnt;                            \
 public:
 
 class ObjectForConstPtr
 {
   private:
     // Reference-counted classes cannot have public destructors.
-    ~ObjectForConstPtr()
-    {
-    }
+    ~ObjectForConstPtr() = default;
   public:
     NS_INLINE_DECL_THREADSAFE_MUTABLE_REFCOUNTING(ObjectForConstPtr)
       void ConstMemberFunction( int aArg1, int* aArgPtr, int& aArgRef ) const
       {
       }
 };
 #undef NS_INLINE_DECL_THREADSAFE_MUTABLE_REFCOUNTING