Bug 1325234 (part 10) - Final nsIWidget deCOMtamination clean-ups. r=mstange.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 21 Dec 2016 15:58:09 +1100
changeset 328508 1c419cd68dcc95fb63f43bcaf117995ae77f638f
parent 328507 1e51e167058e06429deb642480c0c5691715601e
child 328509 8600fe754cc1889d68c77ccce574d6cc03b740e9
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 10) - Final nsIWidget deCOMtamination clean-ups. r=mstange. This patch converts some NS_IMETHOD and NS_IMETHODIMP occurrences that I missed in previous bugs. The patch also removes the Android nsWindow::{Get,Set}HasTransparentBackground() functions because they're unused.
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/uikit/nsWindow.mm
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1602,17 +1602,17 @@ nsWindow::Destroy()
 
     nsBaseWidget::OnDestroy();
 
 #ifdef DEBUG_ANDROID_WIDGET
     DumpWindows();
 #endif
 }
 
-NS_IMETHODIMP
+nsresult
 nsWindow::ConfigureChildren(const nsTArray<nsIWidget::Configuration>& config)
 {
     for (uint32_t i = 0; i < config.Length(); ++i) {
         nsWindow *childWin = (nsWindow*) config[i].mChild.get();
         childWin->Resize(config[i].mBounds.x,
                          config[i].mBounds.y,
                          config[i].mBounds.width,
                          config[i].mBounds.height,
--- a/widget/android/nsWindow.h
+++ b/widget/android/nsWindow.h
@@ -152,17 +152,17 @@ public:
     //
 
     using nsBaseWidget::Create; // for Create signature not overridden here
     virtual MOZ_MUST_USE nsresult Create(nsIWidget* aParent,
                                          nsNativeWidget aNativeParent,
                                          const LayoutDeviceIntRect& aRect,
                                          nsWidgetInitData* aInitData) override;
     virtual void Destroy() override;
-    NS_IMETHOD ConfigureChildren(const nsTArray<nsIWidget::Configuration>&) override;
+    virtual nsresult 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;
     virtual void Show(bool aState) override;
     virtual bool IsVisible() const override;
     virtual void ConstrainPosition(bool aAllowSlop,
                                    int32_t *aX,
@@ -191,18 +191,16 @@ public:
     virtual already_AddRefed<nsIScreen> GetWidgetScreen() override;
     virtual nsresult MakeFullScreen(bool aFullScreen,
                                     nsIScreen* aTargetScreen = nullptr)
                                     override;
 
     virtual void SetCursor(nsCursor aCursor) override {}
     virtual nsresult SetCursor(imgIContainer* aCursor, uint32_t aHotspotX,
                                uint32_t aHotspotY) override { return NS_ERROR_NOT_IMPLEMENTED; }
-    NS_IMETHOD SetHasTransparentBackground(bool aTransparent) { return NS_OK; }
-    NS_IMETHOD GetHasTransparentBackground(bool& aTransparent) { aTransparent = false; return NS_OK; }
     void* GetNativeData(uint32_t aDataType) override;
     void SetNativeData(uint32_t aDataType, uintptr_t aVal) override;
     virtual nsresult SetTitle(const nsAString& aTitle) override { return NS_OK; }
     virtual MOZ_MUST_USE nsresult GetAttention(int32_t aCycleCount) override { return NS_ERROR_NOT_IMPLEMENTED; }
 
     virtual void SetInputContext(const InputContext& aContext,
                                  const InputContextAction& aAction) override;
     virtual InputContext GetInputContext() override;
--- a/widget/cocoa/nsChildView.h
+++ b/widget/cocoa/nsChildView.h
@@ -368,18 +368,18 @@ public:
 
   virtual nsresult  SetTitle(const nsAString& title) override;
 
   virtual MOZ_MUST_USE nsresult
                     GetAttention(int32_t aCycleCount) override;
 
   virtual bool HasPendingInputEvent() override;
 
-  NS_IMETHOD        ActivateNativeMenuItemAt(const nsAString& indexString) override;
-  NS_IMETHOD        ForceUpdateNativeMenuAt(const nsAString& indexString) override;
+  virtual nsresult  ActivateNativeMenuItemAt(const nsAString& indexString) override;
+  virtual nsresult  ForceUpdateNativeMenuAt(const nsAString& indexString) override;
   virtual MOZ_MUST_USE nsresult
                     GetSelectionAsPlaintext(nsAString& aResult) override;
 
   virtual void SetInputContext(const InputContext& aContext,
                                const InputContextAction& aAction) override;
   virtual InputContext GetInputContext() override;
   virtual TextEventDispatcherListener*
     GetNativeTextEventDispatcherListener() override;
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -1240,17 +1240,18 @@ static NSMenuItem* NativeMenuItemWithLoc
         return nil;
     }
   }
 
   return nil;
 }
 
 // Used for testing native menu system structure and event handling.
-NS_IMETHODIMP nsChildView::ActivateNativeMenuItemAt(const nsAString& indexString)
+nsresult
+nsChildView::ActivateNativeMenuItemAt(const nsAString& indexString)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   NSString* locationString = [NSString stringWithCharacters:reinterpret_cast<const unichar*>(indexString.BeginReading())
                                                      length:indexString.Length()];
   NSMenuItem* item = NativeMenuItemWithLocation([NSApp mainMenu], locationString);
   // We can't perform an action on an item with a submenu, that will raise
   // an obj-c exception.
@@ -1264,17 +1265,18 @@ NS_IMETHODIMP nsChildView::ActivateNativ
     }
   }
   return NS_ERROR_FAILURE;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 // Used for testing native menu system structure and event handling.
-NS_IMETHODIMP nsChildView::ForceUpdateNativeMenuAt(const nsAString& indexString)
+nsresult
+nsChildView::ForceUpdateNativeMenuAt(const nsAString& indexString)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   nsCocoaWindow *widget = GetXULWindowWidget();
   if (widget) {
     nsMenuBarX* mb = widget->GetMenuBar();
     if (mb) {
       if (indexString.IsEmpty())
--- a/widget/cocoa/nsCocoaWindow.h
+++ b/widget/cocoa/nsCocoaWindow.h
@@ -263,17 +263,17 @@ public:
     void EnteredFullScreen(bool aFullScreen, bool aNativeMode = true);
     virtual bool PrepareForFullscreenTransition(nsISupports** aData) override;
     virtual void PerformFullscreenTransition(FullscreenTransitionStage aStage,
                                              uint16_t aDuration,
                                              nsISupports* aData,
                                              nsIRunnable* aCallback) override;
     virtual nsresult MakeFullScreen(
       bool aFullScreen, nsIScreen* aTargetScreen = nullptr) override final;
-    NS_IMETHOD MakeFullScreenWithNativeTransition(
+    virtual nsresult MakeFullScreenWithNativeTransition(
       bool aFullScreen, nsIScreen* aTargetScreen = nullptr) override final;
     NSAnimation* FullscreenTransitionAnimation() const { return mFullscreenTransitionAnimation; }
     void ReleaseFullscreenTransitionAnimation()
     {
       MOZ_ASSERT(mFullscreenTransitionAnimation,
                  "Should only be called when there is animation");
       [mFullscreenTransitionAnimation release];
       mFullscreenTransitionAnimation = nil;
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -493,17 +493,17 @@ nsresult nsCocoaWindow::CreateNativeWind
   [[WindowDataMap sharedWindowDataMap] ensureDataForWindow:mWindow];
   mWindowMadeHere = true;
 
   return NS_OK;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
-NS_IMETHODIMP
+nsresult
 nsCocoaWindow::CreatePopupContentView(const LayoutDeviceIntRect &aRect)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // We need to make our content view a ChildView.
   mPopupContentView = new nsChildView();
   if (!mPopupContentView)
     return NS_ERROR_FAILURE;
@@ -1484,17 +1484,17 @@ nsCocoaWindow::ShouldToggleNativeFullscr
 }
 
 nsresult
 nsCocoaWindow::MakeFullScreen(bool aFullScreen, nsIScreen* aTargetScreen)
 {
   return DoMakeFullScreen(aFullScreen, false);
 }
 
-NS_IMETHODIMP
+nsresult
 nsCocoaWindow::MakeFullScreenWithNativeTransition(bool aFullScreen,
                                                   nsIScreen* aTargetScreen)
 {
   return DoMakeFullScreen(aFullScreen, true);
 }
 
 nsresult
 nsCocoaWindow::DoMakeFullScreen(bool aFullScreen, bool aUseSystemTransition)
--- a/widget/gonk/nsWindow.cpp
+++ b/widget/gonk/nsWindow.cpp
@@ -439,17 +439,17 @@ nsWindow::SetFocus(bool aRaise)
     if (!IS_TOPLEVEL() && mScreen->IsPrimaryScreen()) {
         // We should only set focused window on non-toplevel primary window.
         gFocusedWindow = this;
     }
 
     return NS_OK;
 }
 
-NS_IMETHODIMP
+nsresult
 nsWindow::ConfigureChildren(const nsTArray<nsIWidget::Configuration>&)
 {
     return NS_OK;
 }
 
 void
 nsWindow::Invalidate(const LayoutDeviceIntRect& aRect)
 {
--- a/widget/gonk/nsWindow.h
+++ b/widget/gonk/nsWindow.h
@@ -64,17 +64,17 @@ public:
     virtual void Resize(double aX,
                         double aY,
                         double aWidth,
                         double aHeight,
                         bool aRepaint);
     virtual void Enable(bool aState);
     virtual bool IsEnabled() const;
     virtual nsresult SetFocus(bool aRaise = false);
-    NS_IMETHOD ConfigureChildren(const nsTArray<nsIWidget::Configuration>&);
+    virtual nsresult 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);
     virtual nsresult SetTitle(const nsAString& aTitle)
     {
         return NS_OK;
     }
     virtual LayoutDeviceIntPoint WidgetToScreenOffset();
--- a/widget/uikit/nsWindow.mm
+++ b/widget/uikit/nsWindow.mm
@@ -538,17 +538,17 @@ nsWindow::Destroy()
 
     TearDownView();
 
     nsBaseWidget::OnDestroy();
 
     return NS_OK;
 }
 
-NS_IMETHODIMP
+nsresult
 nsWindow::ConfigureChildren(const nsTArray<nsIWidget::Configuration>& config)
 {
     for (uint32_t i = 0; i < config.Length(); ++i) {
         nsWindow *childWin = (nsWindow*) config[i].mChild.get();
         childWin->Resize(config[i].mBounds.x,
                          config[i].mBounds.y,
                          config[i].mBounds.width,
                          config[i].mBounds.height,