Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1117044 - Mark virtual overridden functions as MOZ_OVERRIDE in wi…
Browse files Browse the repository at this point in the history
…dget; r=roc
  • Loading branch information
ehsan committed Jan 2, 2015
1 parent 75e35de commit 8a9e51d
Show file tree
Hide file tree
Showing 24 changed files with 323 additions and 324 deletions.
2 changes: 1 addition & 1 deletion widget/GfxInfoBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ShutdownObserver : public nsIObserver
NS_DECL_ISUPPORTS

NS_IMETHOD Observe(nsISupports *subject, const char *aTopic,
const char16_t *aData)
const char16_t *aData) MOZ_OVERRIDE
{
MOZ_ASSERT(strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0);

Expand Down
14 changes: 7 additions & 7 deletions widget/GfxInfoBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ class GfxInfoBase : public nsIGfxInfo,
// using GfxInfoBase::GetFeatureSuggestedDriverVersion;
// using GfxInfoBase::GetWebGLParameter;
// to import the relevant methods into their namespace.
NS_IMETHOD GetFeatureStatus(int32_t aFeature, int32_t *_retval);
NS_IMETHOD GetFeatureSuggestedDriverVersion(int32_t aFeature, nsAString & _retval);
NS_IMETHOD GetWebGLParameter(const nsAString & aParam, nsAString & _retval);
NS_IMETHOD GetFeatureStatus(int32_t aFeature, int32_t *_retval) MOZ_OVERRIDE;
NS_IMETHOD GetFeatureSuggestedDriverVersion(int32_t aFeature, nsAString & _retval) MOZ_OVERRIDE;
NS_IMETHOD GetWebGLParameter(const nsAString & aParam, nsAString & _retval) MOZ_OVERRIDE;

NS_IMETHOD GetFailures(uint32_t *failureCount, char ***failures);
NS_IMETHOD_(void) LogFailure(const nsACString &failure);
NS_IMETHOD GetInfo(JSContext*, JS::MutableHandle<JS::Value>);
NS_IMETHOD GetFailures(uint32_t *failureCount, char ***failures) MOZ_OVERRIDE;
NS_IMETHOD_(void) LogFailure(const nsACString &failure) MOZ_OVERRIDE;
NS_IMETHOD GetInfo(JSContext*, JS::MutableHandle<JS::Value>) MOZ_OVERRIDE;

// Initialization function. If you override this, you must call this class's
// version of Init first.
Expand All @@ -68,7 +68,7 @@ class GfxInfoBase : public nsIGfxInfo,
virtual nsresult Init();

// only useful on X11
NS_IMETHOD_(void) GetData() { }
NS_IMETHOD_(void) GetData() MOZ_OVERRIDE { }

static void AddCollector(GfxInfoCollectorBase* collector);
static void RemoveCollector(GfxInfoCollectorBase* collector);
Expand Down
54 changes: 27 additions & 27 deletions widget/PuppetWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,55 +60,55 @@ class PuppetWidget : public nsBaseWidget,
nsNativeWidget aNativeParent,
const nsIntRect& aRect,
nsDeviceContext* aContext,
nsWidgetInitData* aInitData = nullptr);
nsWidgetInitData* aInitData = nullptr) MOZ_OVERRIDE;

void InitIMEState();

virtual already_AddRefed<nsIWidget>
CreateChild(const nsIntRect &aRect,
nsDeviceContext *aContext,
nsWidgetInitData *aInitData = nullptr,
bool aForceUseIWidgetParent = false);
bool aForceUseIWidgetParent = false) MOZ_OVERRIDE;

NS_IMETHOD Destroy();
NS_IMETHOD Destroy() MOZ_OVERRIDE;

NS_IMETHOD Show(bool aState);
NS_IMETHOD Show(bool aState) MOZ_OVERRIDE;

virtual bool IsVisible() const
virtual bool IsVisible() const MOZ_OVERRIDE
{ return mVisible; }

NS_IMETHOD ConstrainPosition(bool /*ignored aAllowSlop*/,
int32_t* aX,
int32_t* aY)
int32_t* aY) MOZ_OVERRIDE
{ *aX = kMaxDimension; *aY = kMaxDimension; return NS_OK; }

// We're always at <0, 0>, and so ignore move requests.
NS_IMETHOD Move(double aX, double aY)
NS_IMETHOD Move(double aX, double aY) MOZ_OVERRIDE
{ return NS_OK; }

NS_IMETHOD Resize(double aWidth,
double aHeight,
bool aRepaint);
bool aRepaint) MOZ_OVERRIDE;
NS_IMETHOD Resize(double aX,
double aY,
double aWidth,
double aHeight,
bool aRepaint)
bool aRepaint) MOZ_OVERRIDE
// (we're always at <0, 0>)
{ return Resize(aWidth, aHeight, aRepaint); }

// XXX/cjones: copying gtk behavior here; unclear what disabling a
// widget is supposed to entail
NS_IMETHOD Enable(bool aState)
NS_IMETHOD Enable(bool aState) MOZ_OVERRIDE
{ mEnabled = aState; return NS_OK; }
virtual bool IsEnabled() const
virtual bool IsEnabled() const MOZ_OVERRIDE
{ return mEnabled; }

NS_IMETHOD SetFocus(bool aRaise = false);
NS_IMETHOD SetFocus(bool aRaise = false) MOZ_OVERRIDE;

virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations);
virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations) MOZ_OVERRIDE;

NS_IMETHOD Invalidate(const nsIntRect& aRect);
NS_IMETHOD Invalidate(const nsIntRect& aRect) MOZ_OVERRIDE;

// This API is going away, steer clear.
virtual void Scroll(const nsIntPoint& aDelta,
Expand All @@ -117,24 +117,24 @@ class PuppetWidget : public nsBaseWidget,
{ /* dead man walking */ }

// PuppetWidgets don't have native data, as they're purely nonnative.
virtual void* GetNativeData(uint32_t aDataType);
NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent)
virtual void* GetNativeData(uint32_t aDataType) MOZ_OVERRIDE;
NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent) MOZ_OVERRIDE
{ return NS_ERROR_UNEXPECTED; }

// PuppetWidgets don't have any concept of titles.
NS_IMETHOD SetTitle(const nsAString& aTitle)
NS_IMETHOD SetTitle(const nsAString& aTitle) MOZ_OVERRIDE
{ return NS_ERROR_UNEXPECTED; }

// PuppetWidgets are always at <0, 0>.
virtual nsIntPoint WidgetToScreenOffset()
virtual nsIntPoint WidgetToScreenOffset() MOZ_OVERRIDE
{ return nsIntPoint(0, 0); }

void InitEvent(WidgetGUIEvent& aEvent, nsIntPoint* aPoint = nullptr);

NS_IMETHOD DispatchEvent(WidgetGUIEvent* aEvent, nsEventStatus& aStatus);
NS_IMETHOD DispatchEvent(WidgetGUIEvent* aEvent, nsEventStatus& aStatus) MOZ_OVERRIDE;

NS_IMETHOD CaptureRollupEvents(nsIRollupListener* aListener,
bool aDoCapture)
bool aDoCapture) MOZ_OVERRIDE
{ return NS_ERROR_UNEXPECTED; }

NS_IMETHOD_(bool)
Expand Down Expand Up @@ -162,17 +162,17 @@ class PuppetWidget : public nsBaseWidget,
GetLayerManager(PLayerTransactionChild* aShadowManager = nullptr,
LayersBackend aBackendHint = mozilla::layers::LayersBackend::LAYERS_NONE,
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
bool* aAllowRetaining = nullptr);
bool* aAllowRetaining = nullptr) MOZ_OVERRIDE;

NS_IMETHOD NotifyIME(const IMENotification& aIMENotification) MOZ_OVERRIDE;
NS_IMETHOD_(void) SetInputContext(const InputContext& aContext,
const InputContextAction& aAction);
NS_IMETHOD_(InputContext) GetInputContext();
const InputContextAction& aAction) MOZ_OVERRIDE;
NS_IMETHOD_(InputContext) GetInputContext() MOZ_OVERRIDE;
virtual nsIMEUpdatePreference GetIMEUpdatePreference() MOZ_OVERRIDE;

NS_IMETHOD SetCursor(nsCursor aCursor);
NS_IMETHOD SetCursor(nsCursor aCursor) MOZ_OVERRIDE;
NS_IMETHOD SetCursor(imgIContainer* aCursor,
uint32_t aHotspotX, uint32_t aHotspotY)
uint32_t aHotspotX, uint32_t aHotspotY) MOZ_OVERRIDE
{
return nsBaseWidget::SetCursor(aCursor, aHotspotX, aHotspotY);
}
Expand All @@ -181,8 +181,8 @@ class PuppetWidget : public nsBaseWidget,
// Contacts the parent process which gets the DPI from the
// proper widget there. TODO: Handle DPI changes that happen
// later on.
virtual float GetDPI();
virtual double GetDefaultScaleInternal();
virtual float GetDPI() MOZ_OVERRIDE;
virtual double GetDefaultScaleInternal() MOZ_OVERRIDE;

virtual bool NeedsPaint() MOZ_OVERRIDE;

Expand Down
48 changes: 24 additions & 24 deletions widget/cocoa/GfxInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,33 @@ class GfxInfo : public GfxInfoBase
GfxInfo();
// We only declare the subset of nsIGfxInfo that we actually implement. The
// rest is brought forward from GfxInfoBase.
NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled);
NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled);
NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion);
NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver);
NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID);
NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID);
NS_IMETHOD GetAdapterSubsysID(nsAString & aAdapterSubsysID);
NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription);
NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID);
NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID);
NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID);
NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);
NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active);
NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled) MOZ_OVERRIDE;
NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled) MOZ_OVERRIDE;
NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion) MOZ_OVERRIDE;
NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterSubsysID(nsAString & aAdapterSubsysID) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate) MOZ_OVERRIDE;
NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) MOZ_OVERRIDE;

using GfxInfoBase::GetFeatureStatus;
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
using GfxInfoBase::GetWebGLParameter;

virtual nsresult Init();
virtual nsresult Init() MOZ_OVERRIDE;

NS_DECL_ISUPPORTS_INHERITED
#ifdef DEBUG
Expand All @@ -67,8 +67,8 @@ class GfxInfo : public GfxInfoBase
int32_t *aStatus,
nsAString & aSuggestedDriverVersion,
const nsTArray<GfxDriverInfo>& aDriverInfo,
OperatingSystem* aOS = nullptr);
virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo();
OperatingSystem* aOS = nullptr) MOZ_OVERRIDE;
virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo() MOZ_OVERRIDE;

private:

Expand Down
2 changes: 1 addition & 1 deletion widget/cocoa/nsAppShell.mm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

IOPMAssertionID mAssertionID = kIOPMNullAssertionID;

NS_IMETHOD Callback(const nsAString& aTopic, const nsAString& aState) {
NS_IMETHOD Callback(const nsAString& aTopic, const nsAString& aState) MOZ_OVERRIDE {
if (!aTopic.EqualsASCII("screen")) {
return NS_OK;
}
Expand Down
6 changes: 3 additions & 3 deletions widget/cocoa/nsChangeObserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class nsIDocument;
class nsIAtom;

#define NS_DECL_CHANGEOBSERVER \
void ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aContent, nsIAtom *aAttribute); \
void ObserveContentRemoved(nsIDocument *aDocument, nsIContent *aChild, int32_t aIndexInContainer); \
void ObserveContentInserted(nsIDocument *aDocument, nsIContent* aContainer, nsIContent *aChild);
void ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aContent, nsIAtom *aAttribute) MOZ_OVERRIDE; \
void ObserveContentRemoved(nsIDocument *aDocument, nsIContent *aChild, int32_t aIndexInContainer) MOZ_OVERRIDE; \
void ObserveContentInserted(nsIDocument *aDocument, nsIContent* aContainer, nsIContent *aChild) MOZ_OVERRIDE;

// Something that wants to be alerted to changes in attributes or changes in
// its corresponding content object.
Expand Down
Loading

0 comments on commit 8a9e51d

Please sign in to comment.