Bug 825866. Part 4: Remove nsIView's IID as it's not needed anymore. r=tnikkel
authorRobert O'Callahan <robert@ocallahan.org>
Fri, 04 Jan 2013 02:23:09 +1300
changeset 126598 53707172d724f98e6a28530bcc3b5b35028cbebf
parent 126597 638d614c55a54504fd798092b77cdec7b1bd9c7b
child 126599 dcb03b79fd15da8794af0821dad0d0e861f6663d
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs825866
milestone20.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 825866. Part 4: Remove nsIView's IID as it's not needed anymore. r=tnikkel
view/public/nsIView.h
view/src/nsView.cpp
--- a/view/public/nsIView.h
+++ b/view/public/nsIView.h
@@ -29,20 +29,16 @@ class nsIFrame;
 // hide - the layer is not shown.
 // show - the layer is shown irrespective of the visibility of 
 //        the layer's parent.
 enum nsViewVisibility {
   nsViewVisibility_kHide = 0,
   nsViewVisibility_kShow = 1
 };
 
-#define NS_IVIEW_IID    \
-{ 0x7f979fcc, 0xa15a, 0x4f8a, \
-  { 0x8b, 0x68, 0xa4, 0x16, 0xa1, 0x87, 0xad, 0xdc } }
-
 // Public view flags
 
 // Indicates that the view is using auto z-indexing
 #define NS_VIEW_FLAG_AUTO_ZINDEX          0x0004
 
 // Indicates that the view is a floating view.
 #define NS_VIEW_FLAG_FLOATING             0x0008
 
@@ -64,18 +60,16 @@ enum nsViewVisibility {
  *
  * Most of the methods here are read-only. To set the corresponding properties
  * of a view, go through nsIViewManager.
  */
 
 class nsIView MOZ_FINAL : public nsIWidgetListener
 {
 public:
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IVIEW_IID)
-
   nsIView(nsViewManager* aViewManager = nullptr,
           nsViewVisibility aVisibility = nsViewVisibility_kShow);
 
   NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
 
   /**
    * Find the view for the given widget, if there is one.
    * @return the view the widget belongs to, or null if the widget doesn't
@@ -342,18 +336,16 @@ public:
   bool IsEffectivelyVisible();
 
   // This is an app unit offset to add when converting view coordinates to
   // widget coordinates.  It is the offset in view coordinates from widget
   // origin (unlike views, widgets can't extend above or to the left of their
   // origin) to view origin expressed in appunits of this.
   nsPoint ViewToWidgetOffset() const { return mViewToWidgetOffset; }
 
-  NS_IMETHOD  QueryInterface(const nsIID& aIID, void** aInstancePtr);
-
   /**
    * Called to indicate that the position of the view has been changed.
    * The specified coordinates are in the parent view's coordinate space.
    * @param x new x position
    * @param y new y position
    */
   void SetPosition(nscoord aX, nscoord aY);
   /**
@@ -483,11 +475,9 @@ protected:
   nsPoint           mViewToWidgetOffset;
   float             mOpacity;
   uint32_t          mVFlags;
   bool              mWidgetIsTopLevel;
   bool              mForcedRepaint;
   bool              mInAlternatePaint;
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(nsIView, NS_IVIEW_IID)
-
 #endif
--- a/view/src/nsView.cpp
+++ b/view/src/nsView.cpp
@@ -112,35 +112,16 @@ void nsIView::DestroyWidget()
       mWindow->SetWidgetListener(nullptr);
       mWindow->Destroy();
     }
 
     NS_RELEASE(mWindow);
   }
 }
 
-nsresult nsIView::QueryInterface(const nsIID& aIID, void** aInstancePtr)
-{
-  if (nullptr == aInstancePtr) {
-    return NS_ERROR_NULL_POINTER;
-  }
-
-  NS_ASSERTION(!aIID.Equals(NS_GET_IID(nsISupports)),
-               "Someone expects views to be ISupports-derived!");
-  
-  *aInstancePtr = nullptr;
-  
-  if (aIID.Equals(NS_GET_IID(nsIView))) {
-    *aInstancePtr = (void*)(nsIView*)this;
-    return NS_OK;
-  }
-
-  return NS_NOINTERFACE;
-}
-
 nsIView* nsIView::GetViewFor(nsIWidget* aWidget)
 {
   NS_PRECONDITION(nullptr != aWidget, "null widget ptr");
 
   nsIWidgetListener* listener = aWidget->GetWidgetListener();
   if (listener) {
     nsIView* view = listener->GetView();
     if (view)