Skip to content

Commit

Permalink
Bug 1118803 - Mark virtual overridden functions as MOZ_OVERRIDE in mi…
Browse files Browse the repository at this point in the history
…sc DOM code; r=baku
  • Loading branch information
ehsan committed Jan 8, 2015
1 parent 373349f commit 1889255
Show file tree
Hide file tree
Showing 21 changed files with 56 additions and 52 deletions.
4 changes: 2 additions & 2 deletions dom/alarm/AlarmHalService.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class AlarmHalService : public nsIAlarmHalService,
static already_AddRefed<AlarmHalService> GetInstance();

// Implementing hal::AlarmObserver
void Notify(const void_t& aVoid);
void Notify(const void_t& aVoid) MOZ_OVERRIDE;

// Implementing hal::SystemTimezoneChangeObserver
void Notify(const hal::SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo);
void Notify(const hal::SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo) MOZ_OVERRIDE;

private:
virtual ~AlarmHalService();
Expand Down
2 changes: 1 addition & 1 deletion dom/battery/BatteryManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class BatteryManager : public DOMEventTargetHelper
void Shutdown();

// For IObserver.
void Notify(const hal::BatteryInformation& aBatteryInfo);
void Notify(const hal::BatteryInformation& aBatteryInfo) MOZ_OVERRIDE;

/**
* WebIDL Interface
Expand Down
18 changes: 9 additions & 9 deletions dom/camera/FallbackCameraControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ class FallbackCameraControl : public CameraControlImpl
protected:
~FallbackCameraControl();

virtual nsresult StartPreviewImpl() { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult StopPreviewImpl() { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult AutoFocusImpl() { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult StartFaceDetectionImpl() { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult StopFaceDetectionImpl() { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult TakePictureImpl() { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult StartPreviewImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult StopPreviewImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult AutoFocusImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult StartFaceDetectionImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult StopFaceDetectionImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult TakePictureImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult StartRecordingImpl(DeviceStorageFileDescriptor* aFileDescriptor,
const StartRecordingOptions* aOptions = nullptr) MOZ_OVERRIDE
{ return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult StopRecordingImpl() { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult PushParametersImpl() { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult PullParametersImpl() { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult StopRecordingImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult PushParametersImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult PullParametersImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }

private:
FallbackCameraControl(const FallbackCameraControl&) MOZ_DELETE;
Expand Down
4 changes: 2 additions & 2 deletions dom/cellbroadcast/ipc/CellBroadcastParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ class CellBroadcastParent MOZ_FINAL : public PCellBroadcastParent
// MOZ_FINAL suppresses -Werror,-Wdelete-non-virtual-dtor
~CellBroadcastParent() {};

virtual void ActorDestroy(ActorDestroyReason aWhy);
virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
};

} // namespace cellbroadcast
} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_cellbroadcast_CellBroadcastParent_h
#endif // mozilla_dom_cellbroadcast_CellBroadcastParent_h
2 changes: 1 addition & 1 deletion dom/crypto/CryptoKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class CryptoKey MOZ_FINAL : public nsISupports,
SECKEYPublicKey* GetPublicKey() const;

// For nsNSSShutDownObject
virtual void virtualDestroyNSSReference();
virtual void virtualDestroyNSSReference() MOZ_OVERRIDE;
void destructorSafeDestroyNSSReference();

// Serialization and deserialization convenience methods
Expand Down
12 changes: 8 additions & 4 deletions dom/crypto/WebCryptoTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2104,12 +2104,14 @@ class GenerateSymmetricKeyTask : public WebCryptoTask
return NS_OK;
}

virtual void Resolve() {
virtual void Resolve() MOZ_OVERRIDE
{
mKey->SetSymKey(mKeyData);
mResultPromise->MaybeResolve(mKey);
}

virtual void Cleanup() {
virtual void Cleanup() MOZ_OVERRIDE
{
mKey = nullptr;
}
};
Expand Down Expand Up @@ -2744,7 +2746,8 @@ class WrapKeyTask : public ExportKeyTask
return NS_OK;
}

virtual void Resolve() MOZ_OVERRIDE {
virtual void Resolve() MOZ_OVERRIDE
{
mTask->SetData(mResult);
mTask->DispatchWithPromise(mResultPromise);
mResolved = true;
Expand Down Expand Up @@ -2777,7 +2780,8 @@ class UnwrapKeyTask : public KeyEncryptTask
nsRefPtr<ImportKeyTask> mTask;
bool mResolved;

virtual void Resolve() MOZ_OVERRIDE {
virtual void Resolve() MOZ_OVERRIDE
{
mTask->SetKeyData(KeyEncryptTask::mResult);
mTask->DispatchWithPromise(KeyEncryptTask::mResultPromise);
mResolved = true;
Expand Down
20 changes: 10 additions & 10 deletions dom/devicestorage/nsDeviceStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2202,21 +2202,21 @@ nsDOMDeviceStorageCursor::GetTypes(nsIArray** aTypes)
}

NS_IMETHODIMP
nsDOMDeviceStorageCursor::GetPrincipal(nsIPrincipal * *aRequestingPrincipal)
nsDOMDeviceStorageCursor::GetPrincipal(nsIPrincipal** aRequestingPrincipal)
{
NS_IF_ADDREF(*aRequestingPrincipal = mPrincipal);
return NS_OK;
}

NS_IMETHODIMP
nsDOMDeviceStorageCursor::GetWindow(nsIDOMWindow * *aRequestingWindow)
nsDOMDeviceStorageCursor::GetWindow(nsIDOMWindow** aRequestingWindow)
{
NS_IF_ADDREF(*aRequestingWindow = GetOwner());
return NS_OK;
}

NS_IMETHODIMP
nsDOMDeviceStorageCursor::GetElement(nsIDOMElement * *aRequestingElement)
nsDOMDeviceStorageCursor::GetElement(nsIDOMElement** aRequestingElement)
{
*aRequestingElement = nullptr;
return NS_OK;
Expand Down Expand Up @@ -2900,7 +2900,7 @@ class DeviceStorageRequest MOZ_FINAL
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(DeviceStorageRequest,
nsIContentPermissionRequest)

NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
MOZ_ASSERT(NS_IsMainThread());

Expand All @@ -2912,7 +2912,7 @@ class DeviceStorageRequest MOZ_FINAL
return nsContentPermissionUtils::AskPermission(this, mWindow);
}

NS_IMETHODIMP GetTypes(nsIArray** aTypes)
NS_IMETHODIMP GetTypes(nsIArray** aTypes) MOZ_OVERRIDE
{
nsCString type;
nsresult rv =
Expand All @@ -2932,33 +2932,33 @@ class DeviceStorageRequest MOZ_FINAL
return nsContentPermissionUtils::CreatePermissionArray(type, access, emptyOptions, aTypes);
}

NS_IMETHOD GetPrincipal(nsIPrincipal * *aRequestingPrincipal)
NS_IMETHOD GetPrincipal(nsIPrincipal * *aRequestingPrincipal) MOZ_OVERRIDE
{
NS_IF_ADDREF(*aRequestingPrincipal = mPrincipal);
return NS_OK;
}

NS_IMETHOD GetWindow(nsIDOMWindow * *aRequestingWindow)
NS_IMETHOD GetWindow(nsIDOMWindow * *aRequestingWindow) MOZ_OVERRIDE
{
NS_IF_ADDREF(*aRequestingWindow = mWindow);
return NS_OK;
}

NS_IMETHOD GetElement(nsIDOMElement * *aRequestingElement)
NS_IMETHOD GetElement(nsIDOMElement * *aRequestingElement) MOZ_OVERRIDE
{
*aRequestingElement = nullptr;
return NS_OK;
}

NS_IMETHOD Cancel()
NS_IMETHOD Cancel() MOZ_OVERRIDE
{
nsCOMPtr<nsIRunnable> event
= new PostErrorEvent(mRequest.forget(),
POST_ERROR_EVENT_PERMISSION_DENIED);
return NS_DispatchToMainThread(event);
}

NS_IMETHOD Allow(JS::HandleValue aChoices)
NS_IMETHOD Allow(JS::HandleValue aChoices) MOZ_OVERRIDE
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aChoices.isUndefined());
Expand Down
4 changes: 2 additions & 2 deletions dom/geolocation/nsGeolocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class GeolocationSettingsCallback : public nsISettingsServiceCallback
MOZ_COUNT_CTOR(GeolocationSettingsCallback);
}

NS_IMETHOD Handle(const nsAString& aName, JS::Handle<JS::Value> aResult)
NS_IMETHOD Handle(const nsAString& aName, JS::Handle<JS::Value> aResult) MOZ_OVERRIDE
{
MOZ_ASSERT(NS_IsMainThread());

Expand All @@ -159,7 +159,7 @@ class GeolocationSettingsCallback : public nsISettingsServiceCallback
return NS_OK;
}

NS_IMETHOD HandleError(const nsAString& aName)
NS_IMETHOD HandleError(const nsAString& aName) MOZ_OVERRIDE
{
if (aName.EqualsASCII(GEO_SETTINGS_ENABLED)) {
GPSLOG("Unable to get value for '" GEO_SETTINGS_ENABLED "'");
Expand Down
2 changes: 1 addition & 1 deletion dom/indexedDB/ActorsParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5210,7 +5210,7 @@ class QuotaClient MOZ_FINAL
void
NoteBackgroundThread(nsIEventTarget* aBackgroundThread);

NS_INLINE_DECL_REFCOUNTING(QuotaClient)
NS_INLINE_DECL_REFCOUNTING(QuotaClient, MOZ_OVERRIDE)

virtual mozilla::dom::quota::Client::Type
GetType() MOZ_OVERRIDE;
Expand Down
4 changes: 2 additions & 2 deletions dom/mobileconnection/ipc/MobileConnectionParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MobileConnectionParent : public PMobileConnectionParent
}

virtual void
ActorDestroy(ActorDestroyReason why);
ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;

virtual bool
RecvPMobileConnectionRequestConstructor(PMobileConnectionRequestParent* aActor,
Expand Down Expand Up @@ -152,7 +152,7 @@ class MobileConnectionRequestParent : public PMobileConnectionRequestParent
}

virtual void
ActorDestroy(ActorDestroyReason why);
ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;

nsresult
SendReply(const MobileConnectionReply& aReply);
Expand Down
2 changes: 1 addition & 1 deletion dom/mobilemessage/ipc/SmsParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SmsParent : public PSmsParent
}

virtual void
ActorDestroy(ActorDestroyReason why);
ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;

virtual bool
RecvPSmsRequestConstructor(PSmsRequestParent* aActor,
Expand Down
2 changes: 1 addition & 1 deletion dom/network/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Connection MOZ_FINAL : public DOMEventTargetHelper
void Shutdown();

// For IObserver
void Notify(const hal::NetworkInformation& aNetworkInfo);
void Notify(const hal::NetworkInformation& aNetworkInfo) MOZ_OVERRIDE;

// WebIDL

Expand Down
2 changes: 1 addition & 1 deletion dom/network/TCPSocketParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class TCPSocketParent : public mozilla::net::PTCPSocketParent
TCPSocketParent() {}

virtual bool RecvOpen(const nsString& aHost, const uint16_t& aPort,
const bool& useSSL, const nsString& aBinaryType);
const bool& useSSL, const nsString& aBinaryType) MOZ_OVERRIDE;

virtual bool RecvStartTLS() MOZ_OVERRIDE;
virtual bool RecvSuspend() MOZ_OVERRIDE;
Expand Down
6 changes: 3 additions & 3 deletions dom/notification/DesktopNotification.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ class AlertServiceObserver: public nsIObserver
void Disconnect() { mNotification = nullptr; }

NS_IMETHODIMP
Observe(nsISupports *aSubject,
const char *aTopic,
const char16_t *aData)
Observe(nsISupports* aSubject,
const char* aTopic,
const char16_t* aData) MOZ_OVERRIDE
{

// forward to parent
Expand Down
4 changes: 2 additions & 2 deletions dom/notification/Notification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class NotificationStorageCallback MOZ_FINAL : public nsINotificationStorageCallb
const nsAString& aIcon,
const nsAString& aData,
const nsAString& aBehavior,
JSContext* aCx)
JSContext* aCx) MOZ_OVERRIDE
{
MOZ_ASSERT(!aID.IsEmpty());

Expand Down Expand Up @@ -99,7 +99,7 @@ class NotificationStorageCallback MOZ_FINAL : public nsINotificationStorageCallb
return NS_OK;
}

NS_IMETHOD Done(JSContext* aCx)
NS_IMETHOD Done(JSContext* aCx) MOZ_OVERRIDE
{
JSAutoCompartment ac(aCx, mGlobal);
JS::Rooted<JS::Value> result(aCx, JS::ObjectValue(*mNotifications));
Expand Down
2 changes: 1 addition & 1 deletion dom/power/PowerManagerService.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class PowerManagerService
void Init();

// Implement WakeLockObserver
void Notify(const hal::WakeLockInformation& aWakeLockInfo);
void Notify(const hal::WakeLockInformation& aWakeLockInfo) MOZ_OVERRIDE;

/**
* Acquire a wake lock on behalf of a given process (aContentParent).
Expand Down
6 changes: 3 additions & 3 deletions dom/quota/QuotaManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class OriginClearRunnable MOZ_FINAL : public nsRunnable
{ }

NS_IMETHOD
Run();
Run() MOZ_OVERRIDE;

void
AdvanceState()
Expand Down Expand Up @@ -299,7 +299,7 @@ class AsyncUsageRunnable MOZ_FINAL : public UsageInfo,
nsIUsageCallback* aCallback);

NS_IMETHOD
Run();
Run() MOZ_OVERRIDE;

void
AdvanceState()
Expand Down Expand Up @@ -369,7 +369,7 @@ class ResetOrClearRunnable MOZ_FINAL : public nsRunnable
{ }

NS_IMETHOD
Run();
Run() MOZ_OVERRIDE;

void
AdvanceState()
Expand Down
2 changes: 1 addition & 1 deletion dom/system/nsDeviceSensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class nsDeviceSensors : public nsIDeviceSensors, public mozilla::hal::ISensorObs

nsDeviceSensors();

void Notify(const mozilla::hal::SensorData& aSensorData);
void Notify(const mozilla::hal::SensorData& aSensorData) MOZ_OVERRIDE;

private:
virtual ~nsDeviceSensors();
Expand Down
4 changes: 2 additions & 2 deletions dom/telephony/ipc/TelephonyParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class TelephonyParent : public PTelephonyParent
virtual ~TelephonyParent() {}

virtual void
ActorDestroy(ActorDestroyReason why);
ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;

virtual bool
RecvPTelephonyRequestConstructor(PTelephonyRequestParent* aActor, const IPCTelephonyRequest& aRequest) MOZ_OVERRIDE;
Expand Down Expand Up @@ -98,7 +98,7 @@ class TelephonyRequestParent : public PTelephonyRequestParent
virtual ~TelephonyRequestParent() {}

virtual void
ActorDestroy(ActorDestroyReason why);
ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;

nsresult
SendResponse(const IPCTelephonyResponse& aResponse);
Expand Down
2 changes: 1 addition & 1 deletion dom/time/TimeManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TimeManager MOZ_FINAL : public nsISupports
{
return mWindow;
}
JSObject* WrapObject(JSContext* aCx);
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;

void Set(Date& aDate);
void Set(double aTime);
Expand Down
4 changes: 2 additions & 2 deletions dom/tv/FakeTVService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class EITBroadcastedCallback MOZ_FINAL : public nsITimerCallback
{}

NS_IMETHODIMP
Notify(nsITimer* aTimer)
Notify(nsITimer* aTimer) MOZ_OVERRIDE
{
// Notify mock EIT broadcasting.
nsITVProgramData** programDataList =
Expand Down Expand Up @@ -242,7 +242,7 @@ class ScanCompleteCallback MOZ_FINAL : public nsITimerCallback
{}

NS_IMETHODIMP
Notify(nsITimer* aTimer)
Notify(nsITimer* aTimer) MOZ_OVERRIDE
{
return mSourceListener->NotifyChannelScanComplete(mTunerId, mSourceType);
}
Expand Down

0 comments on commit 1889255

Please sign in to comment.