Bug 811371 - Remove nsISupports inheritance in remaining (i.e. new) WebGL classes - r=continuation
authorBenoit Jacob <bjacob@mozilla.com>
Wed, 04 Sep 2013 08:14:48 -0400
changeset 145452 cafd5d260e660cd249a7f52929b3f5fb359b829e
parent 145451 4e538175f5e843b7ede0097b52f09c72f508d033
child 145453 b8a27424be7fdba315c337a207ffc39af934e602
push id25213
push userkwierso@gmail.com
push dateWed, 04 Sep 2013 23:18:26 +0000
treeherdermozilla-central@dffedf20a02d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscontinuation
bugs811371
milestone26.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 811371 - Remove nsISupports inheritance in remaining (i.e. new) WebGL classes - r=continuation
content/canvas/src/WebGLActiveInfo.h
content/canvas/src/WebGLExtensionBase.cpp
content/canvas/src/WebGLExtensions.h
content/canvas/src/WebGLQuery.cpp
content/canvas/src/WebGLQuery.h
content/canvas/src/WebGLVertexArray.cpp
content/canvas/src/WebGLVertexArray.h
--- a/content/canvas/src/WebGLActiveInfo.h
+++ b/content/canvas/src/WebGLActiveInfo.h
@@ -1,18 +1,17 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef WEBGLACTIVEINFO_H_
 #define WEBGLACTIVEINFO_H_
 
-#include "WebGLTypes.h"
-#include "nsISupports.h"
+#include "WebGLObjectModel.h"
 #include "nsString.h"
 #include "js/TypeDecls.h"
 
 namespace mozilla {
 
 class WebGLActiveInfo MOZ_FINAL
 {
 public:
--- a/content/canvas/src/WebGLExtensionBase.cpp
+++ b/content/canvas/src/WebGLExtensionBase.cpp
@@ -15,15 +15,10 @@ WebGLExtensionBase::WebGLExtensionBase(W
 }
 
 WebGLExtensionBase::~WebGLExtensionBase()
 {
 }
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLExtensionBase)
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(WebGLExtensionBase)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(WebGLExtensionBase)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(WebGLExtensionBase)
-  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
+NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLExtensionBase, AddRef)
+NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLExtensionBase, Release)
--- a/content/canvas/src/WebGLExtensions.h
+++ b/content/canvas/src/WebGLExtensions.h
@@ -6,30 +6,29 @@
 #ifndef WEBGLEXTENSIONS_H_
 #define WEBGLEXTENSIONS_H_
 
 namespace mozilla {
 
 class WebGLContext;
 
 class WebGLExtensionBase
-    : public nsISupports
+    : public nsWrapperCache
     , public WebGLContextBoundObject
-    , public nsWrapperCache
 {
 public:
     WebGLExtensionBase(WebGLContext*);
     virtual ~WebGLExtensionBase();
 
     WebGLContext *GetParentObject() const {
         return Context();
     }
 
-    NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-    NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(WebGLExtensionBase)
+    NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLExtensionBase)
+    NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLExtensionBase)
 };
 
 #define DECL_WEBGL_EXTENSION_GOOP                                           \
     virtual JSObject* WrapObject(JSContext *cx,                             \
                                  JS::Handle<JSObject*> scope) MOZ_OVERRIDE;
 
 #define IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionType) \
     JSObject* \
--- a/content/canvas/src/WebGLQuery.cpp
+++ b/content/canvas/src/WebGLQuery.cpp
@@ -31,15 +31,10 @@ void WebGLQuery::Delete() {
     mContext->MakeContextCurrent();
     mContext->gl->fDeleteQueries(1, &mGLName);
     LinkedListElement<WebGLQuery>::removeFrom(mContext->mQueries);
 }
 
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLQuery)
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(WebGLQuery)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(WebGLQuery)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(WebGLQuery)
-  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
+NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLQuery, AddRef)
+NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLQuery, Release)
--- a/content/canvas/src/WebGLQuery.h
+++ b/content/canvas/src/WebGLQuery.h
@@ -11,21 +11,20 @@
 
 #include "nsWrapperCache.h"
 
 #include "mozilla/LinkedList.h"
 
 namespace mozilla {
 
 class WebGLQuery MOZ_FINAL
-    : public nsISupports
+    : public nsWrapperCache
     , public WebGLRefCountedObject<WebGLQuery>
     , public LinkedListElement<WebGLQuery>
     , public WebGLContextBoundObject
-    , public nsWrapperCache
 {
 // -----------------------------------------------------------------------------
 // PUBLIC
 public:
 
     // -------------------------------------------------------------------------
     // CONSTRUCTOR & DESTRUCTOR
 
@@ -65,18 +64,18 @@ public:
     }
 
 
     // -------------------------------------------------------------------------
     // IMPLEMENT NS
     virtual JSObject* WrapObject(JSContext *cx,
                                  JS::Handle<JSObject*> scope) MOZ_OVERRIDE;
 
-    NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-    NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(WebGLQuery)
+    NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLQuery)
+    NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLQuery)
 
 
 // -----------------------------------------------------------------------------
 // PRIVATE
 private:
 
     // -------------------------------------------------------------------------
     // MEMBERS
--- a/content/canvas/src/WebGLVertexArray.cpp
+++ b/content/canvas/src/WebGLVertexArray.cpp
@@ -54,15 +54,10 @@ bool WebGLVertexArray::EnsureAttribIndex
 
     return true;
 }
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_2(WebGLVertexArray,
   mAttribBuffers,
   mBoundElementArrayBuffer)
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(WebGLVertexArray)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(WebGLVertexArray)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(WebGLVertexArray)
-  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
+NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLVertexArray, AddRef)
+NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLVertexArray, Release)
--- a/content/canvas/src/WebGLVertexArray.h
+++ b/content/canvas/src/WebGLVertexArray.h
@@ -12,21 +12,20 @@
 
 #include "nsWrapperCache.h"
 
 #include "mozilla/LinkedList.h"
 
 namespace mozilla {
 
 class WebGLVertexArray MOZ_FINAL
-    : public nsISupports
+    : public nsWrapperCache
     , public WebGLRefCountedObject<WebGLVertexArray>
     , public LinkedListElement<WebGLVertexArray>
     , public WebGLContextBoundObject
-    , public nsWrapperCache
 {
 // -----------------------------------------------------------------------------
 // PUBLIC
 public:
 
     // -------------------------------------------------------------------------
     // CONSTRUCTOR & DESTRUCTOR
 
@@ -44,18 +43,18 @@ public:
 
     WebGLContext* GetParentObject() const {
         return Context();
     }
 
     virtual JSObject* WrapObject(JSContext *cx,
                                  JS::Handle<JSObject*> scope) MOZ_OVERRIDE;
 
-    NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-    NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(WebGLVertexArray)
+    NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLVertexArray)
+    NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLVertexArray)
 
 
     // -------------------------------------------------------------------------
     // MEMBER FUNCTIONS
 
     bool HasEverBeenBound() { return mHasEverBeenBound; }
     void SetHasEverBeenBound(bool x) { mHasEverBeenBound = x; }
     GLuint GLName() const { return mGLName; }