Bug 826632. Part 4: nsViewManager does not need to implement nsISupports anymore. r=tnikkel
authorRobert O'Callahan <robert@ocallahan.org>
Sat, 05 Jan 2013 16:12:57 +1300
changeset 123324 92f2f1a27270b6da50a4ec31ba0bf322825ed660
parent 123323 9e7027c6242a3e77facba24b4ce54cdd21d7536a
child 123325 0b3fbf63dd2727cfba55170e124549f092e8676f
push id3129
push userakeybl@mozilla.com
push dateMon, 07 Jan 2013 22:54:45 +0000
treeherdermozilla-aurora@090bc89ff6b4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs826632
milestone20.0a1
Bug 826632. Part 4: nsViewManager does not need to implement nsISupports anymore. r=tnikkel
view/public/nsViewManager.h
view/src/nsViewManager.cpp
--- a/view/public/nsViewManager.h
+++ b/view/public/nsViewManager.h
@@ -21,30 +21,24 @@
 
 class nsIWidget;
 struct nsRect;
 class nsRegion;
 class nsDeviceContext;
 class nsIPresShell;
 class nsView;
 
-#define NS_IVIEWMANAGER_IID \
-{ 0x540610a6, 0x4fdd, 0x4ae3, \
-  { 0x9b, 0xdb, 0xa6, 0x4d, 0x8b, 0xca, 0x02, 0x0f } }
-
-class nsViewManager : public nsISupports
+class nsViewManager
 {
 public:
   friend class nsView;
 
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IVIEWMANAGER_IID)
-
   NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
 
-  NS_DECL_ISUPPORTS
+  NS_INLINE_DECL_REFCOUNTING(nsViewManager)
 
   nsViewManager();
   virtual ~nsViewManager();
 
   /**
    * Initialize the ViewManager
    * Note: this instance does not hold a reference to the presshell
    * because it holds a reference to this instance.
@@ -424,19 +418,16 @@ private:
 
   //from here to public should be static and locked... MMP
   static int32_t           mVMCount;        //number of viewmanagers
 
   //list of view managers
   static nsVoidArray       *gViewManagers;
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(nsViewManager, NS_IVIEWMANAGER_IID)
-
-
 /**
    Invalidation model:
 
    1) Callers call into the view manager and ask it to invalidate a view.
 
    2) The view manager finds the "right" widget for the view, henceforth called
       the root widget.
 
--- a/view/src/nsViewManager.cpp
+++ b/view/src/nsViewManager.cpp
@@ -117,18 +117,16 @@ nsViewManager::~nsViewManager()
     NS_ASSERTION(gViewManagers != nullptr, "About to delete null gViewManagers");
     delete gViewManagers;
     gViewManagers = nullptr;
   }
 
   mPresShell = nullptr;
 }
 
-NS_IMPL_ISUPPORTS1(nsViewManager, nsViewManager)
-
 // We don't hold a reference to the presentation context because it
 // holds a reference to us.
 NS_IMETHODIMP nsViewManager::Init(nsDeviceContext* aContext)
 {
   NS_PRECONDITION(nullptr != aContext, "null ptr");
 
   if (nullptr == aContext) {
     return NS_ERROR_NULL_POINTER;