зеркало из https://github.com/mozilla/pjs.git
Bug 705668 - Remove IIDs on WebGL implementation classes - r=ehsan
These IIDs were used in the past to check, using do_QueryInterface, that the objects passed to WebGL functions were really of the expected type. Now that WebGL classes are marked 'builtinclass' in the IDL and that check has been removed (see bug 638328), none of that is needed anymore.
This commit is contained in:
Родитель
6500f816de
Коммит
a2ce478b5f
|
@ -1270,7 +1270,6 @@ NS_IMPL_RELEASE(WebGLBuffer)
|
|||
DOMCI_DATA(WebGLBuffer, WebGLBuffer)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(WebGLBuffer)
|
||||
NS_INTERFACE_MAP_ENTRY(WebGLBuffer)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebGLBuffer)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLBuffer)
|
||||
|
@ -1282,7 +1281,6 @@ NS_IMPL_RELEASE(WebGLTexture)
|
|||
DOMCI_DATA(WebGLTexture, WebGLTexture)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(WebGLTexture)
|
||||
NS_INTERFACE_MAP_ENTRY(WebGLTexture)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebGLTexture)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLTexture)
|
||||
|
@ -1294,7 +1292,6 @@ NS_IMPL_RELEASE(WebGLProgram)
|
|||
DOMCI_DATA(WebGLProgram, WebGLProgram)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(WebGLProgram)
|
||||
NS_INTERFACE_MAP_ENTRY(WebGLProgram)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebGLProgram)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLProgram)
|
||||
|
@ -1306,7 +1303,6 @@ NS_IMPL_RELEASE(WebGLShader)
|
|||
DOMCI_DATA(WebGLShader, WebGLShader)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(WebGLShader)
|
||||
NS_INTERFACE_MAP_ENTRY(WebGLShader)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebGLShader)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLShader)
|
||||
|
@ -1318,7 +1314,6 @@ NS_IMPL_RELEASE(WebGLFramebuffer)
|
|||
DOMCI_DATA(WebGLFramebuffer, WebGLFramebuffer)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(WebGLFramebuffer)
|
||||
NS_INTERFACE_MAP_ENTRY(WebGLFramebuffer)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebGLFramebuffer)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLFramebuffer)
|
||||
|
@ -1330,7 +1325,6 @@ NS_IMPL_RELEASE(WebGLRenderbuffer)
|
|||
DOMCI_DATA(WebGLRenderbuffer, WebGLRenderbuffer)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(WebGLRenderbuffer)
|
||||
NS_INTERFACE_MAP_ENTRY(WebGLRenderbuffer)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebGLRenderbuffer)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLRenderbuffer)
|
||||
|
@ -1342,7 +1336,6 @@ NS_IMPL_RELEASE(WebGLUniformLocation)
|
|||
DOMCI_DATA(WebGLUniformLocation, WebGLUniformLocation)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(WebGLUniformLocation)
|
||||
NS_INTERFACE_MAP_ENTRY(WebGLUniformLocation)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebGLUniformLocation)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLUniformLocation)
|
||||
|
@ -1354,7 +1347,6 @@ NS_IMPL_RELEASE(WebGLActiveInfo)
|
|||
DOMCI_DATA(WebGLActiveInfo, WebGLActiveInfo)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(WebGLActiveInfo)
|
||||
NS_INTERFACE_MAP_ENTRY(WebGLActiveInfo)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebGLActiveInfo)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLActiveInfo)
|
||||
|
@ -1379,7 +1371,6 @@ NS_IMPL_RELEASE(WebGLExtension)
|
|||
DOMCI_DATA(WebGLExtension, WebGLExtension)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(WebGLExtension)
|
||||
NS_INTERFACE_MAP_ENTRY(WebGLExtension)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebGLExtension)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLExtension)
|
||||
|
@ -1391,8 +1382,6 @@ NS_IMPL_RELEASE(WebGLExtensionStandardDerivatives)
|
|||
DOMCI_DATA(WebGLExtensionStandardDerivatives, WebGLExtensionStandardDerivatives)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(WebGLExtensionStandardDerivatives)
|
||||
//NS_INTERFACE_MAP_ENTRY(WebGLExtensionStandardDerivatives)
|
||||
//NS_INTERFACE_MAP_ENTRY(WebGLExtension)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebGLExtensionStandardDerivatives)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, WebGLExtension)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLExtensionStandardDerivatives)
|
||||
|
|
|
@ -851,16 +851,12 @@ protected:
|
|||
PRUint32 mContextGeneration;
|
||||
};
|
||||
|
||||
#define WEBGLBUFFER_PRIVATE_IID \
|
||||
{0xd69f22e9, 0x6f98, 0x48bd, {0xb6, 0x94, 0x34, 0x17, 0xed, 0x06, 0x11, 0xab}}
|
||||
class WebGLBuffer :
|
||||
public nsIWebGLBuffer,
|
||||
public WebGLZeroingObject<8>, // almost never has more than 8 owners
|
||||
public WebGLContextBoundObject
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLBUFFER_PRIVATE_IID)
|
||||
|
||||
WebGLBuffer(WebGLContext *context, WebGLuint name) :
|
||||
WebGLContextBoundObject(context),
|
||||
mName(name), mDeleted(false), mHasEverBeenBound(false),
|
||||
|
@ -985,17 +981,13 @@ protected:
|
|||
void* mData; // in the case of an Element Array Buffer, we keep a copy.
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLBuffer, WEBGLBUFFER_PRIVATE_IID)
|
||||
|
||||
#define WEBGLTEXTURE_PRIVATE_IID \
|
||||
{0x4c19f189, 0x1f86, 0x4e61, {0x96, 0x21, 0x0a, 0x11, 0xda, 0x28, 0x10, 0xdd}}
|
||||
class WebGLTexture :
|
||||
public nsIWebGLTexture,
|
||||
public WebGLZeroingObject<8>, // almost never has more than 8 owners
|
||||
public WebGLContextBoundObject
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLTEXTURE_PRIVATE_IID)
|
||||
|
||||
WebGLTexture(WebGLContext *context, WebGLuint name) :
|
||||
WebGLContextBoundObject(context),
|
||||
|
@ -1425,18 +1417,12 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLTexture, WEBGLTEXTURE_PRIVATE_IID)
|
||||
|
||||
#define WEBGLSHADER_PRIVATE_IID \
|
||||
{0x48cce975, 0xd459, 0x4689, {0x83, 0x82, 0x37, 0x82, 0x6e, 0xac, 0xe0, 0xa7}}
|
||||
class WebGLShader :
|
||||
public nsIWebGLShader,
|
||||
public WebGLZeroingObject<8>, // almost never has more than 8 owners
|
||||
public WebGLContextBoundObject
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLSHADER_PRIVATE_IID)
|
||||
|
||||
WebGLShader(WebGLContext *context, WebGLuint name, WebGLenum stype) :
|
||||
WebGLContextBoundObject(context),
|
||||
mName(name), mDeleted(false), mType(stype),
|
||||
|
@ -1514,10 +1500,6 @@ protected:
|
|||
bool mDeletePending;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLShader, WEBGLSHADER_PRIVATE_IID)
|
||||
|
||||
#define WEBGLPROGRAM_PRIVATE_IID \
|
||||
{0xb3084a5b, 0xa5b4, 0x4ee0, {0xa0, 0xf0, 0xfb, 0xdd, 0x64, 0xaf, 0x8e, 0x82}}
|
||||
class WebGLProgram :
|
||||
public nsIWebGLProgram,
|
||||
public WebGLZeroingObject<8>, // can actually have many more owners (WebGLUniformLocations),
|
||||
|
@ -1526,7 +1508,6 @@ class WebGLProgram :
|
|||
public WebGLContextBoundObject
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLPROGRAM_PRIVATE_IID)
|
||||
|
||||
WebGLProgram(WebGLContext *context, WebGLuint name) :
|
||||
WebGLContextBoundObject(context),
|
||||
|
@ -1666,10 +1647,6 @@ protected:
|
|||
std::vector<bool> mAttribsInUse;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLProgram, WEBGLPROGRAM_PRIVATE_IID)
|
||||
|
||||
#define WEBGLRENDERBUFFER_PRIVATE_IID \
|
||||
{0x3cbc2067, 0x5831, 0x4e3f, {0xac, 0x52, 0x7e, 0xf4, 0x5c, 0x04, 0xff, 0xae}}
|
||||
class WebGLRenderbuffer :
|
||||
public nsIWebGLRenderbuffer,
|
||||
public WebGLZeroingObject<8>, // almost never has more than 8 owners
|
||||
|
@ -1677,7 +1654,6 @@ class WebGLRenderbuffer :
|
|||
public WebGLContextBoundObject
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLRENDERBUFFER_PRIVATE_IID)
|
||||
|
||||
WebGLRenderbuffer(WebGLContext *context, WebGLuint name, WebGLuint secondBufferName = 0) :
|
||||
WebGLContextBoundObject(context),
|
||||
|
@ -1745,8 +1721,6 @@ protected:
|
|||
friend class WebGLFramebuffer;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLRenderbuffer, WEBGLRENDERBUFFER_PRIVATE_IID)
|
||||
|
||||
class WebGLFramebufferAttachment
|
||||
: public WebGLRectangleObject
|
||||
{
|
||||
|
@ -1839,15 +1813,12 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
#define WEBGLFRAMEBUFFER_PRIVATE_IID \
|
||||
{0x0052a16f, 0x4bc9, 0x4a55, {0x9d, 0xa3, 0x54, 0x95, 0xaa, 0x4e, 0x80, 0xb9}}
|
||||
class WebGLFramebuffer :
|
||||
public nsIWebGLFramebuffer,
|
||||
public WebGLZeroingObject<8>, // almost never has more than 8 owners
|
||||
public WebGLContextBoundObject
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLFRAMEBUFFER_PRIVATE_IID)
|
||||
|
||||
WebGLFramebuffer(WebGLContext *context, WebGLuint name) :
|
||||
WebGLContextBoundObject(context),
|
||||
|
@ -2112,10 +2083,6 @@ protected:
|
|||
mDepthStencilAttachment;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLFramebuffer, WEBGLFRAMEBUFFER_PRIVATE_IID)
|
||||
|
||||
#define WEBGLUNIFORMLOCATION_PRIVATE_IID \
|
||||
{0x01a8a614, 0xb109, 0x42f1, {0xb4, 0x40, 0x8d, 0x8b, 0x87, 0x0b, 0x43, 0xa7}}
|
||||
class WebGLUniformLocation :
|
||||
public nsIWebGLUniformLocation,
|
||||
public WebGLZeroingObject<2>, // never saw a WebGLUniformLocation have more than 2 owners, and since these
|
||||
|
@ -2124,7 +2091,6 @@ class WebGLUniformLocation :
|
|||
public WebGLContextBoundObject
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLUNIFORMLOCATION_PRIVATE_IID)
|
||||
|
||||
WebGLUniformLocation(WebGLContext *context, WebGLProgram *program, GLint location) :
|
||||
WebGLContextBoundObject(context), mProgram(program), mProgramGeneration(program->Generation()),
|
||||
|
@ -2145,16 +2111,10 @@ protected:
|
|||
GLint mLocation;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLUniformLocation, WEBGLUNIFORMLOCATION_PRIVATE_IID)
|
||||
|
||||
#define WEBGLACTIVEINFO_PRIVATE_IID \
|
||||
{0x90def5ec, 0xc672, 0x4ac3, {0xb8, 0x97, 0x04, 0xa2, 0x6d, 0xda, 0x66, 0xd7}}
|
||||
class WebGLActiveInfo :
|
||||
public nsIWebGLActiveInfo
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLACTIVEINFO_PRIVATE_IID)
|
||||
|
||||
WebGLActiveInfo(WebGLint size, WebGLenum type, const char *nameptr, PRUint32 namelength) :
|
||||
mDeleted(false),
|
||||
mSize(size),
|
||||
|
@ -2180,10 +2140,7 @@ protected:
|
|||
nsString mName;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLActiveInfo, WEBGLACTIVEINFO_PRIVATE_IID)
|
||||
|
||||
#define WEBGLEXTENSION_PRIVATE_IID \
|
||||
{0x457dd0b2, 0x9f77, 0x4c23, {0x95, 0x70, 0x9d, 0x62, 0x65, 0xc1, 0xa4, 0x81}}
|
||||
class WebGLExtension :
|
||||
public nsIWebGLExtension,
|
||||
public WebGLContextBoundObject,
|
||||
|
@ -2198,12 +2155,8 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWEBGLEXTENSION
|
||||
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLEXTENSION_PRIVATE_IID)
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLExtension, WEBGLACTIVEINFO_PRIVATE_IID)
|
||||
|
||||
/**
|
||||
** Template implementations
|
||||
**/
|
||||
|
@ -2247,17 +2200,8 @@ WebGLContext::GetConcreteObject(const char *info,
|
|||
if (isNull)
|
||||
*isNull = false;
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
// once bug 694114 is implemented, we want to replace this by a static assertion, without #ifdef DEBUG
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<ConcreteObjectType> tmp(do_QueryInterface(aInterface, &rv));
|
||||
NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv),
|
||||
"QueryInterface failed. WebGL objects are builtinclass, so this should never happen. "
|
||||
"Please file a bug at bugzilla.mozilla.org -> Core -> Canvas:WebGL and link to the present page.");
|
||||
}
|
||||
#endif
|
||||
|
||||
// the key to why this static_cast is all we need to do (as opposed to the QueryInterface check we used to do)
|
||||
// is that since bug 638328, WebGL interfaces are marked 'builtinclass' in the IDL
|
||||
*aConcreteObject = static_cast<ConcreteObjectType*>(aInterface);
|
||||
|
||||
if (!(*aConcreteObject)->IsCompatibleWithContext(this)) {
|
||||
|
|
|
@ -44,8 +44,6 @@ namespace mozilla {
|
|||
class WebGLExtensionLoseContext;
|
||||
class WebGLExtensionStandardDerivatives;
|
||||
|
||||
#define WEBGLEXTENSIONLOSECONTEXT_PRIVATE_IID \
|
||||
{0xb0afc2eb, 0x0895, 0x4509, {0x98, 0xde, 0x5c, 0x38, 0x3d, 0x16, 0x06, 0x94}}
|
||||
class WebGLExtensionLoseContext :
|
||||
public nsIWebGLExtensionLoseContext,
|
||||
public WebGLExtension
|
||||
|
@ -56,14 +54,8 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWEBGLEXTENSIONLOSECONTEXT
|
||||
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLEXTENSIONLOSECONTEXT_PRIVATE_IID)
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLExtensionLoseContext, WEBGLACTIVEINFO_PRIVATE_IID)
|
||||
|
||||
#define WEBGLEXTENSIONSTANDARDDERIVATIVES_PRIVATE_IID \
|
||||
{0x3de3dfd9, 0x864a, 0x4e4c, {0x98, 0x9b, 0x29, 0x77, 0xea, 0xa8, 0x0b, 0x7b}}
|
||||
class WebGLExtensionStandardDerivatives :
|
||||
public nsIWebGLExtensionStandardDerivatives,
|
||||
public WebGLExtension
|
||||
|
@ -74,12 +66,8 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWEBGLEXTENSION
|
||||
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLEXTENSIONSTANDARDDERIVATIVES_PRIVATE_IID)
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLExtensionStandardDerivatives, WEBGLACTIVEINFO_PRIVATE_IID)
|
||||
|
||||
}
|
||||
|
||||
#endif // WEBGLEXTENSIONS_H_
|
||||
|
|
Загрузка…
Ссылка в новой задаче