Bug 1436263 - Part 4: Remove unnecessary `virtual` and `final` from non-overriding final virtual function declarations. r=froydnj
AccessibleNode::GetParentObject is a non-overriding final virtual function. GetParentObject is a common virtual function in many DOM classes, but AccessibleNode does not derive from any base classes that define virtual GetParentObject or have any derived classes of its own.
WebCryptoTask::CalculateResult and CallCallback are non-overriding final virtual functions that mirror virtual function names in the CryptoTask class, even though WebCryptoTask does not actually derive from CryptoTask.
nsWindowBase::GetWindowHandle is a non-overriding final virtual function. The only other function called GetWindowHandle is MouseScrollHandler::EventInfo::GetWindowHandle, which is not related to the nsWindowBase class.
MozReview-Commit-ID: 4ldSAyP3ZpP
--- a/accessible/aom/AccessibleNode.h
+++ b/accessible/aom/AccessibleNode.h
@@ -29,17 +29,17 @@ class AccessibleNode : public nsISupport
{
public:
explicit AccessibleNode(nsINode* aNode);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS;
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AccessibleNode);
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
- virtual dom::ParentObject GetParentObject() const final;
+ dom::ParentObject GetParentObject() const;
void GetRole(nsAString& aRole);
void GetStates(nsTArray<nsString>& aStates);
void GetAttributes(nsTArray<nsString>& aAttributes);
nsINode* GetDOMNode();
bool Is(const Sequence<nsString>& aFlavors);
bool Has(const Sequence<nsString>& aAttributes);
--- a/dom/crypto/WebCryptoTask.h
+++ b/dom/crypto/WebCryptoTask.h
@@ -174,19 +174,19 @@ protected:
virtual nsresult BeforeCrypto() { return NS_OK; }
virtual nsresult DoCrypto() { return NS_OK; }
virtual nsresult AfterCrypto() { return NS_OK; }
virtual void Resolve() {}
virtual void Cleanup() {}
void FailWithError(nsresult aRv);
- virtual nsresult CalculateResult() final;
+ nsresult CalculateResult();
- virtual void CallCallback(nsresult rv) final;
+ void CallCallback(nsresult rv);
private:
NS_IMETHOD Run() final;
nsresult Cancel() final;
class InternalWorkerHolder;
nsCOMPtr<nsISerialEventTarget> mOriginalEventTarget;
--- a/widget/windows/nsWindowBase.h
+++ b/widget/windows/nsWindowBase.h
@@ -20,17 +20,17 @@
class nsWindowBase : public nsBaseWidget
{
public:
typedef mozilla::WidgetEventTime WidgetEventTime;
/*
* Return the HWND or null for this widget.
*/
- virtual HWND GetWindowHandle() final {
+ HWND GetWindowHandle() {
return static_cast<HWND>(GetNativeData(NS_NATIVE_WINDOW));
}
/*
* Return the parent window, if it exists.
*/
virtual nsWindowBase* GetParentWindowBase(bool aIncludeOwner) = 0;