Bug 841479 - Remove nsISupports inheritance from TextDecoder and TextEncoder. r=bz
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Fri, 15 Feb 2013 05:36:50 +0900
changeset 132620 f2291cff5ad841cd58df833fcd74f11effec09bd
parent 132619 4eed73abf01c76a6546d43f39e81f443d2e56913
child 132621 df71fc49f14fee5fee76502822ca399a139f5eb0
push id317
push userbbajaj@mozilla.com
push dateTue, 07 May 2013 01:20:33 +0000
treeherdermozilla-release@159a10910249 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs841479
milestone21.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 841479 - Remove nsISupports inheritance from TextDecoder and TextEncoder. r=bz
dom/bindings/Bindings.conf
dom/encoding/TextDecoder.cpp
dom/encoding/TextDecoder.h
dom/encoding/TextEncoder.cpp
dom/encoding/TextEncoder.h
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -962,21 +962,25 @@ DOMInterfaces = {
 
 'Text': {
     'nativeType': 'nsTextNode',
     'hasInstanceInterface': 'nsIDOMText',
 },
 
 'TextDecoder': [
 {
+    'nativeOwnership': 'refcounted',
+},
+{
     'workers': True,
 }],
 
 'TextEncoder': [
 {
+    'nativeOwnership': 'refcounted',
     'implicitJSContext': [ 'encode' ],
 },
 {
     'workers': True,
     'implicitJSContext': [ 'encode' ],
 }],
 
 'URL' : [{
--- a/dom/encoding/TextDecoder.cpp
+++ b/dom/encoding/TextDecoder.cpp
@@ -102,19 +102,15 @@ TextDecoderBase::Decode(const char* aInp
 
 void
 TextDecoderBase::GetEncoding(nsAString& aEncoding)
 {
   CopyASCIItoUTF16(mEncoding, aEncoding);
   nsContentUtils::ASCIIToLower(aEncoding);
 }
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(TextDecoder)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(TextDecoder)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TextDecoder)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
+NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(TextDecoder, AddRef)
+NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(TextDecoder, Release)
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(TextDecoder, mGlobal)
 
 } // dom
 } // mozilla
--- a/dom/encoding/TextDecoder.h
+++ b/dom/encoding/TextDecoder.h
@@ -7,21 +7,21 @@
 
 #include "mozilla/dom/TextDecoderBase.h"
 #include "mozilla/dom/TextDecoderBinding.h"
 
 namespace mozilla {
 namespace dom {
 
 class TextDecoder MOZ_FINAL
-  : public nsISupports, public nsWrapperCache, public TextDecoderBase
+  : public nsWrapperCache, public TextDecoderBase
 {
 public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TextDecoder)
+  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(TextDecoder)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(TextDecoder)
 
   // The WebIDL constructor.
   static already_AddRefed<TextDecoder>
   Constructor(const GlobalObject& aGlobal,
               const nsAString& aEncoding,
               const TextDecoderOptions& aOptions,
               ErrorResult& aRv)
   {
--- a/dom/encoding/TextEncoder.cpp
+++ b/dom/encoding/TextEncoder.cpp
@@ -102,19 +102,15 @@ TextEncoderBase::Encode(JSContext* aCx,
 
 void
 TextEncoderBase::GetEncoding(nsAString& aEncoding)
 {
   CopyASCIItoUTF16(mEncoding, aEncoding);
   nsContentUtils::ASCIIToLower(aEncoding);
 }
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(TextEncoder)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(TextEncoder)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TextEncoder)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
+NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(TextEncoder, AddRef)
+NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(TextEncoder, Release)
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(TextEncoder, mGlobal)
 
 } // dom
 } // mozilla
--- a/dom/encoding/TextEncoder.h
+++ b/dom/encoding/TextEncoder.h
@@ -7,21 +7,21 @@
 
 #include "mozilla/dom/TextEncoderBase.h"
 #include "mozilla/dom/TextEncoderBinding.h"
 
 namespace mozilla {
 namespace dom {
 
 class TextEncoder MOZ_FINAL
-  : public nsISupports, public nsWrapperCache, public TextEncoderBase
+  : public nsWrapperCache, public TextEncoderBase
 {
 public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TextEncoder)
+  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(TextEncoder)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(TextEncoder)
 
   // The WebIDL constructor.
   static already_AddRefed<TextEncoder>
   Constructor(const GlobalObject& aGlobal,
               const nsAString& aEncoding,
               ErrorResult& aRv)
   {
     nsRefPtr<TextEncoder> txtEncoder = new TextEncoder(aGlobal.Get());