From 057eaef9e2b3dc051f2d129d6c80c71df26dfa5b Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Mon, 18 Feb 2002 22:57:47 +0000 Subject: [PATCH] remove a bunch of dead code, and remove NS_COM from a bunch of concrete classes that weren't being used previously r=jag, sr=shaver git-svn-id: svn://10.0.0.236/trunk@114820 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/build/dlldeps.cpp | 2 - .../components/nsComponentManagerUtils.h | 2 +- .../xpcom/components/nsIServiceManagerUtils.h | 2 +- mozilla/xpcom/ds/MANIFEST | 1 - mozilla/xpcom/ds/Makefile.in | 2 - mozilla/xpcom/ds/makefile.win | 2 - mozilla/xpcom/ds/nsSupportsArrayEnumerator.h | 2 +- mozilla/xpcom/glue/nsComponentManagerUtils.h | 2 +- mozilla/xpcom/glue/nsServiceManagerUtils.h | 2 +- mozilla/xpcom/io/MANIFEST | 1 - mozilla/xpcom/io/makefile.win | 2 - mozilla/xpcom/io/nsBinaryStream.h | 4 +- mozilla/xpcom/io/nsFastLoadFile.h | 6 +- mozilla/xpcom/io/nsFastLoadService.h | 2 +- mozilla/xpcom/io/nsFileStream.cpp | 47 --------------- mozilla/xpcom/io/nsFileStream.h | 48 --------------- mozilla/xpcom/io/nsStorageStream.h | 2 +- mozilla/xpcom/macbuild/xpcomPPC.xml | 60 ------------------- mozilla/xpcom/tests/Makefile.in | 1 - mozilla/xpcom/tests/makefile.win | 3 - 20 files changed, 12 insertions(+), 181 deletions(-) diff --git a/mozilla/xpcom/build/dlldeps.cpp b/mozilla/xpcom/build/dlldeps.cpp index e6b0c917e92..2f971582753 100644 --- a/mozilla/xpcom/build/dlldeps.cpp +++ b/mozilla/xpcom/build/dlldeps.cpp @@ -39,7 +39,6 @@ // the dll that are located in the .lib files we link with #include "nsVoidArray.h" -#include "nsVoidBTree.h" #include "nsValueArray.h" #include "nsIAtom.h" #include "nsFileSpec.h" @@ -115,7 +114,6 @@ void XXXNeverCalled() dummyComparitor dummy; nsVoidArray(); nsSmallVoidArray(); - nsVoidBTree(); nsValueArray(0); nsAVLTree(dummy, nsnull); nsSupportsArray(); diff --git a/mozilla/xpcom/components/nsComponentManagerUtils.h b/mozilla/xpcom/components/nsComponentManagerUtils.h index 94eab8380da..bf3d78f9771 100644 --- a/mozilla/xpcom/components/nsComponentManagerUtils.h +++ b/mozilla/xpcom/components/nsComponentManagerUtils.h @@ -78,7 +78,7 @@ private: nsresult* mErrorPtr; }; -class NS_COM nsCreateInstanceFromCategory : public nsCOMPtr_helper +class nsCreateInstanceFromCategory : public nsCOMPtr_helper { public: nsCreateInstanceFromCategory(const char *aCategory, const char *aEntry, diff --git a/mozilla/xpcom/components/nsIServiceManagerUtils.h b/mozilla/xpcom/components/nsIServiceManagerUtils.h index a3cd61a1cfd..bfded8c615c 100644 --- a/mozilla/xpcom/components/nsIServiceManagerUtils.h +++ b/mozilla/xpcom/components/nsIServiceManagerUtils.h @@ -113,7 +113,7 @@ do_GetService( const char* aContractID, nsISupports* aServiceManager, nsresult* return nsGetServiceByContractID(aContractID, aServiceManager, error); } -class NS_COM nsGetServiceFromCategory : public nsCOMPtr_helper +class nsGetServiceFromCategory : public nsCOMPtr_helper { public: nsGetServiceFromCategory(const char* aCategory, const char* aEntry, diff --git a/mozilla/xpcom/ds/MANIFEST b/mozilla/xpcom/ds/MANIFEST index f3e66f6a35e..767b169d28c 100644 --- a/mozilla/xpcom/ds/MANIFEST +++ b/mozilla/xpcom/ds/MANIFEST @@ -24,7 +24,6 @@ nsValueArray.h nsVariant.h nsVector.h nsVoidArray.h -nsVoidBTree.h pldhash.h plvector.h nsTextFormatter.h diff --git a/mozilla/xpcom/ds/Makefile.in b/mozilla/xpcom/ds/Makefile.in index 8d32137c74d..29662094c2c 100644 --- a/mozilla/xpcom/ds/Makefile.in +++ b/mozilla/xpcom/ds/Makefile.in @@ -68,7 +68,6 @@ CPPSRCS = \ nsUnicharBuffer.cpp \ nsVariant.cpp \ nsVoidArray.cpp \ - nsVoidBTree.cpp \ nsTextFormatter.cpp \ nsTimelineService.cpp \ nsValueArray.cpp \ @@ -101,7 +100,6 @@ EXPORTS = \ nsVariant.h \ nsVector.h \ nsVoidArray.h \ - nsVoidBTree.h \ pldhash.h \ plvector.h \ nsTextFormatter.h \ diff --git a/mozilla/xpcom/ds/makefile.win b/mozilla/xpcom/ds/makefile.win index 84d9170d875..18de009b783 100644 --- a/mozilla/xpcom/ds/makefile.win +++ b/mozilla/xpcom/ds/makefile.win @@ -56,7 +56,6 @@ EXPORTS = \ nsVariant.h \ nsVector.h \ nsVoidArray.h \ - nsVoidBTree.h \ nsValueArray.h \ pldhash.h \ plvector.h \ @@ -122,7 +121,6 @@ CPP_OBJS = \ .\$(OBJDIR)\nsUnicharBuffer.obj \ .\$(OBJDIR)\nsVariant.obj \ .\$(OBJDIR)\nsVoidArray.obj \ - .\$(OBJDIR)\nsVoidBTree.obj \ .\$(OBJDIR)\nsValueArray.obj \ .\$(OBJDIR)\pldhash.obj \ .\$(OBJDIR)\plvector.obj \ diff --git a/mozilla/xpcom/ds/nsSupportsArrayEnumerator.h b/mozilla/xpcom/ds/nsSupportsArrayEnumerator.h index db1e42ce740..18293740e0e 100644 --- a/mozilla/xpcom/ds/nsSupportsArrayEnumerator.h +++ b/mozilla/xpcom/ds/nsSupportsArrayEnumerator.h @@ -42,7 +42,7 @@ class nsISupportsArray; -class NS_COM nsSupportsArrayEnumerator : public nsIBidirectionalEnumerator { +class nsSupportsArrayEnumerator : public nsIBidirectionalEnumerator { public: NS_DECL_ISUPPORTS diff --git a/mozilla/xpcom/glue/nsComponentManagerUtils.h b/mozilla/xpcom/glue/nsComponentManagerUtils.h index 94eab8380da..bf3d78f9771 100644 --- a/mozilla/xpcom/glue/nsComponentManagerUtils.h +++ b/mozilla/xpcom/glue/nsComponentManagerUtils.h @@ -78,7 +78,7 @@ private: nsresult* mErrorPtr; }; -class NS_COM nsCreateInstanceFromCategory : public nsCOMPtr_helper +class nsCreateInstanceFromCategory : public nsCOMPtr_helper { public: nsCreateInstanceFromCategory(const char *aCategory, const char *aEntry, diff --git a/mozilla/xpcom/glue/nsServiceManagerUtils.h b/mozilla/xpcom/glue/nsServiceManagerUtils.h index a3cd61a1cfd..bfded8c615c 100644 --- a/mozilla/xpcom/glue/nsServiceManagerUtils.h +++ b/mozilla/xpcom/glue/nsServiceManagerUtils.h @@ -113,7 +113,7 @@ do_GetService( const char* aContractID, nsISupports* aServiceManager, nsresult* return nsGetServiceByContractID(aContractID, aServiceManager, error); } -class NS_COM nsGetServiceFromCategory : public nsCOMPtr_helper +class nsGetServiceFromCategory : public nsCOMPtr_helper { public: nsGetServiceFromCategory(const char* aCategory, const char* aEntry, diff --git a/mozilla/xpcom/io/MANIFEST b/mozilla/xpcom/io/MANIFEST index bd1e4a947bd..40a4223be6f 100644 --- a/mozilla/xpcom/io/MANIFEST +++ b/mozilla/xpcom/io/MANIFEST @@ -5,7 +5,6 @@ nsFileStream.h nsIFileStream.h nsIUnicharInputStream.h nsSpecialSystemDirectory.h -nsStorageStream.h nsLocalFile.h nsLocalFileMac.h nsDirectoryService.h diff --git a/mozilla/xpcom/io/makefile.win b/mozilla/xpcom/io/makefile.win index ce41b2cdd28..430bf547919 100644 --- a/mozilla/xpcom/io/makefile.win +++ b/mozilla/xpcom/io/makefile.win @@ -42,7 +42,6 @@ EXPORTS = \ nsLinebreakConverter.h \ nsScriptableInputStream.h \ nsSpecialSystemDirectory.h \ - nsStorageStream.h \ nsStringIO.h \ $(NULL) @@ -103,7 +102,6 @@ CPP_OBJS = \ .\$(OBJDIR)\nsScriptableInputStream.obj \ .\$(OBJDIR)\nsSegmentedBuffer.obj \ .\$(OBJDIR)\nsSpecialSystemDirectory.obj \ - .\$(OBJDIR)\nsStorageStream.obj \ .\$(OBJDIR)\nsUnicharInputStream.obj \ $(NULL) diff --git a/mozilla/xpcom/io/nsBinaryStream.h b/mozilla/xpcom/io/nsBinaryStream.h index f671faea284..33d53cb6127 100644 --- a/mozilla/xpcom/io/nsBinaryStream.h +++ b/mozilla/xpcom/io/nsBinaryStream.h @@ -29,7 +29,7 @@ // Derive from nsIObjectOutputStream so this class can be used as a superclass // by nsObjectOutputStream. -class NS_COM nsBinaryOutputStream : public nsIObjectOutputStream +class nsBinaryOutputStream : public nsIObjectOutputStream { public: nsBinaryOutputStream(nsIOutputStream *aStream); @@ -57,7 +57,7 @@ protected: // Derive from nsIObjectInputStream so this class can be used as a superclass // by nsObjectInputStream. -class NS_COM nsBinaryInputStream : public nsIObjectInputStream +class nsBinaryInputStream : public nsIObjectInputStream { public: nsBinaryInputStream(nsIInputStream *aStream); diff --git a/mozilla/xpcom/io/nsFastLoadFile.h b/mozilla/xpcom/io/nsFastLoadFile.h index fe8d60b220c..2cff50ed2bb 100644 --- a/mozilla/xpcom/io/nsFastLoadFile.h +++ b/mozilla/xpcom/io/nsFastLoadFile.h @@ -239,7 +239,7 @@ struct nsIFastLoadFileReader : public nsISupports { * Though the names are not as clear as I'd like, this seems to be the best * way to share nsBinaryStream.cpp code. */ -class NS_COM nsFastLoadFileReader +class nsFastLoadFileReader : public nsBinaryInputStream, public nsIFastLoadReadControl, public nsISeekableStream, @@ -380,7 +380,7 @@ NS_NewFastLoadFileReader(nsIObjectInputStream* *aResult, * Though the names are not as clear as I'd like, this seems to be the best * way to share nsBinaryStream.cpp code. */ -class NS_COM nsFastLoadFileWriter +class nsFastLoadFileWriter : public nsBinaryOutputStream, public nsIFastLoadWriteControl, public nsISeekableStream @@ -500,7 +500,7 @@ NS_NewFastLoadFileWriter(nsIObjectOutputStream* *aResult, * the updater writes new data over the old footer, then writes a new footer * that maps all data on Close. */ -class NS_COM nsFastLoadFileUpdater +class nsFastLoadFileUpdater : public nsFastLoadFileWriter, nsIFastLoadFileIO { diff --git a/mozilla/xpcom/io/nsFastLoadService.h b/mozilla/xpcom/io/nsFastLoadService.h index 87ece5cdb33..534edf3394b 100644 --- a/mozilla/xpcom/io/nsFastLoadService.h +++ b/mozilla/xpcom/io/nsFastLoadService.h @@ -46,7 +46,7 @@ class nsFastLoadFileReader; class nsFastLoadFileWriter; -class NS_COM nsFastLoadService : public nsIFastLoadService +class nsFastLoadService : public nsIFastLoadService { public: nsFastLoadService(); diff --git a/mozilla/xpcom/io/nsFileStream.cpp b/mozilla/xpcom/io/nsFileStream.cpp index ba3c3443cb2..f38ec090d5a 100644 --- a/mozilla/xpcom/io/nsFileStream.cpp +++ b/mozilla/xpcom/io/nsFileStream.cpp @@ -392,53 +392,6 @@ void nsOutputFileStream::abort() close(); } -//======================================================================================== -// nsSaveViaTempStream -//======================================================================================== - -//---------------------------------------------------------------------------------------- -nsSaveViaTempStream::nsSaveViaTempStream(const nsFileSpec& inFileToSave) -//---------------------------------------------------------------------------------------- - : mFileToSave(inFileToSave) - , mTempFileSpec(new nsFileSpec(inFileToSave)) -{ - // Make sure the temp file's unique (in particular, different from the target file) - mTempFileSpec->MakeUnique(); - open(*mTempFileSpec, (PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE), 0666); -} // nsSaveViaTempStream::nsSaveViaTempStream - -//---------------------------------------------------------------------------------------- -void nsSaveViaTempStream::close() -//---------------------------------------------------------------------------------------- -{ - if (!mTempFileSpec) - return; - nsresult currentResult = mResult; - Inherited::close(); - mResult = currentResult; - if (error()) - { - mTempFileSpec->Delete(PR_FALSE); - } - else - { - nsFileSpec thirdSpec(mFileToSave); - thirdSpec.MakeUnique(); - nsSimpleCharString originalName(mFileToSave.GetLeafName()); - ((nsFileSpec&)mFileToSave).Rename(nsSimpleCharString(thirdSpec.GetLeafName())); - if (NS_SUCCEEDED(mTempFileSpec->Rename(originalName)) && mTempFileSpec->Valid()) - mFileToSave.Delete(PR_FALSE); - } - delete mTempFileSpec; -} // nsSaveViaTempStream::~nsSaveViaTempStream - -//---------------------------------------------------------------------------------------- -nsSaveViaTempStream::~nsSaveViaTempStream() -//---------------------------------------------------------------------------------------- -{ - delete mTempFileSpec; -} // nsSaveViaTempStream::~nsSaveViaTempStream - //======================================================================================== // Manipulators //======================================================================================== diff --git a/mozilla/xpcom/io/nsFileStream.h b/mozilla/xpcom/io/nsFileStream.h index 32901ea4a30..0b20a835193 100644 --- a/mozilla/xpcom/io/nsFileStream.h +++ b/mozilla/xpcom/io/nsFileStream.h @@ -854,52 +854,4 @@ protected: NS_COM nsOutputStream& nsEndl(nsOutputStream& os); // outputs and FLUSHES. //======================================================================================== -class NS_COM nsSaveViaTempStream -// The interface looks like a stream class, but in fact it streams to a temp file, and -// finally renames if the output succeeded. -//======================================================================================== - : public nsOutputFileStream -{ -private: - - typedef nsOutputFileStream Inherited; - -public: - nsSaveViaTempStream(const nsFileSpec& inFileToSave); - ~nsSaveViaTempStream(); - virtual void close(); - - // Output streamers. Unfortunately, they don't inherit! - nsOutputStream& operator << (const char* buf) - { return nsOutputStream::operator << (buf); } - nsOutputStream& operator << (char ch) - { return nsOutputStream::operator << (ch); } - nsOutputStream& operator << (short val) - { return nsOutputStream::operator << (val); } - nsOutputStream& operator << (unsigned short val) - { return nsOutputStream::operator << (val); } - nsOutputStream& operator << (long val) - { return nsOutputStream::operator << (val); } - nsOutputStream& operator << (unsigned long val) - { return nsOutputStream::operator << (val); } - nsOutputStream& operator << (int val) - { return nsOutputStream::operator << (val); } - nsOutputStream& operator << (unsigned int val) - { return nsOutputStream::operator << (val); } - nsOutputStream& operator << (nsOutputStream& (*pf)(nsOutputStream&)) - { return nsOutputStream::operator << (pf); } - -private: - - // private and unimplemented to disallow copies and assigns - nsSaveViaTempStream(const nsSaveViaTempStream& rhs); - nsSaveViaTempStream& operator=(const nsSaveViaTempStream& rhs); - - -protected: - - const nsFileSpec& mFileToSave; - nsFileSpec* mTempFileSpec; -}; // class nsSaveViaTempStream - #endif /* _FILESTREAM_H_ */ diff --git a/mozilla/xpcom/io/nsStorageStream.h b/mozilla/xpcom/io/nsStorageStream.h index 1b10618f7ba..0eb6b1386b6 100644 --- a/mozilla/xpcom/io/nsStorageStream.h +++ b/mozilla/xpcom/io/nsStorageStream.h @@ -36,7 +36,7 @@ class nsSegmentedBuffer; -class NS_COM nsStorageStream : public nsIStorageStream, +class nsStorageStream : public nsIStorageStream, public nsIOutputStream { public: diff --git a/mozilla/xpcom/macbuild/xpcomPPC.xml b/mozilla/xpcom/macbuild/xpcomPPC.xml index 9fe8e11577e..c0f0411416a 100644 --- a/mozilla/xpcom/macbuild/xpcomPPC.xml +++ b/mozilla/xpcom/macbuild/xpcomPPC.xml @@ -1520,13 +1520,6 @@ Text Debug - - Name - nsStorageStream.cpp - MacOS - Text - Debug - Name nsBinaryStream.cpp @@ -1723,13 +1716,6 @@ Text Debug - - Name - nsVoidBTree.cpp - MacOS - Text - Debug - Name nsStatistics.cpp @@ -2248,11 +2234,6 @@ nsLeakDetector.cpp MacOS - - Name - nsStorageStream.cpp - MacOS - Name nsBinaryStream.cpp @@ -2388,11 +2369,6 @@ nsMemoryImpl.cpp MacOS - - Name - nsVoidBTree.cpp - MacOS - Name nsStatistics.cpp @@ -3984,13 +3960,6 @@ Text Debug - - Name - nsStorageStream.cpp - MacOS - Text - Debug - Name nsBinaryStream.cpp @@ -4187,13 +4156,6 @@ Text Debug - - Name - nsVoidBTree.cpp - MacOS - Text - Debug - Name nsStatistics.cpp @@ -4717,11 +4679,6 @@ nsLeakDetector.cpp MacOS - - Name - nsStorageStream.cpp - MacOS - Name nsBinaryStream.cpp @@ -4857,11 +4814,6 @@ nsMemoryImpl.cpp MacOS - - Name - nsVoidBTree.cpp - MacOS - Name nsStatistics.cpp @@ -5314,12 +5266,6 @@ nsValueArray.cpp MacOS - - xpcom.shlb - Name - nsVoidBTree.cpp - MacOS - xpcom.shlb Name @@ -5454,12 +5400,6 @@ nsUnicharInputStream.cpp MacOS - - xpcom.shlb - Name - nsStorageStream.cpp - MacOS - xpcom.shlb Name diff --git a/mozilla/xpcom/tests/Makefile.in b/mozilla/xpcom/tests/Makefile.in index 3db691014b6..e7ac88c862c 100644 --- a/mozilla/xpcom/tests/Makefile.in +++ b/mozilla/xpcom/tests/Makefile.in @@ -54,7 +54,6 @@ CPPSRCS = \ TestPipes.cpp \ TestServMgr.cpp \ TestThreads.cpp \ - TestVoidBTree.cpp \ TestXPIDLString.cpp \ $(NULL) diff --git a/mozilla/xpcom/tests/makefile.win b/mozilla/xpcom/tests/makefile.win index d2f824a71a1..06e23bb9eb8 100644 --- a/mozilla/xpcom/tests/makefile.win +++ b/mozilla/xpcom/tests/makefile.win @@ -47,7 +47,6 @@ PROG14 = .\$(OBJDIR)\TestObserverService.exe PROG16 = .\$(OBJDIR)\TestPipes.exe PROG17 = .\$(OBJDIR)\TestShutdown.exe PROG18 = .\$(OBJDIR)\TestStackCrawl.exe -PROG19 = .\$(OBJDIR)\TestVoidBTree.exe PROG20 = .\$(OBJDIR)\nsIFileEnumerator.exe PROG21 = .\$(OBJDIR)\TestCOMPtrEq.exe PROG22 = .\$(OBJDIR)\TestCallTemplates.exe @@ -71,7 +70,6 @@ PROGRAMS = $(PROG1) \ $(PROG16) \ $(PROG17) \ $(PROG18) \ - $(PROG19) \ $(PROG20) \ $(PROG21) \ $(PROG22) \ @@ -114,7 +112,6 @@ $(PROG14): $(OBJDIR) TestObserverService.cpp $(PROG16): $(OBJDIR) TestPipes.cpp $(PROG17): $(OBJDIR) TestShutdown.cpp $(PROG18): $(OBJDIR) TestStackCrawl.cpp -$(PROG19): $(OBJDIR) TestVoidBTree.cpp $(PROG20): $(OBJDIR) nsIFileEnumerator.cpp $(PROG21): $(OBJDIR) TestCOMPtrEq.cpp $(PROG22): $(OBJDIR) TestCallTemplates.cpp