Bug 856472: Convert CanvasGradient to WebIDL r=bz
authorDavid Zbarsky <dzbarsky@gmail.com>
Fri, 26 Apr 2013 10:55:54 -0400
changeset 130078 a25af78ec2fb0bf04324a49f340061fd9a7fe9c6
parent 130077 f127889eda58ded37745f792a2930bd2916fb8d9
child 130079 05c7d6b210a422a0ddc961d34a638094ca37b68f
push id1552
push userttaubert@mozilla.com
push dateSat, 27 Apr 2013 15:33:29 +0000
treeherderfx-team@40dafc376794 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs856472
milestone23.0a1
Bug 856472: Convert CanvasGradient to WebIDL r=bz
content/canvas/src/CanvasGradient.h
content/canvas/src/CanvasRenderingContext2D.cpp
content/canvas/src/CanvasRenderingContext2D.h
content/canvas/test/test_canvas.html
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoClasses.h
dom/bindings/Bindings.conf
dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl
dom/webidl/CanvasRenderingContext2D.webidl
js/xpconnect/src/dom_quickstubs.qsconf
js/xpconnect/src/qsgen.py
--- a/content/canvas/src/CanvasGradient.h
+++ b/content/canvas/src/CanvasGradient.h
@@ -3,24 +3,26 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_CanvasGradient_h
 #define mozilla_dom_CanvasGradient_h
 
 #include "nsIDOMCanvasRenderingContext2D.h"
 #include "nsTArray.h"
 #include "mozilla/RefPtr.h"
+#include "mozilla/dom/CanvasRenderingContext2DBinding.h"
+#include "mozilla/gfx/2D.h"
 
 #define NS_CANVASGRADIENTAZURE_PRIVATE_IID \
     {0x28425a6a, 0x90e0, 0x4d42, {0x9c, 0x75, 0xff, 0x60, 0x09, 0xb3, 0x10, 0xa8}}
 
 namespace mozilla {
 namespace dom {
 
-class CanvasGradient : public nsIDOMCanvasGradient
+class CanvasGradient : public nsISupports
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_CANVASGRADIENTAZURE_PRIVATE_IID)
 
   enum Type
   {
     LINEAR = 0,
     RADIAL
@@ -41,18 +43,23 @@ public:
 
     mStops = aRT->CreateGradientStops(mRawStops.Elements(), mRawStops.Length());
 
     return mStops;
   }
 
   NS_DECL_ISUPPORTS
 
-  /* nsIDOMCanvasGradient */
-  NS_IMETHOD AddColorStop(float offset, const nsAString& colorstr);
+  // WebIDL
+  void AddColorStop(float offset, const nsAString& colorstr, ErrorResult& rv);
+
+  JSObject* WrapObject(JSContext* aCx, JSObject* aScope)
+  {
+    return CanvasGradientBinding::Wrap(aCx, aScope, this);
+  }
 
 protected:
   CanvasGradient(Type aType) : mType(aType)
   {}
 
   nsTArray<mozilla::gfx::GradientStop> mRawStops;
   mozilla::RefPtr<mozilla::gfx::GradientStops> mStops;
   Type mType;
--- a/content/canvas/src/CanvasRenderingContext2D.cpp
+++ b/content/canvas/src/CanvasRenderingContext2D.cpp
@@ -356,55 +356,54 @@ public:
 
 private:
   RefPtr<DrawTarget> mTarget;
   CanvasRenderingContext2D *mCtx;
   Float mSigma;
   mgfx::Rect mTempRect;
 };
 
-NS_IMETHODIMP
-CanvasGradient::AddColorStop(float offset, const nsAString& colorstr)
+void
+CanvasGradient::AddColorStop(float offset, const nsAString& colorstr, ErrorResult& rv)
 {
-  if (!FloatValidate(offset) || offset < 0.0 || offset > 1.0) {
-    return NS_ERROR_DOM_INDEX_SIZE_ERR;
+  if (offset < 0.0 || offset > 1.0) {
+    rv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
+    return;
   }
 
   nsCSSValue value;
   nsCSSParser parser;
   if (!parser.ParseColorString(colorstr, nullptr, 0, value)) {
-    return NS_ERROR_DOM_SYNTAX_ERR;
+    rv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
+    return;
   }
 
   nscolor color;
   if (!nsRuleNode::ComputeColor(value, nullptr, nullptr, color)) {
-    return NS_ERROR_DOM_SYNTAX_ERR;
+    rv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
+    return;
   }
 
   mStops = nullptr;
 
   GradientStop newStop;
 
   newStop.offset = offset;
   newStop.color = Color::FromABGR(color);
 
   mRawStops.AppendElement(newStop);
-
-  return NS_OK;
 }
 
 NS_DEFINE_STATIC_IID_ACCESSOR(CanvasGradient, NS_CANVASGRADIENTAZURE_PRIVATE_IID)
 
 NS_IMPL_ADDREF(CanvasGradient)
 NS_IMPL_RELEASE(CanvasGradient)
 
 NS_INTERFACE_MAP_BEGIN(CanvasGradient)
   NS_INTERFACE_MAP_ENTRY(mozilla::dom::CanvasGradient)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCanvasGradient)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CanvasGradient)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_DEFINE_STATIC_IID_ACCESSOR(CanvasPattern, NS_CANVASPATTERNAZURE_PRIVATE_IID)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(CanvasPattern)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(CanvasPattern)
 
@@ -1351,37 +1350,36 @@ CanvasRenderingContext2D::GetFillRule(ns
     aString.AssignLiteral("nonzero"); break;
   case FILL_EVEN_ODD:
     aString.AssignLiteral("evenodd"); break;
   }
 }
 //
 // gradients and patterns
 //
-already_AddRefed<nsIDOMCanvasGradient>
-CanvasRenderingContext2D::CreateLinearGradient(double x0, double y0, double x1, double y1,
-                                               ErrorResult& aError)
+already_AddRefed<CanvasGradient>
+CanvasRenderingContext2D::CreateLinearGradient(double x0, double y0, double x1, double y1)
 {
-  nsRefPtr<nsIDOMCanvasGradient> grad =
+  nsRefPtr<CanvasGradient> grad =
     new CanvasLinearGradient(Point(x0, y0), Point(x1, y1));
 
   return grad.forget();
 }
 
-already_AddRefed<nsIDOMCanvasGradient>
+already_AddRefed<CanvasGradient>
 CanvasRenderingContext2D::CreateRadialGradient(double x0, double y0, double r0,
                                                double x1, double y1, double r1,
                                                ErrorResult& aError)
 {
   if (r0 < 0.0 || r1 < 0.0) {
     aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
     return nullptr;
   }
 
-  nsRefPtr<nsIDOMCanvasGradient> grad =
+  nsRefPtr<CanvasGradient> grad =
     new CanvasRadialGradient(Point(x0, y0), r0, Point(x1, y1), r1);
 
   return grad.forget();
 }
 
 already_AddRefed<CanvasPattern>
 CanvasRenderingContext2D::CreatePattern(const HTMLImageOrCanvasOrVideoElement& element,
                                         const nsAString& repeat,
@@ -3803,11 +3801,10 @@ bool
 CanvasRenderingContext2D::ShouldForceInactiveLayer(LayerManager *aManager)
 {
   return !aManager->CanUseCanvasLayerForSize(gfxIntSize(mWidth, mHeight));
 }
 
 }
 }
 
-DOMCI_DATA(CanvasGradient, mozilla::dom::CanvasGradient)
 DOMCI_DATA(CanvasRenderingContext2D, mozilla::dom::CanvasRenderingContext2D)
 
--- a/content/canvas/src/CanvasRenderingContext2D.h
+++ b/content/canvas/src/CanvasRenderingContext2D.h
@@ -99,25 +99,24 @@ public:
 
   JS::Value GetFillStyle(JSContext* cx, mozilla::ErrorResult& error);
 
   void SetFillStyle(JSContext* cx, JS::Value& value)
   {
     SetStyleFromJSValue(cx, value, STYLE_FILL);
   }
 
-  already_AddRefed<nsIDOMCanvasGradient>
-    CreateLinearGradient(double x0, double y0, double x1, double y1,
-                         mozilla::ErrorResult& aError);
-  already_AddRefed<nsIDOMCanvasGradient>
+  already_AddRefed<CanvasGradient>
+    CreateLinearGradient(double x0, double y0, double x1, double y1);
+  already_AddRefed<CanvasGradient>
     CreateRadialGradient(double x0, double y0, double r0, double x1, double y1,
-                         double r1, mozilla::ErrorResult& aError);
+                         double r1, ErrorResult& aError);
   already_AddRefed<CanvasPattern>
     CreatePattern(const HTMLImageOrCanvasOrVideoElement& element,
-                  const nsAString& repeat, mozilla::ErrorResult& error);
+                  const nsAString& repeat, ErrorResult& error);
 
   double ShadowOffsetX()
   {
     return CurrentState().shadowOffset.x;
   }
 
   void SetShadowOffsetX(double shadowOffsetX)
   {
--- a/content/canvas/test/test_canvas.html
+++ b/content/canvas/test/test_canvas.html
@@ -6210,23 +6210,23 @@ var g = ctx.createLinearGradient(0, 0, 1
 var _thrown = undefined; try {
   g.addColorStop(-1, '#000');
 } catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError");
 var _thrown = undefined; try {
   g.addColorStop(2, '#000');
 } catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError");
 var _thrown = undefined; try {
   g.addColorStop(Infinity, '#000');
-} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError");
+} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "TypeError", "should throw TypeError");
 var _thrown = undefined; try {
   g.addColorStop(-Infinity, '#000');
-} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError");
+} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "TypeError", "should throw TypeError");
 var _thrown = undefined; try {
   g.addColorStop(NaN, '#000');
-} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError");
+} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "TypeError", "should throw TypeError");
 
 
 }
 </script>
 
 <!-- [[[ test_2d.gradient.object.return.html ]]] -->
 
 <p>Canvas test: 2d.gradient.object.return</p>
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -711,18 +711,16 @@ static nsDOMClassInfoData sClassInfoData
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGNumber, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGRect, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGZoomEvent, nsEventSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
-  NS_DEFINE_CLASSINFO_DATA(CanvasGradient, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(MozCanvasPrintState, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(WindowUtils, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(XSLTProcessor, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -1979,20 +1977,16 @@ nsDOMClassInfo::Init()
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGRect)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGZoomEvent, nsIDOMSVGZoomEvent)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGZoomEvent)
     DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
-  DOM_CLASSINFO_MAP_BEGIN(CanvasGradient, nsIDOMCanvasGradient)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMCanvasGradient)
-  DOM_CLASSINFO_MAP_END
-
   DOM_CLASSINFO_MAP_BEGIN(MozCanvasPrintState, nsIDOMMozCanvasPrintState)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozCanvasPrintState)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(XSLTProcessor, nsIXSLTProcessor)
     DOM_CLASSINFO_MAP_ENTRY(nsIXSLTProcessor)
     DOM_CLASSINFO_MAP_ENTRY(nsIXSLTProcessorPrivate)
   DOM_CLASSINFO_MAP_END
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -111,17 +111,16 @@ DOMCI_CLASS(SVGAnimatedNumber)
 DOMCI_CLASS(SVGAnimatedRect)
 DOMCI_CLASS(SVGAnimatedString)
 DOMCI_CLASS(SVGLength)
 DOMCI_CLASS(SVGNumber)
 DOMCI_CLASS(SVGRect)
 DOMCI_CLASS(SVGZoomEvent)
 
 // Canvas
-DOMCI_CLASS(CanvasGradient)
 DOMCI_CLASS(MozCanvasPrintState)
 
 // WindowUtils
 DOMCI_CLASS(WindowUtils)
 
 // XSLTProcessor
 DOMCI_CLASS(XSLTProcessor)
 
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -145,16 +145,20 @@ DOMInterfaces = {
     'workers': True,
 }],
 
 'BatteryManager': {
     'nativeType': 'mozilla::dom::battery::BatteryManager',
     'headerFile': 'BatteryManager.h'
 },
 
+'CanvasGradient': {
+    'wrapperCache': False,
+},
+
 'CanvasRenderingContext2D': {
     'implicitJSContext': [
         'createImageData', 'getImageData', 'strokeStyle',
         'fillStyle', 'mozDash'
     ],
     'resultNotAddRefed': [ 'canvas', 'measureText' ],
     'binaryNames': {
         'mozImageSmoothingEnabled': 'imageSmoothingEnabled',
@@ -1502,17 +1506,16 @@ def addExternalIface(iface, nativeType=N
 def addExternalHTMLElement(element):
    nativeElement = 'ns' + element
    addExternalIface(element, nativeType=nativeElement,
                     headerFile=nativeElement + '.h')
 
 addExternalHTMLElement('HTMLFormElement')
 addExternalIface('ActivityOptions', nativeType='nsIDOMMozActivityOptions',
                  headerFile='nsIDOMActivityOptions.h')
-addExternalIface('CanvasGradient', headerFile='nsIDOMCanvasRenderingContext2D.h')
 addExternalIface('Counter')
 addExternalIface('CSSRule')
 addExternalIface('DeviceAcceleration', headerFile='nsIDOMDeviceMotionEvent.h', notflattened=True)
 addExternalIface('DeviceRotationRate', headerFile='nsIDOMDeviceMotionEvent.h', notflattened=True)
 addExternalIface('DOMError')
 addExternalIface('CSSRuleList')
 addExternalIface('DOMStringList')
 addExternalIface('File')
--- a/dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl
+++ b/dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl
@@ -1,21 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 #include "nsISupports.idl"
 
-[scriptable, uuid(bbb20a59-524e-4662-981e-5e142814b20c)]
-interface nsIDOMCanvasGradient : nsISupports
-{
-  void addColorStop(in float offset, in DOMString color);
-};
-
 /**
  * This interface remains only for the constants, for a context, use the
  * WebIDL/Paris bindings instead (CanvasRenderingContext2D.webidl).
  * The constants are used by CanvasRenderingContext2D::DrawWindow and are
  * used in WindowsPreviewPerTab.jsm and some extensions. The constants can
  * be referenced directly via a canvas context 2d rather than this interface,
  * and that should be preferred in new code. 
  */
--- a/dom/webidl/CanvasRenderingContext2D.webidl
+++ b/dom/webidl/CanvasRenderingContext2D.webidl
@@ -6,17 +6,16 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-interface CanvasGradient;
 interface HitRegionOptions;
 interface Window;
 
 enum CanvasWindingRule { "nonzero", "evenodd" };
 
 interface CanvasRenderingContext2D {
 
   // back-reference to the canvas.  Might be null if we're not
@@ -46,19 +45,19 @@ interface CanvasRenderingContext2D {
            [Throws]
            attribute DOMString globalCompositeOperation; // (default source-over)
 
   // colors and styles (see also the CanvasDrawingStyles interface)
            [GetterThrows]
            attribute any strokeStyle; // (default black)
            [GetterThrows]
            attribute any fillStyle; // (default black)
-  [Throws]
+  [Creator]
   CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
-  [Throws]
+  [Creator, Throws]
   CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
   [Creator, Throws]
   CanvasPattern createPattern((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, [TreatNullAs=EmptyString] DOMString repetition);
 
   // shadows
            [LenientFloat]
            attribute double shadowOffsetX; // (default 0)
            [LenientFloat]
@@ -258,16 +257,23 @@ interface CanvasPathMethods {
   [LenientFloat]
   void rect(double x, double y, double w, double h);
 
   [Throws, LenientFloat]
   void arc(double x, double y, double radius, double startAngle, double endAngle, optional boolean anticlockwise = false); 
 // NOT IMPLEMENTED  [LenientFloat] void ellipse(double x, double y, double radiusX, double radiusY, double rotation, double startAngle, double endAngle, boolean anticlockwise);
 };
 
+interface CanvasGradient {
+  // opaque object
+  [Throws]
+  // addColorStop should take a double
+  void addColorStop(float offset, DOMString color);
+};
+
 interface CanvasPattern {
   // opaque object
   // void setTransform(SVGMatrix transform);
 };
 
 interface TextMetrics {
 
   // x-direction
--- a/js/xpconnect/src/dom_quickstubs.qsconf
+++ b/js/xpconnect/src/dom_quickstubs.qsconf
@@ -45,21 +45,16 @@ members = [
     'nsIDOMWindow.onmouseenter',
     'nsIDOMWindow.onmouseleave',
     'nsIDOMWindowPerformance.performance',
     'nsIDOMJSWindow.dump',
     # nsLocationSH has ~ALLOW_PROP_MODS_TO_PROTOTYPE, so don't try.
     #'nsIDOMLocation.hostname',
     #'nsIDOMLocation.href',
 
-    # dom/interfaces/canvas
-    #
-    # canvas friends
-    'nsIDOMCanvasGradient.*',
-
     # dom/interfaces/core
     'nsIDOMDOMStringList.*',
 
     'nsIDOMKeyEvent.*',
     'nsIDOMDragEvent.*',
     'nsIDOMProgressEvent.lengthComputable',
     'nsIDOMProgressEvent.loaded',
     'nsIDOMProgressEvent.total',
@@ -137,18 +132,16 @@ members = [
 # Most interfaces can be found by searching the includePath; to find
 # nsIDOMEvent, for example, just look for nsIDOMEvent.idl.  But IDL filenames
 # for very long interface names are slightly abbreviated, and many interfaces
 # don't have their own files, just for extra wackiness.  So qsgen.py needs
 # a little help.
 #
 irregularFilenames = {
     # stowaways
-    'nsIDOMCanvasGradient': 'nsIDOMCanvasRenderingContext2D',
-
     'nsIDOMBlob': 'nsIDOMFile',
 
     'nsIIndexedDatabaseUsageCallback': 'nsIIndexedDatabaseManager',
 
     'nsIDOMTouch': 'nsIDOMTouchEvent',
     'nsIDOMTouchList': 'nsIDOMTouchEvent',
 
     'nsITelephoneCallback': 'nsITelephone',
@@ -165,20 +158,16 @@ customIncludes = [
     'nsPerformance.h',
     'mozilla/dom/HTMLDocumentBinding.h',
     'mozilla/dom/EventTargetBinding.h',
     'mozilla/dom/EventBinding.h',
     'mozilla/dom/MouseEventBinding.h',
     'mozilla/dom/UIEventBinding.h',
     ]
 
-customReturnInterfaces = [
-    'nsIDOMCanvasGradient',
-    ]
-
 nsIDOMStorage_Clear_customMethodCallCode = """
     rv = self->Clear();
     if (NS_SUCCEEDED(rv))
         JS_ClearNonGlobalObject(cx, obj);
 """
 
 customMethodCalls = {
     'nsIDOMStorage_Clear': {
--- a/js/xpconnect/src/qsgen.py
+++ b/js/xpconnect/src/qsgen.py
@@ -221,17 +221,16 @@ class Configuration:
         # required settings
         for name in ('name', 'members'):
             if name not in config:
                 raise UserError(filename + ": `%s` was not defined." % name)
             setattr(self, name, config[name])
         # optional settings
         self.irregularFilenames = config.get('irregularFilenames', {})
         self.customIncludes = config.get('customIncludes', [])
-        self.customReturnInterfaces = config.get('customReturnInterfaces', [])
         self.customMethodCalls = config.get('customMethodCalls', {})
         self.newBindingProperties = config.get('newBindingProperties', {})
 
 def readConfigFile(filename, includePath, cachedir):
     # Read the config file.
     conf = Configuration(filename, includePath)
 
     # Now read IDL files to connect the information in the config file to
@@ -309,20 +308,16 @@ def readConfigFile(filename, includePath
         if iface not in stubbedInterfaces:
             stubbedInterfaces.append(iface)
 
     # Now go through and check all the interfaces' members
     for iface in stubbedInterfaces:
         for member in iface.stubMembers:
             checkStubMember(member)
 
-    for iface in conf.customReturnInterfaces:
-        # just ensure that it exists so that we can grab it later
-        iface = getInterface(iface, errorLoc='looking for %s' % (iface,))
-
     return conf, interfaces
 
 
 # === Generating the header file
 
 def writeHeaderFile(filename, name):
     print "Creating header file", filename
 
@@ -1266,17 +1261,16 @@ def writeStubFile(filename, headerFilena
 
         return resulttypes
 
     try:
         f.write(stubTopTemplate % os.path.basename(headerFilename))
         resulttypes = []
         for iface in interfaces:
             resulttypes.extend(writeIncludesForInterface(iface))
-        resulttypes.extend(conf.customReturnInterfaces)
         for customInclude in conf.customIncludes:
             f.write('#include "%s"\n' % customInclude)
         f.write("\n\n")
         writeResultXPCInterfacesArray(f, conf, frozenset(resulttypes))
         stringtable = StringTable()
         for iface in interfaces:
             writeStubsForInterface(f, conf.customMethodCalls, stringtable, iface)
         writeDefiner(f, conf, stringtable, interfaces)