Skip to content

Commit

Permalink
Bug 1318004 - Replace default bodies of special member functions with…
Browse files Browse the repository at this point in the history
… = default; r=Ehsan

MozReview-Commit-ID: 33AOhtFrXS8
  • Loading branch information
sylvestre committed Nov 16, 2016
1 parent 589fb90 commit e27f27d
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 59 deletions.
2 changes: 1 addition & 1 deletion toolkit/components/commandlines/nsCommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class nsCommandLine final : public nsICommandLineRunner
nsCommandLine();

protected:
~nsCommandLine() { }
~nsCommandLine() = default;

typedef nsresult (*EnumerateHandlersCallback)(nsICommandLineHandler* aHandler,
nsICommandLine* aThis,
Expand Down
8 changes: 2 additions & 6 deletions toolkit/components/ctypes/ctypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,9 @@ 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"
Expand Down
4 changes: 2 additions & 2 deletions toolkit/components/filepicker/nsFileView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class nsFileResult final : public nsIAutoCompleteResult
nsString mSearchString;
uint16_t mSearchResult;
private:
~nsFileResult() {}
~nsFileResult() = default;
};

NS_IMPL_ISUPPORTS(nsFileResult, nsIAutoCompleteResult)
Expand Down Expand Up @@ -179,7 +179,7 @@ NS_IMETHODIMP nsFileResult::RemoveValueAt(int32_t rowIndex, bool removeFromDb)

class nsFileComplete final : public nsIAutoCompleteSearch
{
~nsFileComplete() {}
~nsFileComplete() = default;
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIAUTOCOMPLETESEARCH
Expand Down
4 changes: 1 addition & 3 deletions toolkit/components/find/nsFindService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ nsFindService::nsFindService()
}


nsFindService::~nsFindService()
{
}
nsFindService::~nsFindService() = default;

NS_IMPL_ISUPPORTS(nsFindService, nsIFindService)

Expand Down
8 changes: 2 additions & 6 deletions toolkit/components/mozintl/MozIntl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ nsParentalControlsService::nsParentalControlsService() :
mozilla::Unused << mEnabled;
}

nsParentalControlsService::~nsParentalControlsService()
{
}
nsParentalControlsService::~nsParentalControlsService() = default;

NS_IMETHODIMP
nsParentalControlsService::GetParentalControlsEnabled(bool *aResult)
Expand Down
8 changes: 2 additions & 6 deletions toolkit/components/perf/PerfMeasurement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ 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"
Expand Down
4 changes: 2 additions & 2 deletions toolkit/components/places/tests/gtest/test_IHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ new_test_uri()

class VisitURIObserver final : public nsIObserver
{
~VisitURIObserver() {}
~VisitURIObserver() = default;

public:
NS_DECL_ISUPPORTS
Expand Down Expand Up @@ -310,7 +310,7 @@ namespace test_observer_topic_dispatched_helpers {
#define URI_VISITED_RESOLUTION_TOPIC "visited-status-resolution"
class statusObserver final : public nsIObserver
{
~statusObserver() {}
~statusObserver() = default;

public:
NS_DECL_ISUPPORTS
Expand Down
8 changes: 2 additions & 6 deletions toolkit/components/reflect/reflect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ 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"
Expand Down
4 changes: 1 addition & 3 deletions toolkit/components/remote/nsXRemoteService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ FindExtensionParameterInCommand(const char* aParameterName,
}


nsXRemoteService::nsXRemoteService()
{
}
nsXRemoteService::nsXRemoteService() = default;

void
nsXRemoteService::XRemoteBaseStartup(const char *aAppName, const char *aProfileName)
Expand Down
6 changes: 2 additions & 4 deletions toolkit/components/telemetry/Telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class HangReports {
: mHangIndices(aOther.mHangIndices)
, mAnnotations(Move(aOther.mAnnotations))
{}
~AnnotationInfo() {}
~AnnotationInfo() = default;
AnnotationInfo& operator=(AnnotationInfo&& aOther)
{
mHangIndices = aOther.mHangIndices;
Expand Down Expand Up @@ -2571,9 +2571,7 @@ RecordShutdownEndTimeStamp() {
namespace mozilla {
namespace Telemetry {

ProcessedStack::ProcessedStack()
{
}
ProcessedStack::ProcessedStack() = default;

size_t ProcessedStack::GetStackSize() const
{
Expand Down
10 changes: 5 additions & 5 deletions toolkit/components/telemetry/TelemetryScalar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ ScalarInfo::expiration() const
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;
Expand Down Expand Up @@ -194,7 +194,7 @@ class ScalarUnsigned : public ScalarBase
using ScalarBase::SetValue;

ScalarUnsigned() : mStorage(0) {};
~ScalarUnsigned() {};
~ScalarUnsigned() = default;;

ScalarResult SetValue(nsIVariant* aValue) final;
void SetValue(uint32_t aValue) final;
Expand Down Expand Up @@ -334,7 +334,7 @@ class ScalarString : public ScalarBase
using ScalarBase::SetValue;

ScalarString() : mStorage(EmptyString()) {};
~ScalarString() {};
~ScalarString() = default;;

ScalarResult SetValue(nsIVariant* aValue) final;
ScalarResult SetValue(const nsAString& aValue) final;
Expand Down Expand Up @@ -415,7 +415,7 @@ class ScalarBoolean : public ScalarBase
using ScalarBase::SetValue;

ScalarBoolean() : mStorage(false) {};
~ScalarBoolean() {};
~ScalarBoolean() = default;;

ScalarResult SetValue(nsIVariant* aValue) final;
void SetValue(bool aValue) final;
Expand Down Expand Up @@ -514,7 +514,7 @@ class KeyedScalar
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.
Expand Down
4 changes: 2 additions & 2 deletions toolkit/components/terminator/nsTerminator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ RunWatchdog(void* arg)
class PR_CloseDelete
{
public:
constexpr PR_CloseDelete() {}
constexpr PR_CloseDelete() = default;

PR_CloseDelete(const PR_CloseDelete& aOther)
{}
= default;

void operator()(PRFileDesc* aPtr) const
{
Expand Down
3 changes: 1 addition & 2 deletions toolkit/components/url-classifier/HashStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ HashStore::HashStore(const nsACString& aTableName,
}

HashStore::~HashStore()
{
}
= default;

nsresult
HashStore::Reset()
Expand Down
4 changes: 2 additions & 2 deletions toolkit/identity/IdentityCryptoService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class IdentityCryptoService final : public nsIIdentityCryptoService
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIIDENTITYCRYPTOSERVICE

IdentityCryptoService() { }
IdentityCryptoService() = default;
nsresult Init()
{
nsresult rv;
Expand All @@ -183,7 +183,7 @@ class IdentityCryptoService final : public nsIIdentityCryptoService
}

private:
~IdentityCryptoService() { }
~IdentityCryptoService() = default;
IdentityCryptoService(const KeyPair &) = delete;
void operator=(const IdentityCryptoService &) = delete;
};
Expand Down
2 changes: 1 addition & 1 deletion toolkit/mozapps/update/updater/updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ class Action
{
public:
Action() : mProgressCost(1), mNext(nullptr) { }
virtual ~Action() { }
virtual ~Action() = default;

virtual int Parse(NS_tchar *line) = 0;

Expand Down
2 changes: 1 addition & 1 deletion toolkit/system/gnome/nsGIOService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ nsGIOMimeApp::Launch(const nsACString& aUri)

class GIOUTF8StringEnumerator final : public nsIUTF8StringEnumerator
{
~GIOUTF8StringEnumerator() { }
~GIOUTF8StringEnumerator() = default;

public:
GIOUTF8StringEnumerator() : mIndex(0) { }
Expand Down
5 changes: 2 additions & 3 deletions toolkit/system/gnome/nsSystemAlertsService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ NS_INTERFACE_MAP_BEGIN(nsSystemAlertsService)
NS_INTERFACE_MAP_END_THREADSAFE

nsSystemAlertsService::nsSystemAlertsService()
{
}
= default;

nsSystemAlertsService::~nsSystemAlertsService()
{}
= default;

nsresult
nsSystemAlertsService::Init()
Expand Down
2 changes: 1 addition & 1 deletion toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class nsUnixSystemProxySettings final : public nsISystemProxySettings {
nsresult Init();

private:
~nsUnixSystemProxySettings() {}
~nsUnixSystemProxySettings() = default;

nsCOMPtr<nsIGConfService> mGConf;
nsCOMPtr<nsIGSettingsService> mGSettings;
Expand Down

0 comments on commit e27f27d

Please sign in to comment.