work for bug 158003 and bug 157993 - tweak base support classes with a fake inner interface in debug builds, so we can use QI to determine if the class is based off any of these support classes.

no reviewer, not part of build
This commit is contained in:
alecf%netscape.com 2002-07-24 21:20:18 +00:00
parent 3497972462
commit 1ae76ec180
2 changed files with 37 additions and 1 deletions

View File

@ -66,7 +66,11 @@ nsBasicDecoderSupport::~nsBasicDecoderSupport()
NS_IMPL_ADDREF(nsBasicDecoderSupport);
NS_IMPL_RELEASE(nsBasicDecoderSupport);
#ifdef NS_DEBUG
NS_IMPL_QUERY_INTERFACE2(nsBasicDecoderSupport, nsIUnicodeDecoder, nsIBasicDecoder);
#else
NS_IMPL_QUERY_INTERFACE1(nsBasicDecoderSupport, nsIUnicodeDecoder)
#endif
//----------------------------------------------------------------------
// Interface nsIUnicodeDecoder [implementation]
@ -366,10 +370,15 @@ nsBasicEncoder::~nsBasicEncoder()
NS_IMPL_ADDREF(nsBasicEncoder);
NS_IMPL_RELEASE(nsBasicEncoder);
#ifdef NS_DEBUG
NS_IMPL_QUERY_INTERFACE3(nsBasicEncoder,
nsIUnicodeEncoder,
nsICharRepresentable, nsIBasicEncoder)
#else
NS_IMPL_QUERY_INTERFACE2(nsBasicEncoder,
nsIUnicodeEncoder,
nsICharRepresentable)
#endif
//----------------------------------------------------------------------
// Class nsEncoderSupport [implementation]

View File

@ -47,6 +47,27 @@
#define ONE_BYTE_TABLE_SIZE 256
#ifdef NS_DEBUG
// {7AFC9F0A-CFE1-44ea-A755-E3B86AB1226E}
#define NS_IBASICDECODER_IID \
{ 0x7afc9f0a, 0xcfe1, 0x44ea, { 0xa7, 0x55, 0xe3, 0xb8, 0x6a, 0xb1, 0x22, 0x6e } }
// {65968A7B-6467-4c4a-B50A-3E0C97A32F07}
#define NS_IBASICENCODER_IID \
{ 0x65968a7b, 0x6467, 0x4c4a, { 0xb5, 0xa, 0x3e, 0xc, 0x97, 0xa3, 0x2f, 0x7 } }
class nsIBasicDecoder : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IBASICDECODER_IID);
};
class nsIBasicEncoder : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IBASICENCODER_IID);
};
#endif
//----------------------------------------------------------------------
// Class nsBasicDecoderSupport [declaration]
@ -66,6 +87,9 @@
* @author Catalin Rotaru [CATA]
*/
class nsBasicDecoderSupport : public nsIUnicodeDecoder
#ifdef NS_DEBUG
,public nsIBasicDecoder
#endif
{
NS_DECL_ISUPPORTS
@ -265,6 +289,9 @@ protected:
// Class nsBasicEncoder [declaration]
class nsBasicEncoder : public nsIUnicodeEncoder, public nsICharRepresentable
#ifdef NS_DEBUG
,public nsIBasicEncoder
#endif
{
NS_DECL_ISUPPORTS