Bug 1639392 - Make some nsStyleLinkElement methods final. r=jwatt
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 20 May 2020 17:35:25 +0000
changeset 531369 752b994bf915983c4b19e33e00dcc637a2add9b9
parent 531368 e7cd443a6591450329d6b695bb65f34b6761cc7d
child 531370 edaed71901bd5af9a518c02575b205e276a62153
push id37438
push userabutkovits@mozilla.com
push dateThu, 21 May 2020 09:36:57 +0000
treeherdermozilla-central@2d00a1a6495c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs1639392
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1639392 - Make some nsStyleLinkElement methods final. r=jwatt Depends on D76068 Differential Revision: https://phabricator.services.mozilla.com/D76069
dom/base/nsStyleLinkElement.h
--- a/dom/base/nsStyleLinkElement.h
+++ b/dom/base/nsStyleLinkElement.h
@@ -27,38 +27,40 @@ namespace mozilla {
 class CSSStyleSheet;
 namespace dom {
 class Document;
 class ShadowRoot;
 }  // namespace dom
 }  // namespace mozilla
 
 class nsStyleLinkElement : public nsIStyleSheetLinkingElement {
+  template <typename V, typename E>
+  using Result = mozilla::Result<V, E>;
+
  public:
   nsStyleLinkElement();
   virtual ~nsStyleLinkElement();
 
   NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override = 0;
 
   mozilla::StyleSheet* GetSheet() const { return mStyleSheet; }
 
   // nsIStyleSheetLinkingElement
-  void SetStyleSheet(mozilla::StyleSheet* aStyleSheet) override;
+  void SetStyleSheet(mozilla::StyleSheet* aStyleSheet) final;
 
-  mozilla::Result<Update, nsresult> UpdateStyleSheet(
-      nsICSSLoaderObserver*) override;
+  Result<Update, nsresult> UpdateStyleSheet(nsICSSLoaderObserver*) final;
 
-  void SetEnableUpdates(bool aEnableUpdates) override;
+  void SetEnableUpdates(bool aEnableUpdates) final;
   void GetCharset(nsAString& aCharset) override;
 
   void OverrideBaseURI(nsIURI* aNewBaseURI) override;
-  void SetLineNumber(uint32_t aLineNumber) override;
-  uint32_t GetLineNumber() override;
-  void SetColumnNumber(uint32_t aColumnNumber) override;
-  uint32_t GetColumnNumber() override;
+  void SetLineNumber(uint32_t aLineNumber) final;
+  uint32_t GetLineNumber() final;
+  void SetColumnNumber(uint32_t aColumnNumber) final;
+  uint32_t GetColumnNumber() final;
 
   enum RelValue {
     ePREFETCH = 0x00000001,
     eDNS_PREFETCH = 0x00000002,
     eSTYLESHEET = 0x00000004,
     eNEXT = 0x00000008,
     eALTERNATE = 0x00000010,
     ePRECONNECT = 0x00000020,
@@ -81,17 +83,17 @@ class nsStyleLinkElement : public nsISty
    *                       removed the node from a shadow tree.
    * @param aForceUpdate true will force the update even if the URI has not
    *                     changed.  This should be used in cases when something
    *                     about the content that affects the resulting sheet
    *                     changed but the URI may not have changed.
    *
    * TODO(emilio): Should probably pass a single DocumentOrShadowRoot.
    */
-  mozilla::Result<Update, nsresult> UpdateStyleSheetInternal(
+  Result<Update, nsresult> UpdateStyleSheetInternal(
       mozilla::dom::Document* aOldDocument,
       mozilla::dom::ShadowRoot* aOldShadowRoot, ForceUpdate = ForceUpdate::No);
 
   // Gets a suitable title and media for SheetInfo out of an element, which
   // needs to be `this`.
   //
   // NOTE(emilio): Needs nsString instead of nsAString because of
   // CompressWhitespace.