Bug 1436263 - Part 4: Remove unnecessary `virtual` and `final` from non-overriding final virtual function declarations. r=froydnj draft
authorChris Peterson <cpeterson@mozilla.com>
Fri, 09 Feb 2018 01:31:38 -0800
changeset 755380 b350ac0a209bf590ec106e066b4dee92877554a5
parent 755379 f8773899283407f394664ef2b7db71368d6ad847
child 755381 ceba0a15844b0e24220e9b3396dafd43b1f48cd5
child 755993 4c2d2210ce45faa0e84663e3b5a12faf04a81ce4
push id99163
push usercpeterson@mozilla.com
push dateThu, 15 Feb 2018 08:52:54 +0000
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
   explicit AccessibleNode(nsINode* aNode);
   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);
   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
   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;