Bug 995546. Nix bogus GetParentObject methods on WebIDL objects without a wrapper cache. r=bholley
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 15 Apr 2014 22:58:43 -0400
changeset 178742 a9ec9de606a8d87b48e12929e83793d1dcbc02f7
parent 178741 eacdbceea76d73bb6226d70f0852f7e4db7fc2fc
child 178743 6ffe0fe626e0b870f1922a85f99df50951a646e8
push id26595
push usercbook@mozilla.com
push dateWed, 16 Apr 2014 12:48:58 +0000
treeherdermozilla-central@f7c4e7719778 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs995546
milestone31.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 995546. Nix bogus GetParentObject methods on WebIDL objects without a wrapper cache. r=bholley
dom/base/URL.h
dom/bindings/Codegen.py
dom/encoding/TextDecoder.h
dom/encoding/TextEncoder.h
--- a/dom/base/URL.h
+++ b/dom/base/URL.h
@@ -34,21 +34,16 @@ class URL MOZ_FINAL : public URLSearchPa
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(URL)
 
   URL(nsIURI* aURI);
 
   // WebIDL methods
-  nsISupports* GetParentObject() const
-  {
-    return nullptr;
-  }
-
   JSObject*
   WrapObject(JSContext* aCx);
 
   static already_AddRefed<URL>
   Constructor(const GlobalObject& aGlobal, const nsAString& aUrl,
               URL& aBase, ErrorResult& aRv);
   static already_AddRefed<URL>
   Constructor(const GlobalObject& aGlobal, const nsAString& aUrl,
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -11163,17 +11163,19 @@ class CGBindingImplClass(CGClass):
         return self._deps
 
 
 class CGExampleClass(CGBindingImplClass):
     """
     Codegen for the actual example class implementation for this descriptor
     """
     def __init__(self, descriptor):
-        CGBindingImplClass.__init__(self, descriptor, CGExampleMethod, CGExampleGetter, CGExampleSetter)
+        CGBindingImplClass.__init__(self, descriptor,
+                                    CGExampleMethod, CGExampleGetter, CGExampleSetter,
+                                    wantGetParent=descriptor.wrapperCache)
 
         self.refcounted = descriptor.nativeOwnership == "refcounted"
 
         self.parentIface = descriptor.interface.parent
         if self.parentIface:
             self.parentDesc = descriptor.getDescriptor(
                 self.parentIface.identifier.name)
             bases = [ClassBase(self.nativeLeafName(self.parentDesc))]
--- a/dom/encoding/TextDecoder.h
+++ b/dom/encoding/TextDecoder.h
@@ -46,22 +46,16 @@ public:
     MOZ_COUNT_DTOR(TextDecoder);
   }
 
   JSObject* WrapObject(JSContext* aCx, bool* aTookOwnership)
   {
     return TextDecoderBinding::Wrap(aCx, this, aTookOwnership);
   }
 
-  nsISupports*
-  GetParentObject()
-  {
-    return nullptr;
-  }
-
   /**
    * Validates provided label and throws an exception if invalid label.
    *
    * @param aLabel       The encoding label (case insensitive) provided.
    * @param aFatal       indicates whether to throw an 'EncodingError'
    *                     exception or not when decoding.
    * @return aRv         EncodingError exception else null.
    */
--- a/dom/encoding/TextEncoder.h
+++ b/dom/encoding/TextEncoder.h
@@ -41,22 +41,16 @@ public:
   ~TextEncoder()
   {}
 
   JSObject* WrapObject(JSContext* aCx, bool* aTookOwnership)
   {
     return TextEncoderBinding::Wrap(aCx, this, aTookOwnership);
   }
 
-  nsISupports*
-  GetParentObject()
-  {
-    return nullptr;
-  }
-
   JSObject* Encode(JSContext* aCx,
                    JS::Handle<JSObject*> aObj,
                    const nsAString& aString,
                    const TextEncodeOptions& aOptions,
                    ErrorResult& aRv) {
     return TextEncoder::Encode(aCx, aObj, aString, aOptions.mStream, aRv);
   }