Bug 1325234 (part 4) - Streamline nsIWidget::{SetFocus,SetNonClientMargins}(). r=mstange.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 21 Dec 2016 11:13:08 +1100
changeset 373493 445cae8045dec19f197ea08c80f6e4d17fc336d7
parent 373492 b4181e317c8df04f18dd85eac8d8922b1d4e41f6
child 373494 75544504b0012d30bbee73fd73fea1ac5c85de03
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [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 4) - Streamline nsIWidget::{SetFocus,SetNonClientMargins}(). r=mstange. This patch changes them from |NS_IMETHOD| to |virtual nsresult|.
gfx/tests/gtest/TestCompositor.cpp
widget/PluginWidgetProxy.cpp
widget/PluginWidgetProxy.h
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/nsBaseWidget.cpp
widget/nsBaseWidget.h
widget/nsIWidget.h
widget/uikit/nsWindow.h
widget/uikit/nsWindow.mm
widget/windows/nsWindow.cpp
widget/windows/nsWindow.h
--- a/gfx/tests/gtest/TestCompositor.cpp
+++ b/gfx/tests/gtest/TestCompositor.cpp
@@ -70,17 +70,17 @@ public:
   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; }
-  NS_IMETHOD              SetFocus(bool aRaise) override { return NS_OK; }
+  virtual nsresult        SetFocus(bool aRaise) override { return NS_OK; }
   virtual nsresult        ConfigureChildren(const nsTArray<Configuration>& aConfigurations) override { return NS_OK; }
   virtual void            Invalidate(const LayoutDeviceIntRect& aRect) override {}
   NS_IMETHOD              SetTitle(const nsAString& title) override { return NS_OK; }
   virtual LayoutDeviceIntPoint WidgetToScreenOffset() override { return LayoutDeviceIntPoint(0, 0); }
   NS_IMETHOD              DispatchEvent(mozilla::WidgetGUIEvent* aEvent,
                                         nsEventStatus& aStatus) override { return NS_OK; }
   NS_IMETHOD_(void)       SetInputContext(const InputContext& aContext,
                                           const InputContextAction& aAction) override {}
--- a/widget/PluginWidgetProxy.cpp
+++ b/widget/PluginWidgetProxy.cpp
@@ -176,17 +176,17 @@ PluginWidgetProxy::SetNativeData(uint32_
       mActor->SendSetNativeChildWindow(aVal);
       break;
     default:
       NS_ERROR("SetNativeData called with unsupported data type.");
   }
 }
 #endif
 
-NS_IMETHODIMP
+nsresult
 PluginWidgetProxy::SetFocus(bool aRaise)
 {
   ENSURE_CHANNEL;
   PWLOG("PluginWidgetProxy::SetFocus(%d)\n", aRaise);
   mActor->SendSetFocus(aRaise);
   return NS_OK;
 }
 
--- a/widget/PluginWidgetProxy.h
+++ b/widget/PluginWidgetProxy.h
@@ -36,17 +36,17 @@ public:
   // nsIWidget
   using PuppetWidget::Create; // for Create signature not overridden here
   virtual MOZ_MUST_USE nsresult Create(nsIWidget* aParent,
                                        nsNativeWidget aNativeParent,
                                        const LayoutDeviceIntRect& aRect,
                                        nsWidgetInitData* aInitData = nullptr)
                                        override;
   virtual void Destroy() override;
-  NS_IMETHOD SetFocus(bool aRaise = false) override;
+  virtual nsresult SetFocus(bool aRaise = false) override;
   virtual void SetParent(nsIWidget* aNewParent) override;
 
   virtual nsIWidget* GetParent(void) override;
   virtual void* GetNativeData(uint32_t aDataType) override;
 #if defined(XP_WIN)
   void SetNativeData(uint32_t aDataType, uintptr_t aVal) override;
 #endif
   virtual nsTransparencyMode GetTransparencyMode() override
--- a/widget/PuppetWidget.cpp
+++ b/widget/PuppetWidget.cpp
@@ -269,17 +269,17 @@ PuppetWidget::ConfigureChildren(const ns
     } else if (bounds.TopLeft() != configuration.mBounds.TopLeft()) {
       w->Move(configuration.mBounds.x, configuration.mBounds.y);
     }
     w->SetWindowClipRegion(configuration.mClipRegion, false);
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP
+nsresult
 PuppetWidget::SetFocus(bool aRaise)
 {
   if (aRaise && mTabChild) {
     mTabChild->SendRequestFocus(true);
   }
 
   return NS_OK;
 }
--- a/widget/PuppetWidget.h
+++ b/widget/PuppetWidget.h
@@ -110,17 +110,17 @@ public:
 
   // XXX/cjones: copying gtk behavior here; unclear what disabling a
   // widget is supposed to entail
   virtual void Enable(bool aState) override
   { mEnabled = aState; }
   virtual bool IsEnabled() const override
   { return mEnabled; }
 
-  NS_IMETHOD SetFocus(bool aRaise = false) override;
+  virtual nsresult SetFocus(bool aRaise = false) override;
 
   virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations) override;
 
   virtual void Invalidate(const LayoutDeviceIntRect& aRect) override;
 
   // PuppetWidgets don't have native data, as they're purely nonnative.
   virtual void* GetNativeData(uint32_t aDataType) override;
 #if defined(XP_WIN)
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1851,17 +1851,17 @@ nsWindow::FindTopLevel()
 
         toplevel = toplevel->mParent;
     }
 
     ALOG("nsWindow::FindTopLevel(): couldn't find a toplevel or dialog window in this [%p] widget's hierarchy!", (void*)this);
     return this;
 }
 
-NS_IMETHODIMP
+nsresult
 nsWindow::SetFocus(bool aRaise)
 {
     nsWindow *top = FindTopLevel();
     top->BringToFront();
 
     return NS_OK;
 }
 
--- a/widget/android/nsWindow.h
+++ b/widget/android/nsWindow.h
@@ -177,17 +177,17 @@ public:
                         double aWidth,
                         double aHeight,
                         bool aRepaint) override;
     void SetZIndex(int32_t aZIndex) override;
     virtual void SetSizeMode(nsSizeMode aMode) override;
     virtual void Enable(bool aState) override;
     virtual bool IsEnabled() const override;
     virtual void Invalidate(const LayoutDeviceIntRect& aRect) override;
-    NS_IMETHOD SetFocus(bool aRaise = false) override;
+    virtual nsresult SetFocus(bool aRaise = false) override;
     virtual LayoutDeviceIntRect GetScreenBounds() override;
     virtual LayoutDeviceIntPoint WidgetToScreenOffset() override;
     NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent,
                              nsEventStatus& aStatus) override;
     nsEventStatus DispatchEvent(mozilla::WidgetGUIEvent* aEvent);
     virtual already_AddRefed<nsIScreen> GetWidgetScreen() override;
     virtual nsresult MakeFullScreen(bool aFullScreen,
                                     nsIScreen* aTargetScreen = nullptr)
--- a/widget/cocoa/nsChildView.h
+++ b/widget/cocoa/nsChildView.h
@@ -317,17 +317,17 @@ public:
 
   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;
-  NS_IMETHOD              SetFocus(bool aRaise) override;
+  virtual nsresult        SetFocus(bool aRaise) override;
   virtual LayoutDeviceIntRect GetBounds() override;
   virtual LayoutDeviceIntRect GetClientBounds() override;
   virtual LayoutDeviceIntRect GetScreenBounds() override;
 
   // Returns the "backing scale factor" of the view's window, which is the
   // ratio of pixels in the window's backing store to Cocoa points. Prior to
   // HiDPI support in OS X 10.7, this was always 1.0, but in HiDPI mode it
   // will be 2.0 (and might potentially other values as screen resolutions
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -824,17 +824,18 @@ nsChildView::Enable(bool aState)
 {
 }
 
 bool nsChildView::IsEnabled() const
 {
   return true;
 }
 
-NS_IMETHODIMP nsChildView::SetFocus(bool aRaise)
+nsresult
+nsChildView::SetFocus(bool aRaise)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   NSWindow* window = [mView window];
   if (window)
     [window makeFirstResponder:mView];
   return NS_OK;
 
--- a/widget/cocoa/nsCocoaWindow.h
+++ b/widget/cocoa/nsCocoaWindow.h
@@ -240,17 +240,17 @@ public:
     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;
+    virtual nsresult        SetFocus(bool aState=false) override;
     virtual LayoutDeviceIntPoint WidgetToScreenOffset() override;
     virtual LayoutDeviceIntPoint GetClientOffset() override;
     virtual LayoutDeviceIntSize
     ClientToWindowSize(const LayoutDeviceIntSize& aClientSize) override;
 
     virtual void* GetNativeData(uint32_t aDataType) override;
 
     virtual void            ConstrainPosition(bool aAllowSlop,
@@ -313,17 +313,17 @@ public:
     virtual nsTransparencyMode GetTransparencyMode() override;
     virtual void SetTransparencyMode(nsTransparencyMode aMode) override;
     virtual void SetWindowShadowStyle(int32_t aStyle) override;
     virtual void SetShowsToolbarButton(bool aShow) override;
     virtual void SetShowsFullScreenButton(bool aShow) override;
     virtual void SetWindowAnimationType(WindowAnimationType aType) override;
     virtual void SetDrawsTitle(bool aDrawTitle) override;
     virtual void SetUseBrightTitlebarForeground(bool aBrightForeground) override;
-    NS_IMETHOD SetNonClientMargins(LayoutDeviceIntMargin& aMargins) override;
+    virtual nsresult SetNonClientMargins(LayoutDeviceIntMargin& aMargins) override;
     virtual void SetWindowTitlebarColor(nscolor aColor, bool aActive) override;
     virtual void SetDrawsInTitlebar(bool aState) override;
     virtual void UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometries) override;
     virtual nsresult SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
                                                 uint32_t aNativeMessage,
                                                 uint32_t aModifierFlags,
                                                 nsIObserver* aObserver) override;
 
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -1998,17 +1998,18 @@ void nsCocoaWindow::SetMenuBar(nsMenuBar
   // displayed when the app starts up.
   id windowDelegate = [mWindow delegate];
   if (mMenuBar &&
       ((!gSomeMenuBarPainted && nsMenuUtilsX::GetHiddenWindowMenuBar() == mMenuBar) ||
        (windowDelegate && [windowDelegate toplevelActiveState])))
     mMenuBar->Paint();
 }
 
-NS_IMETHODIMP nsCocoaWindow::SetFocus(bool aState)
+nsresult
+nsCocoaWindow::SetFocus(bool aState)
 {
   if (!mWindow)
     return NS_OK;
 
   if (mPopupContentView) {
     mPopupContentView->SetFocus(aState);
   }
   else if (aState && ([mWindow isVisible] || [mWindow isMiniaturized])) {
@@ -2222,17 +2223,18 @@ nsCocoaWindow::SetUseBrightTitlebarForeg
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   [mWindow setUseBrightTitlebarForeground:aBrightForeground];
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
-NS_IMETHODIMP nsCocoaWindow::SetNonClientMargins(LayoutDeviceIntMargin &margins)
+nsresult
+nsCocoaWindow::SetNonClientMargins(LayoutDeviceIntMargin &margins)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   SetDrawsInTitlebar(margins.top == 0);
 
   return NS_OK;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
--- a/widget/gonk/nsWindow.cpp
+++ b/widget/gonk/nsWindow.cpp
@@ -424,17 +424,17 @@ nsWindow::Enable(bool aState)
 }
 
 bool
 nsWindow::IsEnabled() const
 {
     return true;
 }
 
-NS_IMETHODIMP
+nsresult
 nsWindow::SetFocus(bool aRaise)
 {
     if (aRaise) {
         BringToTop();
     }
 
     if (!IS_TOPLEVEL() && mScreen->IsPrimaryScreen()) {
         // We should only set focused window on non-toplevel primary window.
--- a/widget/gonk/nsWindow.h
+++ b/widget/gonk/nsWindow.h
@@ -63,17 +63,17 @@ public:
                         bool  aRepaint);
     virtual void Resize(double aX,
                         double aY,
                         double aWidth,
                         double aHeight,
                         bool aRepaint);
     virtual void Enable(bool aState);
     virtual bool IsEnabled() const;
-    NS_IMETHOD SetFocus(bool aRaise = false);
+    virtual nsresult SetFocus(bool aRaise = false);
     NS_IMETHOD ConfigureChildren(const nsTArray<nsIWidget::Configuration>&);
     virtual void Invalidate(const LayoutDeviceIntRect& aRect);
     virtual void* GetNativeData(uint32_t aDataType);
     virtual void SetNativeData(uint32_t aDataType, uintptr_t aVal);
     NS_IMETHOD SetTitle(const nsAString& aTitle)
     {
         return NS_OK;
     }
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -1386,17 +1386,17 @@ nsWindow::GetLastUserInputTime()
     if (sLastUserInputTime != GDK_CURRENT_TIME &&
         TimestampIsNewerThan(sLastUserInputTime, timestamp)) {
         return sLastUserInputTime;
     }
 
     return timestamp;
 }
 
-NS_IMETHODIMP
+nsresult
 nsWindow::SetFocus(bool aRaise)
 {
     // Make sure that our owning widget has focus.  If it doesn't try to
     // grab it.  Note that we don't set our focus flag in this case.
 
     LOGFOCUS(("  SetFocus %d [%p]\n", aRaise, (void *)this));
 
     GtkWidget *owningWidget = GetMozContainerWidget();
--- a/widget/gtk/nsWindow.h
+++ b/widget/gtk/nsWindow.h
@@ -125,17 +125,17 @@ public:
                                          double aWidth,
                                          double aHeight,
                                          bool   aRepaint) override;
     virtual bool       IsEnabled() const override;
 
     void               SetZIndex(int32_t aZIndex) override;
     virtual void       SetSizeMode(nsSizeMode aMode) override;
     virtual void       Enable(bool aState) override;
-    NS_IMETHOD         SetFocus(bool aRaise = false) override;
+    virtual nsresult   SetFocus(bool aRaise = false) override;
     virtual LayoutDeviceIntRect GetScreenBounds() override;
     virtual LayoutDeviceIntRect GetClientBounds() override;
     virtual LayoutDeviceIntSize GetClientSize() override;
     virtual LayoutDeviceIntPoint GetClientOffset() override;
     NS_IMETHOD         SetCursor(nsCursor aCursor) override;
     NS_IMETHOD         SetCursor(imgIContainer* aCursor,
                                  uint32_t aHotspotX, uint32_t aHotspotY) override;
     virtual void       Invalidate(const LayoutDeviceIntRect& aRect) override;
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -1567,17 +1567,17 @@ nsBaseWidget::GetRestoredBounds(LayoutDe
 }
 
 LayoutDeviceIntPoint
 nsBaseWidget::GetClientOffset()
 {
   return LayoutDeviceIntPoint(0, 0);
 }
 
-NS_IMETHODIMP
+nsresult
 nsBaseWidget::SetNonClientMargins(LayoutDeviceIntMargin &margins)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 uint32_t nsBaseWidget::GetMaxTouchPoints() const
 {
   return 0;
--- a/widget/nsBaseWidget.h
+++ b/widget/nsBaseWidget.h
@@ -235,17 +235,17 @@ public:
                                             int32_t *aY) override {}
   virtual void            MoveClient(double aX, double aY) override;
   virtual void            ResizeClient(double aWidth, double aHeight, bool aRepaint) override;
   virtual void            ResizeClient(double aX, double aY, double aWidth, double aHeight, bool aRepaint) override;
   virtual LayoutDeviceIntRect GetBounds() override;
   virtual LayoutDeviceIntRect GetClientBounds() override;
   virtual LayoutDeviceIntRect GetScreenBounds() override;
   virtual MOZ_MUST_USE nsresult GetRestoredBounds(LayoutDeviceIntRect& aRect) override;
-  NS_IMETHOD              SetNonClientMargins(LayoutDeviceIntMargin& aMargins) override;
+  virtual nsresult        SetNonClientMargins(LayoutDeviceIntMargin& aMargins) override;
   virtual LayoutDeviceIntPoint GetClientOffset() override;
   virtual void            EnableDragDrop(bool aEnable) override {};
   virtual MOZ_MUST_USE nsresult
                           GetAttention(int32_t aCycleCount) override
                           { return NS_OK; }
   virtual bool            HasPendingInputEvent() override;
   virtual void            SetIcon(const nsAString &aIconSpec) override {}
   virtual void            SetWindowTitlebarColor(nscolor aColor, bool aActive)
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -854,17 +854,17 @@ class nsIWidget : public nsISupports
      * Request activation of this window or give focus to this widget.
      *
      * @param aRaise If true, this function requests activation of this
      *               widget's toplevel window.
      *               If false, the appropriate toplevel window (which in
      *               the case of popups may not be this widget's toplevel
      *               window) is already active.
      */
-    NS_IMETHOD SetFocus(bool aRaise = false) = 0;
+    virtual nsresult SetFocus(bool aRaise = false) = 0;
 
     /**
      * Get this widget's outside dimensions relative to its parent widget. For
      * popup widgets the returned rect is in screen coordinates and not
      * relative to its parent widget.
      *
      * @return the x, y, width and height of this widget.
      */
@@ -908,19 +908,18 @@ class nsIWidget : public nsISupports
      * the system default frame size for that border. Pass zero to remove
      * a border, or pass a specific value adjust a border. Units are in
      * pixels. (DPI dependent)
      *
      * Platform notes:
      *  Windows: shrinking top non-client height will remove application
      *  icon and window title text. Glass desktops will refuse to set
      *  dimensions between zero and size < system default.
-     *
      */
-    NS_IMETHOD SetNonClientMargins(LayoutDeviceIntMargin& aMargins) = 0;
+    virtual nsresult SetNonClientMargins(LayoutDeviceIntMargin& aMargins) = 0;
 
     /**
      * Get the client offset from the window origin.
      *
      * @return the x and y of the offset.
      */
     virtual LayoutDeviceIntPoint GetClientOffset() = 0;
 
--- a/widget/uikit/nsWindow.h
+++ b/widget/uikit/nsWindow.h
@@ -38,17 +38,17 @@ public:
     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;
+    virtual nsresult        SetFocus(bool aState=false) override;
     virtual LayoutDeviceIntPoint WidgetToScreenOffset() override;
 
     virtual void SetBackgroundColor(const nscolor &aColor) override;
     virtual void* GetNativeData(uint32_t aDataType) override;
 
     virtual void            Move(double aX, double aY) override;
     virtual void            SetSizeMode(nsSizeMode aMode) override;
     void                    EnteredFullScreen(bool aFullScreen);
--- a/widget/uikit/nsWindow.mm
+++ b/widget/uikit/nsWindow.mm
@@ -664,17 +664,17 @@ nsWindow::Invalidate(const LayoutDeviceI
   MOZ_RELEASE_ASSERT(GetLayerManager()->GetBackendType() != LayersBackend::LAYERS_CLIENT,
                      "Shouldn't need to invalidate with accelerated OMTC layers!");
 
 
   [mNativeView setNeedsLayout];
   [mNativeView setNeedsDisplayInRect:DevPixelsToUIKitPoints(mBounds, BackingScaleFactor())];
 }
 
-NS_IMETHODIMP
+nsresult
 nsWindow::SetFocus(bool aRaise)
 {
   [[mNativeView window] makeKeyWindow];
   [mNativeView becomeFirstResponder];
   return NS_OK;
 }
 
 void nsWindow::WillPaintWindow()
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -2132,17 +2132,18 @@ bool nsWindow::IsEnabled() const
 /**************************************************************
  *
  * SECTION: nsIWidget::SetFocus
  *
  * Give the focus to this widget.
  *
  **************************************************************/
 
-NS_IMETHODIMP nsWindow::SetFocus(bool aRaise)
+nsresult
+nsWindow::SetFocus(bool aRaise)
 {
   if (mWnd) {
 #ifdef WINSTATE_DEBUG_OUTPUT
     if (mWnd == WinUtils::GetTopLevelHWND(mWnd)) {
       MOZ_LOG(gWindowsLog, LogLevel::Info,
              ("*** SetFocus: [  top] raise=%d\n", aRaise));
     } else {
       MOZ_LOG(gWindowsLog, LogLevel::Info,
@@ -2594,17 +2595,17 @@ nsWindow::UpdateNonClientMargins(int32_t
     // Force a reflow of content based on the new client
     // dimensions.
     ResetLayout();
   }
 
   return true;
 }
 
-NS_IMETHODIMP
+nsresult
 nsWindow::SetNonClientMargins(LayoutDeviceIntMargin &margins)
 {
   if (!mIsTopWidgetWindow ||
       mBorderStyle == eBorderStyle_none)
     return NS_ERROR_INVALID_ARG;
 
   if (mHideChrome) {
     mFutureMarginsOnceChromeShows = margins;
--- a/widget/windows/nsWindow.h
+++ b/widget/windows/nsWindow.h
@@ -130,17 +130,17 @@ public:
   virtual MOZ_MUST_USE nsresult
                           BeginResizeDrag(mozilla::WidgetGUIEvent* aEvent,
                                           int32_t aHorizontal,
                                           int32_t aVertical) override;
   virtual void            PlaceBehind(nsTopLevelWidgetZPlacement aPlacement, nsIWidget *aWidget, bool aActivate) override;
   virtual void            SetSizeMode(nsSizeMode aMode) override;
   virtual void            Enable(bool aState) override;
   virtual bool            IsEnabled() const override;
-  NS_IMETHOD              SetFocus(bool aRaise) override;
+  virtual nsresult        SetFocus(bool aRaise) override;
   virtual LayoutDeviceIntRect GetBounds() override;
   virtual LayoutDeviceIntRect GetScreenBounds() override;
   virtual MOZ_MUST_USE nsresult GetRestoredBounds(LayoutDeviceIntRect& aRect) override;
   virtual LayoutDeviceIntRect GetClientBounds() override;
   virtual LayoutDeviceIntPoint GetClientOffset() override;
   void                    SetBackgroundColor(const nscolor& aColor) override;
   NS_IMETHOD              SetCursor(imgIContainer* aCursor,
                                     uint32_t aHotspotX, uint32_t aHotspotY) override;
@@ -206,17 +206,17 @@ public:
   NS_IMETHOD_(TextEventDispatcherListener*)
     GetNativeTextEventDispatcherListener() override;
 #ifdef MOZ_XUL
   virtual void            SetTransparencyMode(nsTransparencyMode aMode) override;
   virtual nsTransparencyMode GetTransparencyMode() override;
   virtual void            UpdateOpaqueRegion(const LayoutDeviceIntRegion& aOpaqueRegion) override;
 #endif // MOZ_XUL
   virtual nsIMEUpdatePreference GetIMEUpdatePreference() override;
-  NS_IMETHOD              SetNonClientMargins(LayoutDeviceIntMargin& aMargins) override;
+  virtual nsresult        SetNonClientMargins(LayoutDeviceIntMargin& aMargins) override;
   void                    SetDrawsInTitlebar(bool aState) override;
   virtual void            UpdateWindowDraggingRegion(const LayoutDeviceIntRegion& aRegion) override;
 
   virtual void            UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometries) override;
   virtual uint32_t        GetMaxTouchPoints() const override;
 
   /**
    * Event helpers