Bug 1325234 (part 3) - Streamline nsIWidget::Show(). r=mstange.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 21 Dec 2016 11:12:54 +1100
changeset 328501 b4181e317c8df04f18dd85eac8d8922b1d4e41f6
parent 328500 8da1583fcd48bc11ff425300a31ed220b96fb415
child 328502 445cae8045dec19f197ea08c80f6e4d17fc336d7
push id31175
push usercbook@mozilla.com
push dateMon, 09 Jan 2017 09:33:22 +0000
treeherdermozilla-central@701868bfddcb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1325234
milestone53.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 1325234 (part 3) - Streamline nsIWidget::Show(). r=mstange. This patch changes it from |NS_IMETHOD| to |virtual void|. The return value was only checked in one low-value assertion and one other place where the check had no useful effect (in nsCocoaWindow::HideWindowChrome()).
gfx/layers/ipc/CompositorBridgeChild.cpp
gfx/tests/gtest/TestCompositor.cpp
widget/PuppetWidget.cpp
widget/PuppetWidget.h
widget/android/nsWindow.cpp
widget/android/nsWindow.h
widget/cocoa/nsChildView.h
widget/cocoa/nsChildView.mm
widget/cocoa/nsCocoaWindow.h
widget/cocoa/nsCocoaWindow.mm
widget/gonk/nsWindow.cpp
widget/gonk/nsWindow.h
widget/gtk/nsWindow.cpp
widget/gtk/nsWindow.h
widget/nsIWidget.h
widget/uikit/nsWindow.h
widget/uikit/nsWindow.mm
widget/windows/nsWindow.cpp
widget/windows/nsWindow.h
--- a/gfx/layers/ipc/CompositorBridgeChild.cpp
+++ b/gfx/layers/ipc/CompositorBridgeChild.cpp
@@ -472,18 +472,17 @@ CompositorBridgeChild::RecvUpdatePluginC
         widget->Resize(aContentOffset.x + bounds.x,
                        aContentOffset.y + bounds.y,
                        bounds.width, bounds.height, true);
       }
 
       widget->Enable(isVisible);
 
       // visible state - updated after clipping, prior to invalidating
-      rv = widget->Show(isVisible);
-      NS_ASSERTION(NS_SUCCEEDED(rv), "widget call failure");
+      widget->Show(isVisible);
 
       // Handle invalidation, this can be costly, avoid if it is not needed.
       if (isVisible) {
         // invalidate region (widget origin)
 #if defined(XP_WIN)
         // Work around for flash's crummy sandbox. See bug 762948. This call
         // digs down into the window hirearchy, invalidating regions on
         // windows owned by other processes.
--- a/gfx/tests/gtest/TestCompositor.cpp
+++ b/gfx/tests/gtest/TestCompositor.cpp
@@ -61,17 +61,17 @@ public:
   virtual nsresult        Create(nsIWidget* aParent,
                                  nsNativeWidget aNativeParent,
                                  const LayoutDeviceIntRect& aRect,
                                  nsWidgetInitData* aInitData = nullptr) override { return NS_OK; }
   virtual nsresult        Create(nsIWidget* aParent,
                                  nsNativeWidget aNativeParent,
                                  const DesktopIntRect& aRect,
                                  nsWidgetInitData* aInitData = nullptr) override { return NS_OK; }
-  NS_IMETHOD              Show(bool aState) override { return NS_OK; }
+  virtual void            Show(bool aState) override {}
   virtual bool            IsVisible() const override { return true; }
   virtual void            Move(double aX, double aY) override {}
   virtual void            Resize(double aWidth, double aHeight, bool aRepaint) override {}
   virtual void            Resize(double aX, double aY,
                                  double aWidth, double aHeight, bool aRepaint) override {}
 
   virtual void            Enable(bool aState) override {}
   virtual bool            IsEnabled() const override { return true; }
--- a/widget/PuppetWidget.cpp
+++ b/widget/PuppetWidget.cpp
@@ -185,17 +185,17 @@ PuppetWidget::Destroy()
   mChild = nullptr;
   if (mLayerManager) {
     mLayerManager->Destroy();
   }
   mLayerManager = nullptr;
   mTabChild = nullptr;
 }
 
-NS_IMETHODIMP
+void
 PuppetWidget::Show(bool aState)
 {
   NS_ASSERTION(mEnabled,
                "does it make sense to Show()/Hide() a disabled widget?");
 
   bool wasVisible = mVisible;
   mVisible = aState;
 
@@ -211,18 +211,16 @@ PuppetWidget::Show(bool aState)
     // PuppetWidget was hidden, those layers are dropped,
     // so the previously attached widget listener is really
     // of no use anymore (and is actually actively harmful - see
     // bug 1323586).
     mPreviouslyAttachedWidgetListener = nullptr;
     Resize(mBounds.width, mBounds.height, false);
     Invalidate(mBounds);
   }
-
-  return NS_OK;
 }
 
 void
 PuppetWidget::Resize(double aWidth,
                      double aHeight,
                      bool   aRepaint)
 {
   LayoutDeviceIntRect oldBounds = mBounds;
--- a/widget/PuppetWidget.h
+++ b/widget/PuppetWidget.h
@@ -73,17 +73,17 @@ public:
 
   virtual already_AddRefed<nsIWidget>
   CreateChild(const LayoutDeviceIntRect& aRect,
               nsWidgetInitData* aInitData = nullptr,
               bool aForceUseIWidgetParent = false) override;
 
   virtual void Destroy() override;
 
-  NS_IMETHOD Show(bool aState) override;
+  virtual void Show(bool aState) override;
 
   virtual bool IsVisible() const override
   { return mVisible; }
 
   virtual void ConstrainPosition(bool     /*ignored aAllowSlop*/,
                                  int32_t* aX,
                                  int32_t* aY) override
   { *aX = kMaxDimension; *aY = kMaxDimension; }
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1672,28 +1672,28 @@ nsWindow::GetDefaultScaleInternal()
 {
 
     nsCOMPtr<nsIScreen> screen = GetWidgetScreen();
     MOZ_ASSERT(screen);
     RefPtr<nsScreenAndroid> screenAndroid = (nsScreenAndroid*) screen.get();
     return screenAndroid->GetDensity();
 }
 
-NS_IMETHODIMP
+void
 nsWindow::Show(bool aState)
 {
     ALOG("nsWindow[%p]::Show %d", (void*)this, aState);
 
     if (mWindowType == eWindowType_invisible) {
         ALOG("trying to show invisible window! ignoring..");
-        return NS_ERROR_FAILURE;
+        return;
     }
 
     if (aState == mIsVisible)
-        return NS_OK;
+        return;
 
     mIsVisible = aState;
 
     if (IsTopLevel()) {
         // XXX should we bring this to the front when it's shown,
         // if it's a toplevel widget?
 
         // XXX we should synthesize a eMouseExitFromWidget (for old top
@@ -1719,18 +1719,16 @@ nsWindow::Show(bool aState)
         }
     } else if (FindTopLevel() == nsWindow::TopWindow()) {
         RedrawAll();
     }
 
 #ifdef DEBUG_ANDROID_WIDGET
     DumpWindows();
 #endif
-
-    return NS_OK;
 }
 
 bool
 nsWindow::IsVisible() const
 {
     return mIsVisible;
 }
 
--- a/widget/android/nsWindow.h
+++ b/widget/android/nsWindow.h
@@ -157,17 +157,17 @@ public:
                                          const LayoutDeviceIntRect& aRect,
                                          nsWidgetInitData* aInitData) override;
     virtual void Destroy() override;
     NS_IMETHOD ConfigureChildren(const nsTArray<nsIWidget::Configuration>&) override;
     virtual void SetParent(nsIWidget* aNewParent) override;
     virtual nsIWidget *GetParent(void) override;
     virtual float GetDPI() override;
     virtual double GetDefaultScaleInternal() override;
-    NS_IMETHOD Show(bool aState) override;
+    virtual void Show(bool aState) override;
     virtual bool IsVisible() const override;
     virtual void ConstrainPosition(bool aAllowSlop,
                                    int32_t *aX,
                                    int32_t *aY) override;
     virtual void Move(double aX,
                       double aY) override;
     virtual void Resize(double aWidth,
                         double aHeight,
--- a/widget/cocoa/nsChildView.h
+++ b/widget/cocoa/nsChildView.h
@@ -303,17 +303,17 @@ public:
   virtual MOZ_MUST_USE nsresult Create(nsIWidget* aParent,
                                        nsNativeWidget aNativeParent,
                                        const LayoutDeviceIntRect& aRect,
                                        nsWidgetInitData* aInitData = nullptr)
                                        override;
 
   virtual void            Destroy() override;
 
-  NS_IMETHOD              Show(bool aState) override;
+  virtual void            Show(bool aState) override;
   virtual bool            IsVisible() const override;
 
   virtual void            SetParent(nsIWidget* aNewParent) override;
   virtual nsIWidget*      GetParent(void) override;
   virtual float           GetDPI() override;
 
   virtual void            Move(double aX, double aY) override;
   virtual void            Resize(double aWidth, double aHeight, bool aRepaint) override;
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -712,35 +712,35 @@ ManipulateViewWithoutNeedingDisplay(NSVi
     win = (BaseWindow*)[aView window];
   }
   [win disableSetNeedsDisplay];
   aCallback();
   [win enableSetNeedsDisplay];
 }
 
 // Hide or show this component
-NS_IMETHODIMP nsChildView::Show(bool aState)
-{
-  NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
+void
+nsChildView::Show(bool aState)
+{
+  NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   if (aState != mVisible) {
     // Provide an autorelease pool because this gets called during startup
     // on the "hidden window", resulting in cocoa object leakage if there's
     // no pool in place.
     nsAutoreleasePool localPool;
 
     ManipulateViewWithoutNeedingDisplay(mView, ^{
       [mView setHidden:!aState];
     });
 
     mVisible = aState;
   }
-  return NS_OK;
-
-  NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
+
+  NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 // Change the parent of this widget
 void
 nsChildView::SetParent(nsIWidget* aNewParent)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
--- a/widget/cocoa/nsCocoaWindow.h
+++ b/widget/cocoa/nsCocoaWindow.h
@@ -232,17 +232,17 @@ public:
     virtual MOZ_MUST_USE nsresult Create(nsIWidget* aParent,
                                          nsNativeWidget aNativeParent,
                                          const LayoutDeviceIntRect& aRect,
                                          nsWidgetInitData* aInitData = nullptr)
                                          override;
 
     virtual void            Destroy() override;
 
-    NS_IMETHOD              Show(bool aState) override;
+    virtual void            Show(bool aState) override;
     virtual nsIWidget*      GetSheetWindowParent(void) override;
     virtual void            Enable(bool aState) override;
     virtual bool            IsEnabled() const override;
     virtual void            SetModal(bool aState) override;
     virtual void            SetFakeModal(bool aState) override;
     virtual bool            IsRunningAppModal() override;
     virtual bool            IsVisible() const override;
     NS_IMETHOD              SetFocus(bool aState=false) override;
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -728,56 +728,57 @@ nsCocoaWindow::SetFakeModal(bool aState)
 
 bool
 nsCocoaWindow::IsRunningAppModal()
 {
   return [NSApp _isRunningAppModal];
 }
 
 // Hide or show this window
-NS_IMETHODIMP nsCocoaWindow::Show(bool bState)
+void
+nsCocoaWindow::Show(bool bState)
 {
-  NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
+  NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   if (!mWindow)
-    return NS_OK;
+    return;
 
   // We need to re-execute sometimes in order to bring already-visible
   // windows forward.
   if (!mSheetNeedsShow && !bState && ![mWindow isVisible])
-    return NS_OK;
+    return;
 
   // Protect against re-entering.
   if (bState && [mWindow isBeingShown])
-    return NS_OK;
+    return;
 
   [mWindow setBeingShown:bState];
 
   nsIWidget* parentWidget = mParent;
   nsCOMPtr<nsPIWidgetCocoa> piParentWidget(do_QueryInterface(parentWidget));
   NSWindow* nativeParentWindow = (parentWidget) ?
     (NSWindow*)parentWidget->GetNativeData(NS_NATIVE_WINDOW) : nil;
 
   if (bState && !mBounds.IsEmpty()) {
     // Don't try to show a popup when the parent isn't visible or is minimized.
     if (mWindowType == eWindowType_popup && nativeParentWindow) {
       if (![nativeParentWindow isVisible] || [nativeParentWindow isMiniaturized]) {
-        return NS_OK;
+        return;
       }
     }
 
     if (mPopupContentView) {
       // Ensure our content view is visible. We never need to hide it.
       mPopupContentView->Show(true);
     }
 
     if (mWindowType == eWindowType_sheet) {
       // bail if no parent window (its basically what we do in Carbon)
       if (!nativeParentWindow || !piParentWidget)
-        return NS_ERROR_FAILURE;
+        return;
 
       NSWindow* topNonSheetWindow = nativeParentWindow;
       
       // If this sheet is the child of another sheet, hide the parent so that
       // this sheet can be displayed. Leave the parent mSheetNeedsShow alone,
       // that is only used to handle sibling sheet contention. The parent will
       // return once there are no more child sheets.
       bool parentIsSheet = false;
@@ -978,19 +979,17 @@ NS_IMETHODIMP nsCocoaWindow::Show(bool b
           postNotificationName:@"com.apple.HIToolbox.endMenuTrackingNotification"
                         object:@"org.mozilla.gecko.PopupWindow"];
       }
     }
   }
 
   [mWindow setBeingShown:NO];
 
-  return NS_OK;
-
-  NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
+  NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 struct ShadowParams {
   float standardDeviation;
   float density;
   int offsetX;
   int offsetY;
   unsigned int flags;
@@ -1333,19 +1332,18 @@ nsCocoaWindow::HideWindowChrome(bool aSh
   while ((child = [enumerator nextObject])) {
     [mWindow addChildWindow:child ordered:NSWindowAbove];
   }
 
   // Show the new window.
   if (isVisible) {
     bool wasAnimationSuppressed = mIsAnimationSuppressed;
     mIsAnimationSuppressed = true;
-    rv = Show(true);
+    Show(true);
     mIsAnimationSuppressed = wasAnimationSuppressed;
-    NS_ENSURE_SUCCESS_VOID(rv);
   }
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 class FullscreenTransitionData : public nsISupports
 {
 public:
--- a/widget/gonk/nsWindow.cpp
+++ b/widget/gonk/nsWindow.cpp
@@ -340,48 +340,49 @@ nsWindow::Destroy()
     mOnDestroyCalled = true;
     mScreen->UnregisterWindow(this);
     if (this == gFocusedWindow) {
         gFocusedWindow = nullptr;
     }
     nsBaseWidget::OnDestroy();
 }
 
-NS_IMETHODIMP
+void
 nsWindow::Show(bool aState)
 {
     if (mWindowType == eWindowType_invisible) {
-        return NS_OK;
+        return;
     }
 
     if (mVisible == aState) {
-        return NS_OK;
+        return;
     }
 
     mVisible = aState;
     if (!IS_TOPLEVEL()) {
-        return mParent ? mParent->Show(aState) : NS_OK;
+        if (mParent) {
+            mParent->Show(aState);
+        }
+        return;
     }
 
     if (aState) {
         BringToTop();
     } else {
         const nsTArray<nsWindow*>& windows =
             mScreen->GetTopWindows();
         for (unsigned int i = 0; i < windows.Length(); i++) {
             nsWindow *win = windows[i];
             if (!win->mVisible) {
                 continue;
             }
             win->BringToTop();
             break;
         }
     }
-
-    return NS_OK;
 }
 
 bool
 nsWindow::IsVisible() const
 {
     return mVisible;
 }
 
--- a/widget/gonk/nsWindow.h
+++ b/widget/gonk/nsWindow.h
@@ -49,17 +49,17 @@ public:
 
     using nsBaseWidget::Create; // for Create signature not overridden here
     virtual MOZ_MUST_USE nsresult Create(nsIWidget* aParent,
                                          void* aNativeParent,
                                          const LayoutDeviceIntRect& aRect,
                                          nsWidgetInitData* aInitData) override;
     virtual void Destroy();
 
-    NS_IMETHOD Show(bool aState);
+    virtual void Show(bool aState);
     virtual bool IsVisible() const;
     virtual void Move(double aX,
                       double aY);
     virtual void Resize(double aWidth,
                         double aHeight,
                         bool  aRepaint);
     virtual void Resize(double aX,
                         double aY,
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -1057,21 +1057,21 @@ void nsWindow::SetSizeConstraints(const 
             LayoutDeviceIntSize(NS_MAXSIZE, NS_MAXSIZE)) {
             hints |= GDK_HINT_MAX_SIZE;
         }
         gtk_window_set_geometry_hints(GTK_WINDOW(mShell), nullptr,
                                       &geometry, GdkWindowHints(hints));
     }
 }
 
-NS_IMETHODIMP
+void
 nsWindow::Show(bool aState)
 {
     if (aState == mIsShown)
-        return NS_OK;
+        return;
 
     // Clear our cached resources when the window is hidden.
     if (mIsShown && !aState) {
         ClearCachedResources();
     }
 
     mIsShown = aState;
 
@@ -1084,31 +1084,29 @@ nsWindow::Show(bool aState)
     }
 
     // Ok, someone called show on a window that isn't sized to a sane
     // value.  Mark this window as needing to have Show() called on it
     // and return.
     if ((aState && !AreBoundsSane()) || !mCreated) {
         LOG(("\tbounds are insane or window hasn't been created yet\n"));
         mNeedsShow = true;
-        return NS_OK;
+        return;
     }
 
     // If someone is hiding this widget, clear any needing show flag.
     if (!aState)
         mNeedsShow = false;
 
 #ifdef ACCESSIBILITY
     if (aState && a11y::ShouldA11yBeEnabled())
         CreateRootAccessible();
 #endif
 
     NativeShow(aState);
-
-    return NS_OK;
 }
 
 void
 nsWindow::Resize(double aWidth, double aHeight, bool aRepaint)
 {
     double scale = BoundsUseDesktopPixels() ? GetDesktopToDeviceScale().scale : 1.0;
     int32_t width = NSToIntRound(scale * aWidth);
     int32_t height = NSToIntRound(scale * aHeight);
--- a/widget/gtk/nsWindow.h
+++ b/widget/gtk/nsWindow.h
@@ -111,17 +111,17 @@ public:
     virtual void       SetModal(bool aModal) override;
     virtual bool       IsVisible() const override;
     virtual void       ConstrainPosition(bool aAllowSlop,
                                          int32_t *aX,
                                          int32_t *aY) override;
     virtual void       SetSizeConstraints(const SizeConstraints& aConstraints) override;
     virtual void       Move(double aX,
                             double aY) override;
-    NS_IMETHOD         Show             (bool aState) override;
+    virtual void       Show             (bool aState) override;
     virtual void       Resize           (double aWidth,
                                          double aHeight,
                                          bool   aRepaint) override;
     virtual void       Resize           (double aX,
                                          double aY,
                                          double aWidth,
                                          double aHeight,
                                          bool   aRepaint) override;
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -631,17 +631,17 @@ class nsIWidget : public nsISupports
     }
 
     /**
      * Show or hide this widget
      *
      * @param aState true to show the Widget, false to hide it
      *
      */
-    NS_IMETHOD Show(bool aState) = 0;
+    virtual void Show(bool aState) = 0;
 
     /**
      * Make the window modal.
      */
     virtual void SetModal(bool aModal) = 0;
 
     /**
      * Make the non-modal window opened by modal window fake-modal, that will
--- a/widget/uikit/nsWindow.h
+++ b/widget/uikit/nsWindow.h
@@ -30,17 +30,17 @@ public:
     //
 
     virtual MOZ_MUST_USE nsresult Create(nsIWidget* aParent,
                                          nsNativeWidget aNativeParent,
                                          const LayoutDeviceIntRect& aRect,
                                          nsWidgetInitData* aInitData = nullptr)
                                          override;
     virtual void Destroy() override;
-    NS_IMETHOD Show(bool aState) override;
+    virtual void Show(bool aState) override;
     virtual void            Enable(bool aState) override {}
     virtual bool            IsEnabled() const override {
         return true;
     }
     virtual bool            IsVisible() const override {
         return mVisible;
     }
     NS_IMETHOD              SetFocus(bool aState=false) override;
--- a/widget/uikit/nsWindow.mm
+++ b/widget/uikit/nsWindow.mm
@@ -553,29 +553,28 @@ nsWindow::ConfigureChildren(const nsTArr
                          config[i].mBounds.width,
                          config[i].mBounds.height,
                          false);
     }
 
     return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 nsWindow::Show(bool aState)
 {
   if (aState != mVisible) {
       mNativeView.hidden = aState ? NO : YES;
       if (aState) {
           UIView* parentView = mParent ? mParent->mNativeView : nsAppShell::gWindow.rootViewController.view;
           [parentView bringSubviewToFront:mNativeView];
           [mNativeView setNeedsDisplay];
       }
       mVisible = aState;
   }
-  return NS_OK;
 }
 
 void
 nsWindow::Move(double aX, double aY)
 {
   if (!mNativeView || (mBounds.x == aX && mBounds.y == aY))
     return;
 
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -1415,17 +1415,18 @@ nsWindow::GetFallbackScrollSnapshot(cons
 /**************************************************************
  *
  * SECTION: nsIWidget::Show
  *
  * Hide or show this component.
  *
  **************************************************************/
 
-NS_IMETHODIMP nsWindow::Show(bool bState)
+void
+nsWindow::Show(bool bState)
 {
   if (mWindowType == eWindowType_popup) {
     // See bug 603793. When we try to draw D3D9/10 windows with a drop shadow
     // without the DWM on a secondary monitor, windows fails to composite
     // our windows correctly. We therefor switch off the drop shadow for
     // pop-up windows when the DWM is disabled and two monitors are
     // connected.
     if (HasBogusPopupsDropShadowOnMultiMonitor() &&
@@ -1530,27 +1531,25 @@ NS_IMETHODIMP nsWindow::Show(bool bState
       if (mWindowType != eWindowType_dialog) {
         ::ShowWindow(mWnd, SW_HIDE);
       } else {
         ::SetWindowPos(mWnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE |
                        SWP_NOZORDER | SWP_NOACTIVATE);
       }
     }
   }
-  
+
 #ifdef MOZ_XUL
   if (!wasVisible && bState) {
     Invalidate();
     if (syncInvalidate && !mInDtor && !mOnDestroyCalled) {
       ::UpdateWindow(mWnd);
     }
   }
 #endif
-
-  return NS_OK;
 }
 
 /**************************************************************
  *
  * SECTION: nsIWidget::IsVisible
  *
  * Returns the visibility state.
  *
--- a/widget/windows/nsWindow.h
+++ b/widget/windows/nsWindow.h
@@ -114,17 +114,17 @@ public:
   {
     if (mozilla::widget::WinUtils::IsPerMonitorDPIAware()) {
       return mozilla::DesktopToLayoutDeviceScale(1.0);
     } else {
       return mozilla::DesktopToLayoutDeviceScale(GetDefaultScaleInternal());
     }
   }
 
-  NS_IMETHOD              Show(bool bState) override;
+  virtual void            Show(bool aState) override;
   virtual bool            IsVisible() const override;
   virtual void            ConstrainPosition(bool aAllowSlop, int32_t *aX, int32_t *aY) override;
   virtual void            SetSizeConstraints(const SizeConstraints& aConstraints) override;
   virtual const SizeConstraints GetSizeConstraints() override;
   virtual void            Move(double aX, double aY) override;
   virtual void            Resize(double aWidth, double aHeight, bool aRepaint) override;
   virtual void            Resize(double aX, double aY, double aWidth, double aHeight, bool aRepaint) override;
   virtual MOZ_MUST_USE nsresult