Bug 1318004 - Replace default bodies of special member functions with = default; r=Ehsan
authorSylvestre Ledru <sledru@mozilla.com>
Wed, 16 Nov 2016 18:26:14 +0100
changeset 324066 d430f267791ea1ca694ab1da5a6669e62dad406f
parent 324065 0c03c2ddda3a4e58295c9f3e1670237cd8b75fb9
child 324067 f59ea728b7582b566cd7f772e9780bba10cdc08b
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersEhsan
bugs1318004
milestone53.0a1
Bug 1318004 - Replace default bodies of special member functions with = default; r=Ehsan MozReview-Commit-ID: 33AOhtFrXS8
toolkit/components/commandlines/nsCommandLine.cpp
toolkit/components/ctypes/ctypes.cpp
toolkit/components/filepicker/nsFileView.cpp
toolkit/components/find/nsFindService.cpp
toolkit/components/mozintl/MozIntl.cpp
toolkit/components/parentalcontrols/nsParentalControlsServiceDefault.cpp
toolkit/components/perf/PerfMeasurement.cpp
toolkit/components/places/tests/gtest/test_IHistory.cpp
toolkit/components/reflect/reflect.cpp
toolkit/components/remote/nsXRemoteService.cpp
toolkit/components/telemetry/Telemetry.cpp
toolkit/components/telemetry/TelemetryScalar.cpp
toolkit/components/terminator/nsTerminator.cpp
toolkit/components/url-classifier/HashStore.cpp
toolkit/identity/IdentityCryptoService.cpp
toolkit/mozapps/update/updater/updater.cpp
toolkit/system/gnome/nsGIOService.cpp
toolkit/system/gnome/nsSystemAlertsService.cpp
toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
--- a/toolkit/components/commandlines/nsCommandLine.cpp
+++ b/toolkit/components/commandlines/nsCommandLine.cpp
@@ -50,17 +50,17 @@ class nsCommandLine final : public nsICo
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSICOMMANDLINE
   NS_DECL_NSICOMMANDLINERUNNER
 
   nsCommandLine();
 
 protected:
-  ~nsCommandLine() { }
+  ~nsCommandLine() = default;
 
   typedef nsresult (*EnumerateHandlersCallback)(nsICommandLineHandler* aHandler,
 					nsICommandLine* aThis,
 					void *aClosure);
   typedef nsresult (*EnumerateValidatorsCallback)(nsICommandLineValidator* aValidator,
 					nsICommandLine* aThis,
 					void *aClosure);
 
--- a/toolkit/components/ctypes/ctypes.cpp
+++ b/toolkit/components/ctypes/ctypes.cpp
@@ -45,23 +45,19 @@ UnicodeToNative(JSContext *cx, const cha
 static JSCTypesCallbacks sCallbacks = {
   UnicodeToNative
 };
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(Module)
 
 NS_IMPL_ISUPPORTS(Module, nsIXPCScriptable)
 
-Module::Module()
-{
-}
+Module::Module() = default;
 
-Module::~Module()
-{
-}
+Module::~Module() = default;
 
 #define XPC_MAP_CLASSNAME Module
 #define XPC_MAP_QUOTED_CLASSNAME "Module"
 #define XPC_MAP_WANT_CALL
 #define XPC_MAP_FLAGS nsIXPCScriptable::WANT_CALL
 #include "xpc_map_end.h"
 
 static bool
--- a/toolkit/components/filepicker/nsFileView.cpp
+++ b/toolkit/components/filepicker/nsFileView.cpp
@@ -42,17 +42,17 @@ public:
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIAUTOCOMPLETERESULT
 
   nsTArray<nsString> mValues;
   nsString mSearchString;
   uint16_t mSearchResult;
 private:
-  ~nsFileResult() {}
+  ~nsFileResult() = default;
 };
 
 NS_IMPL_ISUPPORTS(nsFileResult, nsIAutoCompleteResult)
 
 nsFileResult::nsFileResult(const nsAString& aSearchString,
                            const nsAString& aSearchParam):
   mSearchString(aSearchString)
 {
@@ -174,17 +174,17 @@ NS_IMETHODIMP nsFileResult::GetFinalComp
 
 NS_IMETHODIMP nsFileResult::RemoveValueAt(int32_t rowIndex, bool removeFromDb)
 {
   return NS_OK;
 }
 
 class nsFileComplete final : public nsIAutoCompleteSearch
 {
-  ~nsFileComplete() {}
+  ~nsFileComplete() = default;
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIAUTOCOMPLETESEARCH
 };
 
 NS_IMPL_ISUPPORTS(nsFileComplete, nsIAutoCompleteSearch)
 
 NS_IMETHODIMP
--- a/toolkit/components/find/nsFindService.cpp
+++ b/toolkit/components/find/nsFindService.cpp
@@ -17,19 +17,17 @@ nsFindService::nsFindService()
 : mFindBackwards(false)
 , mWrapFind(true)
 , mEntireWord(false)
 , mMatchCase(false)
 {
 }
 
 
-nsFindService::~nsFindService()
-{
-}
+nsFindService::~nsFindService() = default;
 
 NS_IMPL_ISUPPORTS(nsFindService, nsIFindService)
 
 NS_IMETHODIMP nsFindService::GetSearchString(nsAString & aSearchString)
 {
     aSearchString = mSearchString;
     return NS_OK;
 }
--- a/toolkit/components/mozintl/MozIntl.cpp
+++ b/toolkit/components/mozintl/MozIntl.cpp
@@ -9,23 +9,19 @@
 
 #define MOZ_MOZINTL_CID \
   { 0x83f8f991, 0x6b81, 0x4dd8, { 0xa0, 0x93, 0x72, 0x0b, 0xfb, 0x67, 0x4d, 0x38 } }
 
 using namespace mozilla;
 
 NS_IMPL_ISUPPORTS(MozIntl, mozIMozIntl)
 
-MozIntl::MozIntl()
-{
-}
+MozIntl::MozIntl() = default;
 
-MozIntl::~MozIntl()
-{
-}
+MozIntl::~MozIntl() = default;
 
 NS_IMETHODIMP
 MozIntl::AddGetCalendarInfo(JS::Handle<JS::Value> val, JSContext* cx)
 {
   if (!val.isObject()) {
     return NS_ERROR_INVALID_ARG;
   }
 
--- a/toolkit/components/parentalcontrols/nsParentalControlsServiceDefault.cpp
+++ b/toolkit/components/parentalcontrols/nsParentalControlsServiceDefault.cpp
@@ -11,19 +11,17 @@
 NS_IMPL_ISUPPORTS(nsParentalControlsService, nsIParentalControlsService)
 
 nsParentalControlsService::nsParentalControlsService() :
   mEnabled(false)
 {
   mozilla::Unused << mEnabled;
 }
 
-nsParentalControlsService::~nsParentalControlsService()
-{
-}
+nsParentalControlsService::~nsParentalControlsService() = default;
 
 NS_IMETHODIMP
 nsParentalControlsService::GetParentalControlsEnabled(bool *aResult)
 {
   *aResult = false;
   return NS_OK;
 }
 
--- a/toolkit/components/perf/PerfMeasurement.cpp
+++ b/toolkit/components/perf/PerfMeasurement.cpp
@@ -20,23 +20,19 @@
 
 namespace mozilla {
 namespace jsperf {
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(Module)
 
 NS_IMPL_ISUPPORTS(Module, nsIXPCScriptable)
 
-Module::Module()
-{
-}
+Module::Module() = default;
 
-Module::~Module()
-{
-}
+Module::~Module() = default;
 
 #define XPC_MAP_CLASSNAME Module
 #define XPC_MAP_QUOTED_CLASSNAME "Module"
 #define XPC_MAP_WANT_CALL
 #define XPC_MAP_FLAGS nsIXPCScriptable::WANT_CALL
 #include "xpc_map_end.h"
 
 static bool
--- a/toolkit/components/places/tests/gtest/test_IHistory.cpp
+++ b/toolkit/components/places/tests/gtest/test_IHistory.cpp
@@ -46,17 +46,17 @@ new_test_uri()
   nsCOMPtr<nsIURI> testURI;
   nsresult rv = NS_NewURI(getter_AddRefs(testURI), spec);
   do_check_success(rv);
   return testURI.forget();
 }
 
 class VisitURIObserver final : public nsIObserver
 {
-  ~VisitURIObserver() {}
+  ~VisitURIObserver() = default;
 
 public:
   NS_DECL_ISUPPORTS
 
   explicit VisitURIObserver(int aExpectedVisits = 1) :
     mVisits(0),
     mExpectedVisits(aExpectedVisits)
   {
@@ -305,17 +305,17 @@ test_RegisterVisitedCallback_returns_bef
 }
 
 namespace test_observer_topic_dispatched_helpers {
   #define URI_VISITED "visited"
   #define URI_NOT_VISITED "not visited"
   #define URI_VISITED_RESOLUTION_TOPIC "visited-status-resolution"
   class statusObserver final : public nsIObserver
   {
-    ~statusObserver() {}
+    ~statusObserver() = default;
 
   public:
     NS_DECL_ISUPPORTS
 
     statusObserver(nsIURI* aURI,
                    const bool aExpectVisit,
                    bool& _notified)
     : mURI(aURI)
--- a/toolkit/components/reflect/reflect.cpp
+++ b/toolkit/components/reflect/reflect.cpp
@@ -18,23 +18,19 @@
 
 namespace mozilla {
 namespace reflect {
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(Module)
 
 NS_IMPL_ISUPPORTS(Module, nsIXPCScriptable)
 
-Module::Module()
-{
-}
+Module::Module() = default;
 
-Module::~Module()
-{
-}
+Module::~Module() = default;
 
 #define XPC_MAP_CLASSNAME Module
 #define XPC_MAP_QUOTED_CLASSNAME "Module"
 #define XPC_MAP_WANT_CALL
 #define XPC_MAP_FLAGS nsIXPCScriptable::WANT_CALL
 #include "xpc_map_end.h"
 
 NS_IMETHODIMP
--- a/toolkit/components/remote/nsXRemoteService.cpp
+++ b/toolkit/components/remote/nsXRemoteService.cpp
@@ -105,19 +105,17 @@ FindExtensionParameterInCommand(const ch
   } else {
     idEnd = charEnd;
   }
   *aValue = nsDependentCSubstring(idStart, idEnd);
   return true;
 }
 
 
-nsXRemoteService::nsXRemoteService()
-{    
-}
+nsXRemoteService::nsXRemoteService() = default;
 
 void
 nsXRemoteService::XRemoteBaseStartup(const char *aAppName, const char *aProfileName)
 {
     EnsureAtoms();
 
     mAppName = aAppName;
     ToLowerCase(mAppName);
--- a/toolkit/components/telemetry/Telemetry.cpp
+++ b/toolkit/components/telemetry/Telemetry.cpp
@@ -220,17 +220,17 @@ public:
       : mAnnotations(Move(aAnnotations))
     {
       mHangIndices.AppendElement(aHangIndex);
     }
     AnnotationInfo(AnnotationInfo&& aOther)
       : mHangIndices(aOther.mHangIndices)
       , mAnnotations(Move(aOther.mAnnotations))
     {}
-    ~AnnotationInfo() {}
+    ~AnnotationInfo() = default;
     AnnotationInfo& operator=(AnnotationInfo&& aOther)
     {
       mHangIndices = aOther.mHangIndices;
       mAnnotations = Move(aOther.mAnnotations);
       return *this;
     }
     // To save memory, a single AnnotationInfo can be associated to multiple chrome
     // hangs. The following array holds the index of each related chrome hang.
@@ -2566,19 +2566,17 @@ RecordShutdownEndTimeStamp() {
 ////////////////////////////////////////////////////////////////////////
 //
 // EXTERNALLY VISIBLE FUNCTIONS in mozilla::Telemetry::
 // These are NOT listed in Telemetry.h
 
 namespace mozilla {
 namespace Telemetry {
 
-ProcessedStack::ProcessedStack()
-{
-}
+ProcessedStack::ProcessedStack() = default;
 
 size_t ProcessedStack::GetStackSize() const
 {
   return mStack.size();
 }
 
 size_t ProcessedStack::GetNumModules() const
 {
--- a/toolkit/components/telemetry/TelemetryScalar.cpp
+++ b/toolkit/components/telemetry/TelemetryScalar.cpp
@@ -149,17 +149,17 @@ ScalarInfo::expiration() const
 
 /**
  * The base scalar object, that servers as a common ancestor for storage
  * purposes.
  */
 class ScalarBase
 {
 public:
-  virtual ~ScalarBase() {};
+  virtual ~ScalarBase() = default;;
 
   // Set, Add and SetMaximum functions as described in the Telemetry IDL.
   virtual ScalarResult SetValue(nsIVariant* aValue) = 0;
   virtual ScalarResult AddValue(nsIVariant* aValue) { return ScalarResult::OperationNotSupported; }
   virtual ScalarResult SetMaximum(nsIVariant* aValue) { return ScalarResult::OperationNotSupported; }
 
   // Convenience methods used by the C++ API.
   virtual void SetValue(uint32_t aValue) { mozilla::Unused << HandleUnsupported(); }
@@ -189,17 +189,17 @@ ScalarBase::HandleUnsupported() const
  * The implementation for the unsigned int scalar type.
  */
 class ScalarUnsigned : public ScalarBase
 {
 public:
   using ScalarBase::SetValue;
 
   ScalarUnsigned() : mStorage(0) {};
-  ~ScalarUnsigned() {};
+  ~ScalarUnsigned() = default;;
 
   ScalarResult SetValue(nsIVariant* aValue) final;
   void SetValue(uint32_t aValue) final;
   ScalarResult AddValue(nsIVariant* aValue) final;
   void AddValue(uint32_t aValue) final;
   ScalarResult SetMaximum(nsIVariant* aValue) final;
   void SetMaximum(uint32_t aValue) final;
   nsresult GetValue(nsCOMPtr<nsIVariant>& aResult) const final;
@@ -329,17 +329,17 @@ ScalarUnsigned::CheckInput(nsIVariant* a
  * The implementation for the string scalar type.
  */
 class ScalarString : public ScalarBase
 {
 public:
   using ScalarBase::SetValue;
 
   ScalarString() : mStorage(EmptyString()) {};
-  ~ScalarString() {};
+  ~ScalarString() = default;;
 
   ScalarResult SetValue(nsIVariant* aValue) final;
   ScalarResult SetValue(const nsAString& aValue) final;
   nsresult GetValue(nsCOMPtr<nsIVariant>& aResult) const final;
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const final;
 
 private:
   nsString mStorage;
@@ -410,17 +410,17 @@ ScalarString::SizeOfIncludingThis(mozill
  * The implementation for the boolean scalar type.
  */
 class ScalarBoolean : public ScalarBase
 {
 public:
   using ScalarBase::SetValue;
 
   ScalarBoolean() : mStorage(false) {};
-  ~ScalarBoolean() {};
+  ~ScalarBoolean() = default;;
 
   ScalarResult SetValue(nsIVariant* aValue) final;
   void SetValue(bool aValue) final;
   nsresult GetValue(nsCOMPtr<nsIVariant>& aResult) const final;
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const final;
 
 private:
   bool mStorage;
@@ -509,17 +509,17 @@ internal_ScalarAllocate(uint32_t aScalar
  * The implementation for the keyed scalar type.
  */
 class KeyedScalar
 {
 public:
   typedef mozilla::Pair<nsCString, nsCOMPtr<nsIVariant>> KeyValuePair;
 
   explicit KeyedScalar(uint32_t aScalarKind) : mScalarKind(aScalarKind) {};
-  ~KeyedScalar() {};
+  ~KeyedScalar() = default;;
 
   // Set, Add and SetMaximum functions as described in the Telemetry IDL.
   // These methods implicitly instantiate a Scalar[*] for each key.
   ScalarResult SetValue(const nsAString& aKey, nsIVariant* aValue);
   ScalarResult AddValue(const nsAString& aKey, nsIVariant* aValue);
   ScalarResult SetMaximum(const nsAString& aKey, nsIVariant* aValue);
 
   // Convenience methods used by the C++ API.
--- a/toolkit/components/terminator/nsTerminator.cpp
+++ b/toolkit/components/terminator/nsTerminator.cpp
@@ -168,20 +168,20 @@ RunWatchdog(void* arg)
 // thread rather than usual XPCOM I/O simply because we outlive XPCOM and its
 // threads.
 //
 
 // Utility class, used by UniquePtr<> to close nspr files.
 class PR_CloseDelete
 {
 public:
-  constexpr PR_CloseDelete() {}
+  constexpr PR_CloseDelete() = default;
 
   PR_CloseDelete(const PR_CloseDelete& aOther)
-  {}
+  = default;
 
   void operator()(PRFileDesc* aPtr) const
   {
     PR_Close(aPtr);
   }
 };
 
 //
--- a/toolkit/components/url-classifier/HashStore.cpp
+++ b/toolkit/components/url-classifier/HashStore.cpp
@@ -219,18 +219,17 @@ HashStore::HashStore(const nsACString& a
                                                      getter_AddRefs(mStoreDirectory));
   if (NS_FAILED(rv)) {
     LOG(("Failed to get private store directory for %s", mTableName.get()));
     mStoreDirectory = aRootStoreDir;
   }
 }
 
 HashStore::~HashStore()
-{
-}
+= default;
 
 nsresult
 HashStore::Reset()
 {
   LOG(("HashStore resetting"));
 
   nsCOMPtr<nsIFile> storeFile;
   nsresult rv = mStoreDirectory->Clone(getter_AddRefs(storeFile));
--- a/toolkit/identity/IdentityCryptoService.cpp
+++ b/toolkit/identity/IdentityCryptoService.cpp
@@ -166,29 +166,29 @@ private:
 };
 
 class IdentityCryptoService final : public nsIIdentityCryptoService
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIIDENTITYCRYPTOSERVICE
 
-  IdentityCryptoService() { }
+  IdentityCryptoService() = default;
   nsresult Init()
   {
     nsresult rv;
     nsCOMPtr<nsISupports> dummyUsedToEnsureNSSIsInitialized
       = do_GetService("@mozilla.org/psm;1", &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return NS_OK;
   }
 
 private:
-  ~IdentityCryptoService() { }
+  ~IdentityCryptoService() = default;
   IdentityCryptoService(const KeyPair &) = delete;
   void operator=(const IdentityCryptoService &) = delete;
 };
 
 NS_IMPL_ISUPPORTS(IdentityCryptoService, nsIIdentityCryptoService)
 
 NS_IMETHODIMP
 IdentityCryptoService::GenerateKeyPair(
--- a/toolkit/mozapps/update/updater/updater.cpp
+++ b/toolkit/mozapps/update/updater/updater.cpp
@@ -1081,17 +1081,17 @@ static void backup_finish(const NS_tchar
 //-----------------------------------------------------------------------------
 
 static int DoUpdate();
 
 class Action
 {
 public:
   Action() : mProgressCost(1), mNext(nullptr) { }
-  virtual ~Action() { }
+  virtual ~Action() = default;
 
   virtual int Parse(NS_tchar *line) = 0;
 
   // Do any preprocessing to ensure that the action can be performed.  Execute
   // will be called if this Action and all others return OK from this method.
   virtual int Prepare() = 0;
 
   // Perform the operation.  Return OK to indicate success.  After all actions
--- a/toolkit/system/gnome/nsGIOService.cpp
+++ b/toolkit/system/gnome/nsGIOService.cpp
@@ -81,17 +81,17 @@ nsGIOMimeApp::Launch(const nsACString& a
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
 class GIOUTF8StringEnumerator final : public nsIUTF8StringEnumerator
 {
-  ~GIOUTF8StringEnumerator() { }
+  ~GIOUTF8StringEnumerator() = default;
 
 public:
   GIOUTF8StringEnumerator() : mIndex(0) { }
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIUTF8STRINGENUMERATOR
 
   nsTArray<nsCString> mStrings;
--- a/toolkit/system/gnome/nsSystemAlertsService.cpp
+++ b/toolkit/system/gnome/nsSystemAlertsService.cpp
@@ -13,21 +13,20 @@ NS_IMPL_ADDREF(nsSystemAlertsService)
 NS_IMPL_RELEASE(nsSystemAlertsService)
 
 NS_INTERFACE_MAP_BEGIN(nsSystemAlertsService)
    NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAlertsService)
    NS_INTERFACE_MAP_ENTRY(nsIAlertsService)
 NS_INTERFACE_MAP_END_THREADSAFE
 
 nsSystemAlertsService::nsSystemAlertsService()
-{
-}
+= default;
 
 nsSystemAlertsService::~nsSystemAlertsService()
-{}
+= default;
 
 nsresult
 nsSystemAlertsService::Init()
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP nsSystemAlertsService::ShowAlertNotification(const nsAString & aImageUrl, const nsAString & aAlertTitle, 
--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
+++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
@@ -28,17 +28,17 @@ public:
 
   nsUnixSystemProxySettings()
     : mSchemeProxySettings(4)
   {
   }
   nsresult Init();
 
 private:
-  ~nsUnixSystemProxySettings() {}
+  ~nsUnixSystemProxySettings() = default;
   
   nsCOMPtr<nsIGConfService> mGConf;
   nsCOMPtr<nsIGSettingsService> mGSettings;
   nsCOMPtr<nsIGSettingsCollection> mProxySettings;
   nsInterfaceHashtable<nsCStringHashKey, nsIGSettingsCollection> mSchemeProxySettings;
   bool IsProxyMode(const char* aMode);
   nsresult SetProxyResultFromGConf(const char* aKeyBase, const char* aType, nsACString& aResult);
   nsresult GetProxyFromGConf(const nsACString& aScheme, const nsACString& aHost, int32_t aPort, nsACString& aResult);