Skip to content

Commit

Permalink
Bug 1613985 - Use default for equivalent-to-default constructors/dest…
Browse files Browse the repository at this point in the history
…ructors in widget. r=jmathies

Differential Revision: https://phabricator.services.mozilla.com/D66012

--HG--
extra : moz-landing-system : lando
  • Loading branch information
sigiesec committed Mar 16, 2020
1 parent ec26b3f commit cb0734d
Show file tree
Hide file tree
Showing 58 changed files with 79 additions and 86 deletions.
2 changes: 1 addition & 1 deletion widget/BasicEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ class WidgetGUIEvent : public WidgetEvent {
EventClassID aEventClassID)
: WidgetEvent(aIsTrusted, aMessage, aEventClassID), mWidget(aWidget) {}

WidgetGUIEvent() {}
WidgetGUIEvent() = default;

public:
virtual WidgetGUIEvent* AsGUIEvent() override { return this; }
Expand Down
2 changes: 1 addition & 1 deletion widget/CompositorWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace widget {
CompositorWidget::CompositorWidget(const layers::CompositorOptions& aOptions)
: mOptions(aOptions) {}

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

already_AddRefed<gfx::DrawTarget> CompositorWidget::StartRemoteDrawing() {
return nullptr;
Expand Down
4 changes: 2 additions & 2 deletions widget/ContentCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class GetRectText : public nsAutoCString {
AppendInt(aRect.Height());
AppendLiteral(" }");
}
virtual ~GetRectText() {}
virtual ~GetRectText() = default;
};

class GetWritingModeName : public nsAutoCString {
Expand All @@ -62,7 +62,7 @@ class GetWritingModeName : public nsAutoCString {
}
AssignLiteral("Vertical (RTL)");
}
virtual ~GetWritingModeName() {}
virtual ~GetWritingModeName() = default;
};

class GetEscapedUTF8String final : public NS_ConvertUTF16toUTF8 {
Expand Down
6 changes: 3 additions & 3 deletions widget/GfxInfoBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ bool GfxInfoBase::sShutdownOccurred;

// Observes for shutdown so that the child GfxDriverInfo list is freed.
class ShutdownObserver : public nsIObserver {
virtual ~ShutdownObserver() {}
virtual ~ShutdownObserver() = default;

public:
ShutdownObserver() {}
ShutdownObserver() = default;

NS_DECL_ISUPPORTS

Expand Down Expand Up @@ -629,7 +629,7 @@ GfxInfoBase::Observe(nsISupports* aSubject, const char* aTopic,

GfxInfoBase::GfxInfoBase() : mScreenPixels(INT64_MAX), mMutex("GfxInfoBase") {}

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

nsresult GfxInfoBase::Init() {
InitGfxDriverInfoShutdownObserver();
Expand Down
2 changes: 1 addition & 1 deletion widget/GfxInfoX11.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class GfxInfo final : public GfxInfoBase {
#endif

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

virtual nsresult GetFeatureStatusImpl(
int32_t aFeature, int32_t* aStatus, nsAString& aSuggestedDriverVersion,
Expand Down
2 changes: 1 addition & 1 deletion widget/InputData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace mozilla {

using namespace dom;

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

InputData::InputData(InputType aInputType)
: mInputType(aInputType),
Expand Down
11 changes: 2 additions & 9 deletions widget/MouseEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class WidgetPointerEventHolder final {
NS_INLINE_DECL_REFCOUNTING(WidgetPointerEventHolder)

private:
virtual ~WidgetPointerEventHolder() {}
virtual ~WidgetPointerEventHolder() = default;
};

/******************************************************************************
Expand Down Expand Up @@ -62,14 +62,7 @@ class WidgetPointerHelper {
tangentialPressure(aTangentialPressure),
convertToPointer(true) {}

explicit WidgetPointerHelper(const WidgetPointerHelper& aHelper)
: pointerId(aHelper.pointerId),
tiltX(aHelper.tiltX),
tiltY(aHelper.tiltY),
twist(aHelper.twist),
tangentialPressure(aHelper.tangentialPressure),
convertToPointer(aHelper.convertToPointer),
mCoalescedWidgetEvents(aHelper.mCoalescedWidgetEvents) {}
explicit WidgetPointerHelper(const WidgetPointerHelper& aHelper) = default;

void AssignPointerHelperData(const WidgetPointerHelper& aEvent,
bool aCopyCoalescedEvents = false) {
Expand Down
2 changes: 1 addition & 1 deletion widget/PuppetBidiKeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NS_IMPL_ISUPPORTS(PuppetBidiKeyboard, nsIBidiKeyboard)
PuppetBidiKeyboard::PuppetBidiKeyboard()
: nsIBidiKeyboard(), mIsLangRTL(false), mHaveBidiKeyboards(false) {}

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

NS_IMETHODIMP
PuppetBidiKeyboard::Reset() { return NS_OK; }
Expand Down
4 changes: 2 additions & 2 deletions widget/PuppetWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ void PuppetWidget::StartAsyncScrollbarDrag(

PuppetScreen::PuppetScreen(void* nativeScreen) {}

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

static ScreenConfiguration ScreenConfig() {
ScreenConfiguration config;
Expand Down Expand Up @@ -1230,7 +1230,7 @@ PuppetScreenManager::PuppetScreenManager() {
mOneScreen = new PuppetScreen(nullptr);
}

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

NS_IMETHODIMP
PuppetScreenManager::GetPrimaryScreen(nsIScreen** outScreen) {
Expand Down
2 changes: 1 addition & 1 deletion widget/Screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Screen final : public nsIScreen {
mozilla::dom::ScreenDetails ToScreenDetails();

private:
virtual ~Screen() {}
virtual ~Screen() = default;

LayoutDeviceIntRect mRect;
LayoutDeviceIntRect mAvailRect;
Expand Down
4 changes: 2 additions & 2 deletions widget/ScreenManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ namespace mozilla::widget {

NS_IMPL_ISUPPORTS(ScreenManager, nsIScreenManager)

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

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

static StaticRefPtr<ScreenManager> sSingleton;

Expand Down
2 changes: 1 addition & 1 deletion widget/ScreenManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ScreenManager final : public nsIScreenManager {
public:
class Helper {
public:
virtual ~Helper() {}
virtual ~Helper() = default;
};

public:
Expand Down
2 changes: 1 addition & 1 deletion widget/TextEventDispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PuppetWidget;
*/

class TextEventDispatcher final {
~TextEventDispatcher() {}
~TextEventDispatcher() = default;

NS_INLINE_DECL_REFCOUNTING(TextEventDispatcher)

Expand Down
2 changes: 1 addition & 1 deletion widget/TextRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ struct TextRange {
class TextRangeArray final : public AutoTArray<TextRange, 10> {
friend class WidgetCompositionEvent;

~TextRangeArray() {}
~TextRangeArray() = default;

NS_INLINE_DECL_REFCOUNTING(TextRangeArray)

Expand Down
4 changes: 2 additions & 2 deletions widget/VsyncDispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class VsyncObserver {
virtual bool NotifyVsync(const VsyncEvent& aVsync) = 0;

protected:
VsyncObserver() {}
virtual ~VsyncObserver() {}
VsyncObserver() = default;
virtual ~VsyncObserver() = default;
}; // VsyncObserver

// Used to dispatch vsync events in the parent process to compositors.
Expand Down
2 changes: 1 addition & 1 deletion widget/WindowSurface.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace widget {
// A class for drawing to double-buffered windows.
class WindowSurface {
public:
virtual ~WindowSurface() {}
virtual ~WindowSurface() = default;

// Locks a region of the window for drawing, returning a draw target
// capturing the bounds of the provided region.
Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/CompositorWidgetChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CompositorWidgetChild::CompositorWidgetChild(
MOZ_ASSERT(!gfxPlatform::IsHeadless());
}

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

bool CompositorWidgetChild::Initialize() { return true; }

Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/CompositorWidgetParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CompositorWidgetParent::CompositorWidgetParent(
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_GPU);
}

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

void CompositorWidgetParent::ObserveVsync(VsyncObserver* aObserver) {
if (aObserver) {
Expand Down
4 changes: 2 additions & 2 deletions widget/gtk/IMContextWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class GetWritingModeName : public nsAutoCString {
}
AssignLiteral("Vertical (RTL)");
}
virtual ~GetWritingModeName() {}
virtual ~GetWritingModeName() = default;
};

class GetTextRangeStyleText final : public nsAutoCString {
Expand Down Expand Up @@ -201,7 +201,7 @@ class GetTextRangeStyleText final : public nsAutoCString {
AppendPrintf("{ R=0x%02X, G=0x%02X, B=0x%02X, A=0x%02X }", NS_GET_R(aColor),
NS_GET_G(aColor), NS_GET_B(aColor), NS_GET_A(aColor));
}
virtual ~GetTextRangeStyleText(){};
virtual ~GetTextRangeStyleText() = default;
};

const static bool kUseSimpleContextDefault = false;
Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/WindowSurfaceWayland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ WindowBackBufferDMABuf::WindowBackBufferDMABuf(
(void*)this, aWidth, aHeight));
}

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

already_AddRefed<gfx::DrawTarget> WindowBackBufferDMABuf::Lock() {
LOGWAYLAND(
Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/WindowSurfaceWayland.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class WindowBackBuffer {

WindowBackBuffer(WindowSurfaceWayland* aWindowSurfaceWayland)
: mWindowSurfaceWayland(aWindowSurfaceWayland){};
virtual ~WindowBackBuffer(){};
virtual ~WindowBackBuffer() = default;

protected:
WindowSurfaceWayland* mWindowSurfaceWayland;
Expand Down
4 changes: 2 additions & 2 deletions widget/gtk/nsApplicationChooser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ using namespace mozilla;

NS_IMPL_ISUPPORTS(nsApplicationChooser, nsIApplicationChooser)

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

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

NS_IMETHODIMP
nsApplicationChooser::Init(mozIDOMWindowProxy* aParent,
Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/nsBidiKeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ nsBidiKeyboard::Reset() {
return NS_OK;
}

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

NS_IMETHODIMP
nsBidiKeyboard::IsLangRTL(bool* aIsRTL) {
Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/nsClipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int GetGeckoClipboardType(GtkClipboard* aGtkClipboard) {
return -1; // THAT AIN'T NO CLIPBOARD I EVER HEARD OF
}

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

nsClipboard::~nsClipboard() {
// We have to clear clipboard before gdk_display_close() call.
Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/nsClipboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class nsRetrievalContext {

virtual bool HasSelectionSupport(void) = 0;

virtual ~nsRetrievalContext(){};
virtual ~nsRetrievalContext() = default;
};

class nsClipboard : public nsIClipboard, public nsIObserver {
Expand Down
4 changes: 2 additions & 2 deletions widget/gtk/nsClipboardWayland.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DataOffer {
char* GetData(wl_display* aDisplay, const char* aMimeType,
uint32_t* aContentLength);

virtual ~DataOffer(){};
virtual ~DataOffer() = default;

private:
virtual bool RequestDataTransfer(const char* aMimeType, int fd) = 0;
Expand Down Expand Up @@ -98,7 +98,7 @@ class nsWaylandDragContext : public nsISupports {
char* GetData(const char* aMimeType, uint32_t* aContentLength);

private:
virtual ~nsWaylandDragContext(){};
virtual ~nsWaylandDragContext() = default;

nsAutoPtr<WaylandDataOffer> mDataOffer;
wl_display* mDisplay;
Expand Down
4 changes: 2 additions & 2 deletions widget/gtk/nsColorPicker.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ class nsColorPicker final : public nsIColorPicker {
NS_DECL_ISUPPORTS
NS_DECL_NSICOLORPICKER

nsColorPicker(){};
nsColorPicker() = default;

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

static nsString ToHexString(int n);

Expand Down
4 changes: 2 additions & 2 deletions widget/gtk/nsDeviceContextSpecG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class GlobalPrinters {
void GetDefaultPrinterName(nsAString& aDefaultPrinterName);

protected:
GlobalPrinters() {}
GlobalPrinters() = default;

static GlobalPrinters mGlobalPrinters;
static nsTArray<nsString>* mGlobalPrinterList;
Expand Down Expand Up @@ -370,7 +370,7 @@ NS_IMETHODIMP nsDeviceContextSpecGTK::EndDocument() {
}

// Printer Enumerator
nsPrinterEnumeratorGTK::nsPrinterEnumeratorGTK() {}
nsPrinterEnumeratorGTK::nsPrinterEnumeratorGTK() = default;

NS_IMPL_ISUPPORTS(nsPrinterEnumeratorGTK, nsIPrinterEnumerator)

Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/nsDeviceContextSpecG.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class nsDeviceContextSpecGTK : public nsIDeviceContextSpec {
// Printer Enumerator
//-------------------------------------------------------------------------
class nsPrinterEnumeratorGTK final : public nsIPrinterEnumerator {
~nsPrinterEnumeratorGTK() {}
~nsPrinterEnumeratorGTK() = default;

public:
nsPrinterEnumeratorGTK();
Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/nsFilePicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ nsFilePicker::nsFilePicker()
giovfs->ShouldUseFlatpakPortal(&mUseNativeFileChooser);
}

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

void ReadMultipleFiles(gpointer filename, gpointer array) {
nsCOMPtr<nsIFile> localfile;
Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/nsImageToPixbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class nsImageToPixbuf final : public nsIImageToPixbuf {
int32_t aWidth, int32_t aHeight);

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

// fc2389b8-c650-4093-9e42-b05e5f0685b7
Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/nsLookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extern mozilla::LazyLogModule gWidgetLog;

nsLookAndFeel::nsLookAndFeel() = default;

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

// Modifies color |*aDest| as if a pattern of color |aSource| was painted with
// CAIRO_OPERATOR_OVER to a surface with color |*aDest|.
Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/nsNativeThemeGTK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ nsNativeThemeGTK::nsNativeThemeGTK() {
ThemeChanged();
}

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

NS_IMETHODIMP
nsNativeThemeGTK::Observe(nsISupports* aSubject, const char* aTopic,
Expand Down
4 changes: 2 additions & 2 deletions widget/gtk/nsPrintDialogGTK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,9 @@ GtkWidget* nsPrintDialogWidgetGTK::ConstructHeaderFooterDropdown(

NS_IMPL_ISUPPORTS(nsPrintDialogServiceGTK, nsIPrintDialogService)

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

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

NS_IMETHODIMP
nsPrintDialogServiceGTK::Init() { return NS_OK; }
Expand Down
Loading

0 comments on commit cb0734d

Please sign in to comment.