/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_WebGLRenderingContextBinding_h__
#define mozilla_dom_WebGLRenderingContextBinding_h__

#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/DOMJSClass.h"
#include "mozilla/dom/DOMJSProxyHandler.h"

class XPCWrappedNativeScope;
namespace mozilla {

class WebGLActiveInfo;

} // namespace mozilla

namespace mozilla {

class WebGLBuffer;

} // namespace mozilla

namespace mozilla {

class WebGLExtensionCompressedTextureATC;

} // namespace mozilla

namespace mozilla {

class WebGLExtensionCompressedTexturePVRTC;

} // namespace mozilla

namespace mozilla {

class WebGLExtensionCompressedTextureS3TC;

} // namespace mozilla

namespace mozilla {

class WebGLExtensionDebugRendererInfo;

} // namespace mozilla

namespace mozilla {

class WebGLExtensionDepthTexture;

} // namespace mozilla

namespace mozilla {

class WebGLExtensionLoseContext;

} // namespace mozilla

namespace mozilla {

class WebGLExtensionStandardDerivatives;

} // namespace mozilla

namespace mozilla {

class WebGLExtensionTextureFilterAnisotropic;

} // namespace mozilla

namespace mozilla {

class WebGLExtensionTextureFloat;

} // namespace mozilla

namespace mozilla {

class WebGLFramebuffer;

} // namespace mozilla

namespace mozilla {

class WebGLProgram;

} // namespace mozilla

namespace mozilla {

class WebGLRenderbuffer;

} // namespace mozilla

namespace mozilla {

class WebGLContext;

} // namespace mozilla

namespace mozilla {

class WebGLShader;

} // namespace mozilla

namespace mozilla {

class WebGLShaderPrecisionFormat;

} // namespace mozilla

namespace mozilla {

class WebGLTexture;

} // namespace mozilla

namespace mozilla {

class WebGLUniformLocation;

} // namespace mozilla


namespace mozilla {
namespace dom {

template <>
struct PrototypeTraits<prototypes::id::WebGLActiveInfo>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLActiveInfo NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLBuffer>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLBuffer NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLExtensionCompressedTextureATC>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLExtensionCompressedTextureATC NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLExtensionCompressedTexturePVRTC>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLExtensionCompressedTexturePVRTC NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLExtensionCompressedTextureS3TC>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLExtensionCompressedTextureS3TC NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLExtensionDebugRendererInfo>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLExtensionDebugRendererInfo NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLExtensionDepthTexture>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLExtensionDepthTexture NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLExtensionLoseContext>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLExtensionLoseContext NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLExtensionStandardDerivatives>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLExtensionStandardDerivatives NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLExtensionTextureFilterAnisotropic>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLExtensionTextureFilterAnisotropic NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLExtensionTextureFloat>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLExtensionTextureFloat NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLFramebuffer>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLFramebuffer NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLProgram>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLProgram NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLRenderbuffer>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLRenderbuffer NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLRenderingContext>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLContext NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLShader>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLShader NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLShaderPrecisionFormat>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLShaderPrecisionFormat NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLTexture>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLTexture NativeType;
};
template <>
struct PrototypeTraits<prototypes::id::WebGLUniformLocation>
{
  enum
  {
    Depth = 0
  };
  typedef mozilla::WebGLUniformLocation NativeType;
};
template <>
struct PrototypeIDMap<mozilla::WebGLActiveInfo>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLActiveInfo
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLBuffer>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLBuffer
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLExtensionCompressedTextureATC>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLExtensionCompressedTextureATC
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLExtensionCompressedTexturePVRTC>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLExtensionCompressedTexturePVRTC
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLExtensionCompressedTextureS3TC>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLExtensionCompressedTextureS3TC
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLExtensionDebugRendererInfo>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLExtensionDebugRendererInfo
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLExtensionDepthTexture>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLExtensionDepthTexture
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLExtensionLoseContext>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLExtensionLoseContext
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLExtensionStandardDerivatives>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLExtensionStandardDerivatives
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLExtensionTextureFilterAnisotropic>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLExtensionTextureFilterAnisotropic
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLExtensionTextureFloat>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLExtensionTextureFloat
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLFramebuffer>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLFramebuffer
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLProgram>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLProgram
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLRenderbuffer>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLRenderbuffer
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLContext>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLRenderingContext
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLShader>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLShader
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLShaderPrecisionFormat>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLShaderPrecisionFormat
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLTexture>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLTexture
  };
};
template <>
struct PrototypeIDMap<mozilla::WebGLUniformLocation>
{
  enum
  {
    PrototypeID = prototypes::id::WebGLUniformLocation
  };
};
} // namespace dom
} // namespace mozilla


namespace mozilla {
namespace dom {

struct WebGLContextAttributesWorkers {
  WebGLContextAttributesWorkers() {}
  bool Init(JSContext* cx, const JS::Value& val);
  bool ToObject(JSContext* cx, JSObject* parentObject, JS::Value *vp);


  bool alpha;
  bool antialias;
  bool depth;
  bool premultipliedAlpha;
  bool preserveDrawingBuffer;
  bool stencil;
private:
  // Disallow copy-construction
  WebGLContextAttributesWorkers(const WebGLContextAttributesWorkers&) MOZ_DELETE;
  static jsid alpha_id;
  static jsid antialias_id;
  static jsid depth_id;
  static jsid premultipliedAlpha_id;
  static jsid preserveDrawingBuffer_id;
  static jsid stencil_id;
};
struct WebGLContextAttributesWorkersInitializer : public WebGLContextAttributesWorkers {
  WebGLContextAttributesWorkersInitializer() {
    // Safe to pass a null context if we pass a null value
    Init(nullptr, JS::NullValue());
  }
};

struct WebGLContextAttributes : public MainThreadDictionaryBase {
  WebGLContextAttributes() {}
  bool Init(JSContext* cx, const JS::Value& val);
  bool ToObject(JSContext* cx, JSObject* parentObject, JS::Value *vp);

  bool Init(const nsAString& aJSON)
  {
    mozilla::Maybe<JSAutoRequest> ar;
    mozilla::Maybe<JSAutoCompartment> ac;
    jsval json = JSVAL_VOID;
    JSContext* cx = ParseJSON(aJSON, ar, ac, json);
    NS_ENSURE_TRUE(cx, false);
    return Init(cx, json);
  }

  bool alpha;
  bool antialias;
  bool depth;
  bool premultipliedAlpha;
  bool preserveDrawingBuffer;
  bool stencil;
private:
  // Disallow copy-construction
  WebGLContextAttributes(const WebGLContextAttributes&) MOZ_DELETE;
  static bool InitIds(JSContext* cx);
  static bool initedIds;
  static jsid alpha_id;
  static jsid antialias_id;
  static jsid depth_id;
  static jsid premultipliedAlpha_id;
  static jsid preserveDrawingBuffer_id;
  static jsid stencil_id;
};
struct WebGLContextAttributesInitializer : public WebGLContextAttributes {
  WebGLContextAttributesInitializer() {
    // Safe to pass a null context if we pass a null value
    Init(nullptr, JS::NullValue());
  }
};

namespace WebGLActiveInfoBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLActiveInfo];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLActiveInfo] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  bool
  DefineDOMInterface(JSContext* aCx, JSObject* aReceiver, bool* aEnabled);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLActiveInfo* aObject);

} // namespace WebGLActiveInfoBinding



namespace WebGLBufferBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLBuffer];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLBuffer] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  bool
  DefineDOMInterface(JSContext* aCx, JSObject* aReceiver, bool* aEnabled);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLBuffer* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLBufferBinding



namespace WebGLExtensionCompressedTextureATCBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLExtensionCompressedTextureATC];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLExtensionCompressedTextureATC] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLExtensionCompressedTextureATC* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLExtensionCompressedTextureATCBinding



namespace WebGLExtensionCompressedTexturePVRTCBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLExtensionCompressedTexturePVRTC];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLExtensionCompressedTexturePVRTC] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLExtensionCompressedTexturePVRTC* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLExtensionCompressedTexturePVRTCBinding



namespace WebGLExtensionCompressedTextureS3TCBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLExtensionCompressedTextureS3TC];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLExtensionCompressedTextureS3TC] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLExtensionCompressedTextureS3TC* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLExtensionCompressedTextureS3TCBinding



namespace WebGLExtensionDebugRendererInfoBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLExtensionDebugRendererInfo];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLExtensionDebugRendererInfo] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLExtensionDebugRendererInfo* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLExtensionDebugRendererInfoBinding



namespace WebGLExtensionDepthTextureBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLExtensionDepthTexture];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLExtensionDepthTexture] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLExtensionDepthTexture* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLExtensionDepthTextureBinding



namespace WebGLExtensionLoseContextBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLExtensionLoseContext];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLExtensionLoseContext] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLExtensionLoseContext* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLExtensionLoseContextBinding



namespace WebGLExtensionStandardDerivativesBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLExtensionStandardDerivatives];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLExtensionStandardDerivatives] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLExtensionStandardDerivatives* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLExtensionStandardDerivativesBinding



namespace WebGLExtensionTextureFilterAnisotropicBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLExtensionTextureFilterAnisotropic];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLExtensionTextureFilterAnisotropic] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLExtensionTextureFilterAnisotropic* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLExtensionTextureFilterAnisotropicBinding



namespace WebGLExtensionTextureFloatBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLExtensionTextureFloat];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLExtensionTextureFloat] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLExtensionTextureFloat* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLExtensionTextureFloatBinding



namespace WebGLFramebufferBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLFramebuffer];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLFramebuffer] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  bool
  DefineDOMInterface(JSContext* aCx, JSObject* aReceiver, bool* aEnabled);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLFramebuffer* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLFramebufferBinding



namespace WebGLProgramBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLProgram];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLProgram] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  bool
  DefineDOMInterface(JSContext* aCx, JSObject* aReceiver, bool* aEnabled);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLProgram* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLProgramBinding



namespace WebGLRenderbufferBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLRenderbuffer];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLRenderbuffer] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  bool
  DefineDOMInterface(JSContext* aCx, JSObject* aReceiver, bool* aEnabled);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLRenderbuffer* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLRenderbufferBinding



namespace WebGLRenderingContextBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLRenderingContext];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLRenderingContext] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  bool
  DefineDOMInterface(JSContext* aCx, JSObject* aReceiver, bool* aEnabled);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLContext* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLRenderingContextBinding



namespace WebGLShaderBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLShader];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLShader] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  bool
  DefineDOMInterface(JSContext* aCx, JSObject* aReceiver, bool* aEnabled);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLShader* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLShaderBinding



namespace WebGLShaderPrecisionFormatBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLShaderPrecisionFormat];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLShaderPrecisionFormat] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  bool
  DefineDOMInterface(JSContext* aCx, JSObject* aReceiver, bool* aEnabled);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLShaderPrecisionFormat* aObject);

} // namespace WebGLShaderPrecisionFormatBinding



namespace WebGLTextureBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLTexture];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLTexture] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  bool
  DefineDOMInterface(JSContext* aCx, JSObject* aReceiver, bool* aEnabled);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLTexture* aObject, nsWrapperCache* aCache, bool* aTriedToWrap);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, JSObject* aScope, T* aObject, bool* aTriedToWrap)
  {
    return Wrap(aCx, aScope, aObject, aObject, aTriedToWrap);
  }

} // namespace WebGLTextureBinding



namespace WebGLUniformLocationBinding {

  JSObject*
  CreateInterfaceObjects(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver);

  inline JSObject* GetProtoObject(JSContext* aCx, JSObject* aGlobal, JSObject* aReceiver)
  {

    /* Get the interface prototype object for this class.  This will create the
       object as needed. */

    /* aGlobal and aReceiver are usually the same, but they can be different
       too. For example a sandbox often has an xray wrapper for a window as the
       prototype of the sandbox's global. In that case aReceiver is the xray
       wrapper and aGlobal is the sandbox's global.
     */

    /* Make sure our global is sane.  Hopefully we can remove this sometime */
    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
      return NULL;
    }
    /* Check to see whether the interface objects are already installed */
    JSObject** protoOrIfaceArray = GetProtoOrIfaceArray(aGlobal);
    JSObject* cachedObject = protoOrIfaceArray[prototypes::id::WebGLUniformLocation];
    if (!cachedObject) {
      protoOrIfaceArray[prototypes::id::WebGLUniformLocation] = cachedObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
    }

    /* cachedObject might _still_ be null, but that's OK */
    return cachedObject;
  }

  bool
  ResolveProperty(JSContext* cx, JSObject* wrapper, jsid id, bool set, JSPropertyDescriptor* desc);

  bool
  EnumerateProperties(JSContext* cx, JSObject* wrapper, JS::AutoIdVector& props);

  bool
  DefineDOMInterface(JSContext* aCx, JSObject* aReceiver, bool* aEnabled);

  extern const NativePropertyHooks NativeHooks;

  extern DOMJSClass Class;

  JSObject*
  Wrap(JSContext* aCx, JSObject* aScope, mozilla::WebGLUniformLocation* aObject);

} // namespace WebGLUniformLocationBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_WebGLRenderingContextBinding_h__
