From 519ddef8c6cbb112102bb02fc5dda31684b3ac98 Mon Sep 17 00:00:00 2001 From: "pnunn%netscape.com" Date: Tue, 1 Jun 1999 21:53:12 +0000 Subject: [PATCH] move kISupportsIID declaration local. pnunn. git-svn-id: svn://10.0.0.236/trunk@33340 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/modules/libimg/gifcom/nsGIFCallback.cpp | 4 +++- mozilla/modules/libimg/gifcom/nsGIFDecoder.cpp | 12 ++++++++++-- mozilla/modules/libimg/jpgcom/nsJPGDecoder.cpp | 10 ++++++++-- mozilla/modules/libimg/pngcom/nsPNGDecoder.cpp | 10 +++++++--- mozilla/modules/libimg/public_com/nsImgDecCID.h | 5 ----- 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/mozilla/modules/libimg/gifcom/nsGIFCallback.cpp b/mozilla/modules/libimg/gifcom/nsGIFCallback.cpp index 91f1b9f90dc..fc0b4ae77d5 100644 --- a/mozilla/modules/libimg/gifcom/nsGIFCallback.cpp +++ b/mozilla/modules/libimg/gifcom/nsGIFCallback.cpp @@ -37,7 +37,9 @@ NS_IMETHODIMP GIFCallbk::QueryInterface(const nsIID& aIID, void** aResult) if (NULL == aResult) { return NS_ERROR_NULL_POINTER; } - + +NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + if ( aIID.Equals(kGIFCallbkIID) || aIID.Equals(kImgDCallbkIID)|| aIID.Equals(kISupportsIID)) { diff --git a/mozilla/modules/libimg/gifcom/nsGIFDecoder.cpp b/mozilla/modules/libimg/gifcom/nsGIFDecoder.cpp index 791df32cb8e..4e1f65c97f1 100644 --- a/mozilla/modules/libimg/gifcom/nsGIFDecoder.cpp +++ b/mozilla/modules/libimg/gifcom/nsGIFDecoder.cpp @@ -83,6 +83,7 @@ GIFDecoder::~GIFDecoder(void) NS_ASSERTION(mRefCnt == 0, "non-zero refcnt at destruction"); }; + NS_IMPL_ADDREF(GIFDecoder) NS_IMPL_RELEASE(GIFDecoder) @@ -93,6 +94,8 @@ GIFDecoder::QueryInterface(const nsIID& aIID, void** aInstPtr) return NS_ERROR_NULL_POINTER; } +NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + if (aIID.Equals(kGIFDecoderIID) || aIID.Equals(kImgDecoderIID) || aIID.Equals(kISupportsIID)) { @@ -129,9 +132,9 @@ private: nsGIFDecFactory* gFactory = NULL; +NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); NS_IMPL_ISUPPORTS(nsGIFDecFactory, kIFactoryIID) - nsGIFDecFactory::nsGIFDecFactory(const nsCID &aClass) { NS_INIT_REFCNT(); @@ -140,8 +143,11 @@ nsGIFDecFactory::nsGIFDecFactory(const nsCID &aClass) nsGIFDecFactory::~nsGIFDecFactory(void) { + NS_ASSERTION(mRefCnt == 0, "non-zero refcnt at destruction"); } + + /*----------------------------------for autoregistration ----*/ static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID); @@ -198,7 +204,9 @@ nsGIFDecFactory::CreateInstance(nsISupports *aOuter, GIFDecoder *gifdec = NULL; *ppv = NULL; il_container* ic = NULL; - + +NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + if (aOuter && !aIID.Equals(kISupportsIID)) return NS_NOINTERFACE; ic = new il_container(); diff --git a/mozilla/modules/libimg/jpgcom/nsJPGDecoder.cpp b/mozilla/modules/libimg/jpgcom/nsJPGDecoder.cpp index 43efc3a3d93..458607c1495 100644 --- a/mozilla/modules/libimg/jpgcom/nsJPGDecoder.cpp +++ b/mozilla/modules/libimg/jpgcom/nsJPGDecoder.cpp @@ -93,7 +93,9 @@ JPGDecoder::QueryInterface(const nsIID& aIID, void** aInstPtr) if (NULL == aInstPtr) { return NS_ERROR_NULL_POINTER; } - + +NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + if (aIID.Equals(kJPGDecoderIID) || aIID.Equals(kImgDecoderIID) || aIID.Equals(kISupportsIID)) { @@ -177,6 +179,8 @@ private: /*-----------------------------------------*/ nsJPGDecFactory* gFactory = NULL; + +NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); NS_IMPL_ISUPPORTS(nsJPGDecFactory, kIFactoryIID); @@ -200,7 +204,9 @@ nsJPGDecFactory::CreateInstance(nsISupports *aOuter, JPGDecoder *jpgdec = NULL; *ppv = NULL; il_container* ic = NULL; - + +NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + if (aOuter && !aIID.Equals(kISupportsIID)) return NS_NOINTERFACE; ic = new il_container(); diff --git a/mozilla/modules/libimg/pngcom/nsPNGDecoder.cpp b/mozilla/modules/libimg/pngcom/nsPNGDecoder.cpp index fa4741154c1..311f25b2c1b 100644 --- a/mozilla/modules/libimg/pngcom/nsPNGDecoder.cpp +++ b/mozilla/modules/libimg/pngcom/nsPNGDecoder.cpp @@ -90,7 +90,9 @@ PNGDecoder::QueryInterface(const nsIID& aIID, void** aInstPtr) if (NULL == aInstPtr) { return NS_ERROR_NULL_POINTER; } - + +NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + if (aIID.Equals(kPNGDecoderIID) || aIID.Equals(kImgDecoderIID) || aIID.Equals(kISupportsIID)) { @@ -130,7 +132,7 @@ private: nsPNGDecFactory* gFactory = NULL; - +NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); NS_IMPL_ISUPPORTS(nsPNGDecFactory, kIFactoryIID) @@ -200,7 +202,9 @@ nsPNGDecFactory::CreateInstance(nsISupports *aOuter, PNGDecoder *pngdec = NULL; *ppv = NULL; il_container* ic = NULL; - + +NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + if (aOuter && !aIID.Equals(kISupportsIID)) return NS_NOINTERFACE; ic = new il_container(); diff --git a/mozilla/modules/libimg/public_com/nsImgDecCID.h b/mozilla/modules/libimg/public_com/nsImgDecCID.h index ddf30cf8c12..b76da8a5362 100644 --- a/mozilla/modules/libimg/public_com/nsImgDecCID.h +++ b/mozilla/modules/libimg/public_com/nsImgDecCID.h @@ -44,11 +44,6 @@ NS_DEFINE_IID(kImgDecoderCID, NS_IMGDECODER_CID); /***************************************************/ -NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); - -/***************************************************/ - /* e41ac650-cd9f-11d2-802c-0060088f91a3 */ #define NS_IMGDCALLBK_CID \ { 0xe41ac650, 0xcd9f, 0x11d2, \