From 84da80ad5bc3e3eb13833fb366a5c46ebab7b4c7 Mon Sep 17 00:00:00 2001 From: "ruslan%netscape.com" Date: Wed, 22 Mar 2000 02:50:56 +0000 Subject: [PATCH] Enabling ByteArrayInputStream. Needed to fix 32600, r=warren git-svn-id: svn://10.0.0.236/trunk@63692 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/MANIFEST | 1 + mozilla/xpcom/io/MANIFEST_IDL | 1 + mozilla/xpcom/io/Makefile.in | 3 +++ mozilla/xpcom/io/makefile.win | 5 +++-- mozilla/xpcom/io/nsByteArrayInputStream.cpp | 5 +++-- mozilla/xpcom/io/nsByteArrayInputStream.h | 10 +++++----- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/mozilla/xpcom/io/MANIFEST b/mozilla/xpcom/io/MANIFEST index 7b80fd31eb2..f9b7fdc4ebc 100644 --- a/mozilla/xpcom/io/MANIFEST +++ b/mozilla/xpcom/io/MANIFEST @@ -11,3 +11,4 @@ nsStorageStream.h nsLocalFile.h nsLocalFileMac.h nsILocalFileMac.h +nsIByteArrayInputStream.h diff --git a/mozilla/xpcom/io/MANIFEST_IDL b/mozilla/xpcom/io/MANIFEST_IDL index b9ccb0ef887..95874e5cc56 100644 --- a/mozilla/xpcom/io/MANIFEST_IDL +++ b/mozilla/xpcom/io/MANIFEST_IDL @@ -6,3 +6,4 @@ nsIOutputStream.idl nsIPipe.idl nsIFile.idl nsILocalFile.idl +nsIByteArrayInputStream.idl diff --git a/mozilla/xpcom/io/Makefile.in b/mozilla/xpcom/io/Makefile.in index 754c2455d85..cfbee37d39d 100644 --- a/mozilla/xpcom/io/Makefile.in +++ b/mozilla/xpcom/io/Makefile.in @@ -50,6 +50,7 @@ CPPSRCS = \ nsBinaryStream.cpp \ nsStorageStream.cpp \ nsScriptableInputStream.cpp \ + nsByteArrayInputStream.cpp \ $(NULL) EXPORTS = \ @@ -67,6 +68,7 @@ EXPORTS = \ nsSpecialSystemDirectory.h \ nsScriptableInputStream.h \ nsStorageStream.h \ + nsIByteArrayInputStream.h \ $(NULL) XPIDLSRCS = \ @@ -84,6 +86,7 @@ XPIDLSRCS = \ nsIScriptableInputStream.idl \ nsIStorageStream.idl \ nsIDirectoryService.idl \ + nsIByteArrayInputStream.idl \ $(NULL) EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) diff --git a/mozilla/xpcom/io/makefile.win b/mozilla/xpcom/io/makefile.win index 7218ca3f402..521d87deb7e 100644 --- a/mozilla/xpcom/io/makefile.win +++ b/mozilla/xpcom/io/makefile.win @@ -19,8 +19,6 @@ # # Contributor(s): - - DEPTH=..\.. MODULE = xpcom @@ -40,6 +38,7 @@ EXPORTS = \ nsStorageStream.h \ nsScriptableInputStream.h \ nsDirectoryService.h \ + nsIByteArrayInputStream.h \ $(NULL) NO_XPT_GEN=1 @@ -60,6 +59,7 @@ XPIDLSRCS = \ .\nsIFile.idl \ .\nsILocalFile.idl \ .\nsIDirectoryService.idl \ + .\nsIByteArrayInputStream.idl \ $(NULL) ################################################################################ @@ -95,6 +95,7 @@ CPP_OBJS = \ .\$(OBJDIR)\nsFileSpecImpl.obj \ .\$(OBJDIR)\nsFileSpecStreaming.obj \ .\$(OBJDIR)\nsSpecialSystemDirectory.obj \ + .\$(OBJDIR)\nsByteArrayInputStream.obj \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/xpcom/io/nsByteArrayInputStream.cpp b/mozilla/xpcom/io/nsByteArrayInputStream.cpp index b527a8597fd..303de0f7f25 100644 --- a/mozilla/xpcom/io/nsByteArrayInputStream.cpp +++ b/mozilla/xpcom/io/nsByteArrayInputStream.cpp @@ -22,9 +22,12 @@ #include "nsByteArrayInputStream.h" #include "nsIAllocator.h" +NS_IMPL_THREADSAFE_ISUPPORTS2(nsByteArrayInputStream, nsIInputStream, nsIBaseStream) + nsByteArrayInputStream::nsByteArrayInputStream (char *buffer, PRUint32 bytes) : _buffer (buffer), _nbytes (bytes), _pos (0) { + NS_INIT_REFCNT (); } nsByteArrayInputStream::~nsByteArrayInputStream () @@ -33,8 +36,6 @@ nsByteArrayInputStream::~nsByteArrayInputStream () nsAllocator::Free (_buffer); } -NS_IMPL_THREADSAFE_ISUPPORTS (nsByteArrayInputStream, NS_GET_IID (nsIByteArrayInputStream)) - NS_IMETHODIMP nsByteArrayInputStream::Available (PRUint32* aResult) { diff --git a/mozilla/xpcom/io/nsByteArrayInputStream.h b/mozilla/xpcom/io/nsByteArrayInputStream.h index 1f2a1221ac3..23d524bcfdc 100644 --- a/mozilla/xpcom/io/nsByteArrayInputStream.h +++ b/mozilla/xpcom/io/nsByteArrayInputStream.h @@ -24,11 +24,6 @@ class nsByteArrayInputStream : public nsIByteArrayInputStream { -public: - nsByteArrayInputStream (char *buffer, PRUint32 nbytes); - virtual ~nsByteArrayInputStream(); - -private: // nsISupports methods NS_DECL_ISUPPORTS @@ -37,7 +32,12 @@ private: // nsIInputStream methods NS_DECL_NSIINPUTSTREAM + +public: + nsByteArrayInputStream (char *buffer, PRUint32 nbytes); + virtual ~nsByteArrayInputStream (); +private: char *_buffer; PRUint32 _nbytes; PRUint32 _pos;