From 6b7bdc50fe990a22795cca09d2be431a4c312eed Mon Sep 17 00:00:00 2001 From: Dan Witte Date: Tue, 19 Oct 2010 19:46:54 -0700 Subject: [PATCH] Bounce input stream and FTP patches for Windows test failure. a=bustage --- ipc/ipdl/Makefile.in | 1 - netwerk/base/src/nsBaseChannel.h | 10 +- netwerk/base/src/nsBufferedStreams.cpp | 64 +---------- netwerk/base/src/nsBufferedStreams.h | 6 +- netwerk/base/src/nsFileStreams.cpp | 99 +++-------------- netwerk/base/src/nsFileStreams.h | 10 +- netwerk/base/src/nsMIMEInputStream.cpp | 87 +-------------- netwerk/ipc/NeckoChild.cpp | 19 ---- netwerk/ipc/NeckoChild.h | 2 - netwerk/ipc/NeckoCommon.h | 10 +- netwerk/ipc/NeckoMessageUtils.h | 104 ------------------ netwerk/ipc/NeckoParent.cpp | 17 --- netwerk/ipc/NeckoParent.h | 2 - netwerk/ipc/PNecko.ipdl | 3 - netwerk/protocol/ftp/Makefile.in | 18 --- netwerk/protocol/ftp/nsFTPChannel.h | 1 - netwerk/protocol/ftp/nsFtpProtocolHandler.cpp | 26 +---- netwerk/protocol/ftp/nsFtpProtocolHandler.h | 4 - netwerk/protocol/http/HttpBaseChannel.h | 22 ++++ netwerk/protocol/http/HttpChannelChild.cpp | 30 ++++- netwerk/protocol/http/HttpChannelParent.cpp | 16 ++- netwerk/protocol/http/HttpChannelParent.h | 4 +- netwerk/protocol/http/PHttpChannel.ipdl | 5 +- netwerk/protocol/http/PHttpChannelParams.h | 55 ++++++++- xpcom/io/Makefile.in | 3 +- xpcom/io/nsMultiplexInputStream.cpp | 82 +------------- xpcom/io/nsStringStream.cpp | 55 +-------- 27 files changed, 168 insertions(+), 587 deletions(-) diff --git a/ipc/ipdl/Makefile.in b/ipc/ipdl/Makefile.in index 49804ed02fce..04770bd274a7 100644 --- a/ipc/ipdl/Makefile.in +++ b/ipc/ipdl/Makefile.in @@ -64,7 +64,6 @@ IPDLDIRS = \ js/jetpack \ layout/ipc \ netwerk/ipc \ - netwerk/protocol/ftp \ netwerk/protocol/http \ netwerk/protocol/wyciwyg \ netwerk/cookie \ diff --git a/netwerk/base/src/nsBaseChannel.h b/netwerk/base/src/nsBaseChannel.h index ac94d4fc84ae..7d85e547cf23 100644 --- a/netwerk/base/src/nsBaseChannel.h +++ b/netwerk/base/src/nsBaseChannel.h @@ -281,24 +281,22 @@ private: nsCOMPtr mProgressSink; nsCOMPtr mOriginalURI; nsCOMPtr mURI; + nsCOMPtr mLoadGroup; nsCOMPtr mOwner; nsCOMPtr mSecurityInfo; + nsCOMPtr mListener; + nsCOMPtr mListenerContext; nsCOMPtr mRedirectChannel; nsCString mContentType; nsCString mContentCharset; PRUint32 mLoadFlags; + nsresult mStatus; PRPackedBool mQueriedProgressSink; PRPackedBool mSynthProgressEvents; PRPackedBool mWasOpened; PRPackedBool mWaitingOnAsyncRedirect; PRPackedBool mOpenRedirectChannel; PRUint32 mRedirectFlags; - -protected: - nsCOMPtr mLoadGroup; - nsCOMPtr mListener; - nsCOMPtr mListenerContext; - nsresult mStatus; }; #endif // !nsBaseChannel_h__ diff --git a/netwerk/base/src/nsBufferedStreams.cpp b/netwerk/base/src/nsBufferedStreams.cpp index 0daae5d7f4b5..0bd9525c8fbb 100644 --- a/netwerk/base/src/nsBufferedStreams.cpp +++ b/netwerk/base/src/nsBufferedStreams.cpp @@ -35,16 +35,9 @@ * * ***** END LICENSE BLOCK ***** */ -#ifdef MOZ_IPC -#include "IPC/IPCMessageUtils.h" -#include "mozilla/net/NeckoMessageUtils.h" -#endif - #include "nsBufferedStreams.h" #include "nsStreamUtils.h" #include "nsCRT.h" -#include "nsNetCID.h" -#include "nsIClassInfoImpl.h" #ifdef DEBUG_brendan # define METERING @@ -253,26 +246,11 @@ nsBufferedStream::SetEOF() //////////////////////////////////////////////////////////////////////////////// // nsBufferedInputStream -NS_IMPL_ADDREF_INHERITED(nsBufferedInputStream, nsBufferedStream) -NS_IMPL_RELEASE_INHERITED(nsBufferedInputStream, nsBufferedStream) - -NS_IMPL_CLASSINFO(nsBufferedInputStream, NULL, nsIClassInfo::THREADSAFE, - NS_BUFFEREDINPUTSTREAM_CID) - -NS_INTERFACE_MAP_BEGIN(nsBufferedInputStream) - NS_INTERFACE_MAP_ENTRY(nsIInputStream) - NS_INTERFACE_MAP_ENTRY(nsIBufferedInputStream) - NS_INTERFACE_MAP_ENTRY(nsIStreamBufferAccess) - NS_INTERFACE_MAP_ENTRY(nsIIPCSerializable) - NS_IMPL_QUERY_CLASSINFO(nsBufferedInputStream) -NS_INTERFACE_MAP_END_INHERITING(nsBufferedStream) - -NS_IMPL_CI_INTERFACE_GETTER5(nsBufferedInputStream, +NS_IMPL_ISUPPORTS_INHERITED3(nsBufferedInputStream, + nsBufferedStream, nsIInputStream, nsIBufferedInputStream, - nsISeekableStream, - nsIStreamBufferAccess, - nsIIPCSerializable) + nsIStreamBufferAccess) nsresult nsBufferedInputStream::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult) @@ -488,42 +466,6 @@ nsBufferedInputStream::GetUnbufferedStream(nsISupports* *aStream) return NS_OK; } -PRBool -nsBufferedInputStream::Read(const IPC::Message *aMsg, void **aIter) -{ -#ifdef MOZ_IPC - using IPC::ReadParam; - - PRUint32 bufferSize; - IPC::InputStream inputStream; - if (!ReadParam(aMsg, aIter, &bufferSize) || - !ReadParam(aMsg, aIter, &inputStream)) - return PR_FALSE; - - nsCOMPtr stream(inputStream); - nsresult rv = Init(stream, bufferSize); - if (NS_FAILED(rv)) - return PR_FALSE; - - return PR_TRUE; -#else - return PR_FALSE; -#endif -} - -void -nsBufferedInputStream::Write(IPC::Message *aMsg) -{ -#ifdef MOZ_IPC - using IPC::WriteParam; - - WriteParam(aMsg, mBufferSize); - - IPC::InputStream inputStream(Source()); - WriteParam(aMsg, inputStream); -#endif -} - //////////////////////////////////////////////////////////////////////////////// // nsBufferedOutputStream diff --git a/netwerk/base/src/nsBufferedStreams.h b/netwerk/base/src/nsBufferedStreams.h index 231244a9b863..b4eb7b3e8025 100644 --- a/netwerk/base/src/nsBufferedStreams.h +++ b/netwerk/base/src/nsBufferedStreams.h @@ -46,8 +46,6 @@ #include "nsIStreamBufferAccess.h" #include "nsCOMPtr.h" #include "nsInt64.h" -#include "nsIIPCSerializable.h" - //////////////////////////////////////////////////////////////////////////////// class nsBufferedStream : public nsISeekableStream @@ -91,15 +89,13 @@ protected: class nsBufferedInputStream : public nsBufferedStream, public nsIBufferedInputStream, - public nsIStreamBufferAccess, - public nsIIPCSerializable + public nsIStreamBufferAccess { public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIINPUTSTREAM NS_DECL_NSIBUFFEREDINPUTSTREAM NS_DECL_NSISTREAMBUFFERACCESS - NS_DECL_NSIIPCSERIALIZABLE nsBufferedInputStream() : nsBufferedStream() {} virtual ~nsBufferedInputStream() {} diff --git a/netwerk/base/src/nsFileStreams.cpp b/netwerk/base/src/nsFileStreams.cpp index da4d9ee77967..b7f97391f8ae 100644 --- a/netwerk/base/src/nsFileStreams.cpp +++ b/netwerk/base/src/nsFileStreams.cpp @@ -35,10 +35,6 @@ * * ***** END LICENSE BLOCK ***** */ -#ifdef MOZ_IPC -#include "IPC/IPCMessageUtils.h" -#endif - #if defined(XP_UNIX) || defined(XP_BEOS) #include #elif defined(XP_WIN) @@ -63,7 +59,7 @@ #include "nsMimeTypes.h" #include "nsReadLine.h" #include "nsNetUtil.h" -#include "nsIClassInfoImpl.h" +//#include "nsFileTransportService.h" #define NS_NO_INPUT_BUFFERING 1 // see http://bugzilla.mozilla.org/show_bug.cgi?id=41067 @@ -177,27 +173,11 @@ nsFileStream::SetEOF() //////////////////////////////////////////////////////////////////////////////// // nsFileInputStream -NS_IMPL_ADDREF_INHERITED(nsFileInputStream, nsFileStream) -NS_IMPL_RELEASE_INHERITED(nsFileInputStream, nsFileStream) - -NS_IMPL_CLASSINFO(nsFileInputStream, NULL, nsIClassInfo::THREADSAFE, - NS_LOCALFILEINPUTSTREAM_CID) - -NS_INTERFACE_MAP_BEGIN(nsFileInputStream) - NS_INTERFACE_MAP_ENTRY(nsFileStream) - NS_INTERFACE_MAP_ENTRY(nsIInputStream) - NS_INTERFACE_MAP_ENTRY(nsIFileInputStream) - NS_INTERFACE_MAP_ENTRY(nsILineInputStream) - NS_INTERFACE_MAP_ENTRY(nsIIPCSerializable) - NS_IMPL_QUERY_CLASSINFO(nsFileInputStream) -NS_INTERFACE_MAP_END_INHERITING(nsFileStream) - -NS_IMPL_CI_INTERFACE_GETTER5(nsFileInputStream, +NS_IMPL_ISUPPORTS_INHERITED3(nsFileInputStream, + nsFileStream, nsIInputStream, nsIFileInputStream, - nsISeekableStream, - nsILineInputStream, - nsIIPCSerializable) + nsILineInputStream) nsresult nsFileInputStream::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult) @@ -245,9 +225,9 @@ nsFileInputStream::Open(nsIFile* aFile, PRInt32 aIOFlags, PRInt32 aPerm) // fails, then we'll just remember the nsIFile and remove it after we // close the file descriptor. rv = aFile->Remove(PR_FALSE); - if (NS_SUCCEEDED(rv)) { - // No need to remove it later. Clear the flag. - mBehaviorFlags &= ~DELETE_ON_CLOSE; + if (NS_FAILED(rv) && !(mBehaviorFlags & REOPEN_ON_REWIND)) { + // If REOPEN_ON_REWIND is not happenin', we haven't saved the file yet + mFile = aFile; } } @@ -263,9 +243,12 @@ nsFileInputStream::Init(nsIFile* aFile, PRInt32 aIOFlags, PRInt32 aPerm, mBehaviorFlags = aBehaviorFlags; - mFile = aFile; - mIOFlags = aIOFlags; - mPerm = aPerm; + // If the file will be reopened on rewind, save the info to open the file + if (mBehaviorFlags & REOPEN_ON_REWIND) { + mFile = aFile; + mIOFlags = aIOFlags; + mPerm = aPerm; + } return Open(aFile, aIOFlags, aPerm); } @@ -277,12 +260,14 @@ nsFileInputStream::Close() PR_FREEIF(mLineBuffer); nsresult rv = nsFileStream::Close(); if (NS_FAILED(rv)) return rv; - - if (mBehaviorFlags & DELETE_ON_CLOSE) { + if (mFile && (mBehaviorFlags & DELETE_ON_CLOSE)) { rv = mFile->Remove(PR_FALSE); NS_ASSERTION(NS_SUCCEEDED(rv), "failed to delete file"); + // If we don't need to save the file for reopening, free it up + if (!(mBehaviorFlags & REOPEN_ON_REWIND)) { + mFile = nsnull; + } } - return rv; } @@ -378,54 +363,6 @@ nsFileInputStream::Seek(PRInt32 aWhence, PRInt64 aOffset) return nsFileStream::Seek(aWhence, aOffset); } -PRBool -nsFileInputStream::Read(const IPC::Message *aMsg, void **aIter) -{ -#ifdef MOZ_IPC - using IPC::ReadParam; - - nsCString path; - PRBool followLinks; - PRInt32 flags; - if (!ReadParam(aMsg, aIter, &path) || - !ReadParam(aMsg, aIter, &followLinks) || - !ReadParam(aMsg, aIter, &flags)) - return PR_FALSE; - - nsCOMPtr file; - nsresult rv = NS_NewNativeLocalFile(path, followLinks, getter_AddRefs(file)); - if (NS_FAILED(rv)) - return PR_FALSE; - - // IO flags = -1 means readonly, and - // permissions are unimportant since we're reading - rv = Init(file, -1, -1, flags); - if (NS_FAILED(rv)) - return PR_FALSE; - - return PR_TRUE; -#else - return PR_FALSE; -#endif -} - -void -nsFileInputStream::Write(IPC::Message *aMsg) -{ -#ifdef MOZ_IPC - using IPC::WriteParam; - - nsCString path; - mFile->GetNativePath(path); - WriteParam(aMsg, path); - nsCOMPtr localFile = do_QueryInterface(mFile); - PRBool followLinks; - localFile->GetFollowLinks(&followLinks); - WriteParam(aMsg, followLinks); - WriteParam(aMsg, mBehaviorFlags); -#endif -} - //////////////////////////////////////////////////////////////////////////////// // nsPartialFileInputStream diff --git a/netwerk/base/src/nsFileStreams.h b/netwerk/base/src/nsFileStreams.h index ef799f9b9bcf..d2fc5b63c141 100644 --- a/netwerk/base/src/nsFileStreams.h +++ b/netwerk/base/src/nsFileStreams.h @@ -48,7 +48,6 @@ #include "nsCOMPtr.h" #include "prlog.h" #include "prio.h" -#include "nsIIPCSerializable.h" template class nsLineBuffer; @@ -77,15 +76,13 @@ protected: class nsFileInputStream : public nsFileStream, public nsIFileInputStream, - public nsILineInputStream, - public nsIIPCSerializable + public nsILineInputStream { public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIINPUTSTREAM NS_DECL_NSIFILEINPUTSTREAM NS_DECL_NSILINEINPUTSTREAM - NS_DECL_NSIIPCSERIALIZABLE // Overrided from nsFileStream NS_IMETHOD Seek(PRInt32 aWhence, PRInt64 aOffset); @@ -107,15 +104,18 @@ protected: nsLineBuffer *mLineBuffer; /** - * The file being opened. + * The file being opened. Only stored when DELETE_ON_CLOSE or + * REOPEN_ON_REWIND are true. */ nsCOMPtr mFile; /** * The IO flags passed to Init() for the file open. + * Only set for REOPEN_ON_REWIND. */ PRInt32 mIOFlags; /** * The permissions passed to Init() for the file open. + * Only set for REOPEN_ON_REWIND. */ PRInt32 mPerm; /** diff --git a/netwerk/base/src/nsMIMEInputStream.cpp b/netwerk/base/src/nsMIMEInputStream.cpp index 4c227ab4b906..061b8778be71 100644 --- a/netwerk/base/src/nsMIMEInputStream.cpp +++ b/netwerk/base/src/nsMIMEInputStream.cpp @@ -41,11 +41,6 @@ * automatic creation of the content-length header. */ -#ifdef MOZ_IPC -#include "IPC/IPCMessageUtils.h" -#include "mozilla/net/NeckoMessageUtils.h" -#endif - #include "nsCOMPtr.h" #include "nsComponentManagerUtils.h" #include "nsIMultiplexInputStream.h" @@ -53,13 +48,9 @@ #include "nsISeekableStream.h" #include "nsIStringStream.h" #include "nsString.h" -#include "nsMIMEInputStream.h" -#include "nsIIPCSerializable.h" -#include "nsIClassInfoImpl.h" class nsMIMEInputStream : public nsIMIMEInputStream, - public nsISeekableStream, - public nsIIPCSerializable + public nsISeekableStream { public: nsMIMEInputStream(); @@ -69,7 +60,6 @@ public: NS_DECL_NSIINPUTSTREAM NS_DECL_NSIMIMEINPUTSTREAM NS_DECL_NSISEEKABLESTREAM - NS_DECL_NSIIPCSERIALIZABLE NS_METHOD Init(); @@ -98,22 +88,10 @@ private: PRPackedBool mStartedReading; }; -NS_IMPL_THREADSAFE_ADDREF(nsMIMEInputStream) -NS_IMPL_THREADSAFE_RELEASE(nsMIMEInputStream) - -NS_IMPL_CLASSINFO(nsMIMEInputStream, NULL, nsIClassInfo::THREADSAFE, - NS_MIMEINPUTSTREAM_CID) - -NS_IMPL_QUERY_INTERFACE4_CI(nsMIMEInputStream, - nsIMIMEInputStream, - nsIInputStream, - nsISeekableStream, - nsIIPCSerializable) -NS_IMPL_CI_INTERFACE_GETTER4(nsMIMEInputStream, - nsIMIMEInputStream, - nsIInputStream, - nsISeekableStream, - nsIIPCSerializable) +NS_IMPL_THREADSAFE_ISUPPORTS3(nsMIMEInputStream, + nsIMIMEInputStream, + nsIInputStream, + nsISeekableStream) nsMIMEInputStream::nsMIMEInputStream() : mAddContentLength(PR_FALSE), mStartedReading(PR_FALSE) @@ -327,58 +305,3 @@ nsMIMEInputStreamConstructor(nsISupports *outer, REFNSIID iid, void **result) return rv; } - -PRBool -nsMIMEInputStream::Read(const IPC::Message *aMsg, void **aIter) -{ -#ifdef MOZ_IPC - using IPC::ReadParam; - - if (!ReadParam(aMsg, aIter, &mHeaders) || - !ReadParam(aMsg, aIter, &mContentLength) || - !ReadParam(aMsg, aIter, &mStartedReading)) - return PR_FALSE; - - // nsMIMEInputStream::Init() already appended mHeaderStream & mCLStream - mHeaderStream->ShareData(mHeaders.get(), - mStartedReading? mHeaders.Length() : 0); - mCLStream->ShareData(mContentLength.get(), - mStartedReading? mContentLength.Length() : 0); - - IPC::InputStream inputStream; - if (!ReadParam(aMsg, aIter, &inputStream)) - return PR_FALSE; - - nsCOMPtr stream(inputStream); - mData = stream; - if (stream) { - nsresult rv = mStream->AppendStream(mData); - if (NS_FAILED(rv)) - return PR_FALSE; - } - - if (!ReadParam(aMsg, aIter, &mAddContentLength)) - return PR_FALSE; - - return PR_TRUE; -#else - return PR_FALSE; -#endif -} - -void -nsMIMEInputStream::Write(IPC::Message *aMsg) -{ -#ifdef MOZ_IPC - using IPC::WriteParam; - - WriteParam(aMsg, mHeaders); - WriteParam(aMsg, mContentLength); - WriteParam(aMsg, mStartedReading); - - IPC::InputStream inputStream(mData); - WriteParam(aMsg, inputStream); - - WriteParam(aMsg, mAddContentLength); -#endif -} diff --git a/netwerk/ipc/NeckoChild.cpp b/netwerk/ipc/NeckoChild.cpp index 3a191369af7f..8556d50703d5 100644 --- a/netwerk/ipc/NeckoChild.cpp +++ b/netwerk/ipc/NeckoChild.cpp @@ -45,7 +45,6 @@ #include "mozilla/net/HttpChannelChild.h" #include "mozilla/net/CookieServiceChild.h" #include "mozilla/net/WyciwygChannelChild.h" -#include "mozilla/net/FTPChannelChild.h" namespace mozilla { namespace net { @@ -113,24 +112,6 @@ NeckoChild::DeallocPHttpChannel(PHttpChannelChild* channel) return true; } -PFTPChannelChild* -NeckoChild::AllocPFTPChannel() -{ - // We don't allocate here: see FTPChannelChild::AsyncOpen() - NS_RUNTIMEABORT("AllocPFTPChannel should not be called"); - return nsnull; -} - -bool -NeckoChild::DeallocPFTPChannel(PFTPChannelChild* channel) -{ - NS_ABORT_IF_FALSE(IsNeckoChild(), "DeallocPFTPChannel called by non-child!"); - - FTPChannelChild* child = static_cast(channel); - child->ReleaseIPDLReference(); - return true; -} - PCookieServiceChild* NeckoChild::AllocPCookieService() { diff --git a/netwerk/ipc/NeckoChild.h b/netwerk/ipc/NeckoChild.h index 9548330a1e1f..0d88b91e5e28 100644 --- a/netwerk/ipc/NeckoChild.h +++ b/netwerk/ipc/NeckoChild.h @@ -65,8 +65,6 @@ protected: virtual bool DeallocPCookieService(PCookieServiceChild*); virtual PWyciwygChannelChild* AllocPWyciwygChannel(); virtual bool DeallocPWyciwygChannel(PWyciwygChannelChild*); - virtual PFTPChannelChild* AllocPFTPChannel(); - virtual bool DeallocPFTPChannel(PFTPChannelChild*); }; /** diff --git a/netwerk/ipc/NeckoCommon.h b/netwerk/ipc/NeckoCommon.h index 5899e06715f4..7070454c57bc 100644 --- a/netwerk/ipc/NeckoCommon.h +++ b/netwerk/ipc/NeckoCommon.h @@ -73,20 +73,12 @@ #define DROP_DEAD() \ do { \ - nsPrintfCString msg(1000,"NECKO ERROR: '%s' UNIMPLEMENTED", \ + nsPrintfCString msg(1000,"FATAL NECKO ERROR: '%s' UNIMPLEMENTED", \ __FUNCTION__); \ NECKO_MAYBE_ABORT(msg); \ return NS_ERROR_NOT_IMPLEMENTED; \ } while (0) -#define ENSURE_CALLED_BEFORE_ASYNC_OPEN() \ - if (mIsPending || mWasOpened) { \ - nsPrintfCString msg(1000, "'%s' called after AsyncOpen: %s +%d", \ - __FUNCTION__, __FILE__, __LINE__); \ - NECKO_MAYBE_ABORT(msg); \ - } \ - NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS); \ - NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_ALREADY_OPENED); namespace mozilla { namespace net { diff --git a/netwerk/ipc/NeckoMessageUtils.h b/netwerk/ipc/NeckoMessageUtils.h index 400645e857bd..9986d46acce3 100644 --- a/netwerk/ipc/NeckoMessageUtils.h +++ b/netwerk/ipc/NeckoMessageUtils.h @@ -46,7 +46,6 @@ #include "nsIClassInfo.h" #include "nsComponentManagerUtils.h" #include "nsNetUtil.h" -#include "nsStringStream.h" namespace IPC { @@ -175,109 +174,6 @@ struct ParamTraits } }; -class InputStream { - public: - InputStream() : mStream(nsnull) {} - InputStream(nsIInputStream* aStream) : mStream(aStream) {} - operator nsIInputStream*() const { return mStream.get(); } - - friend struct ParamTraits; - - private: - // Unimplemented - InputStream& operator=(InputStream&); - - nsCOMPtr mStream; -}; - -template<> -struct ParamTraits -{ - typedef InputStream paramType; - - static void Write(Message* aMsg, const paramType& aParam) - { - bool isNull = !aParam.mStream; - aMsg->WriteBool(isNull); - - if (isNull) - return; - - nsCOMPtr serializable = do_QueryInterface(aParam.mStream); - bool isSerializable = !!serializable; - WriteParam(aMsg, isSerializable); - - if (!serializable) { - NS_WARNING("nsIInputStream implementation doesn't support nsIIPCSerializable; falling back to copying data"); - - nsCString streamString; - PRUint32 bytes; - - aParam.mStream->Available(&bytes); - if (bytes > 0) { - nsresult rv = NS_ReadInputStreamToString(aParam.mStream, streamString, bytes); - NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv), "Can't read input stream into a string!"); - } - - WriteParam(aMsg, streamString); - return; - } - - nsCOMPtr classInfo = do_QueryInterface(aParam.mStream); - char cidStr[NSID_LENGTH]; - nsCID cid; - nsresult rv = classInfo->GetClassIDNoAlloc(&cid); - NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv), "All IPDL streams must report a valid class ID"); - - cid.ToProvidedString(cidStr); - WriteParam(aMsg, nsCAutoString(cidStr)); - serializable->Write(aMsg); - } - - static bool Read(const Message* aMsg, void** aIter, paramType* aResult) - { - bool isNull; - if (!ReadParam(aMsg, aIter, &isNull)) - return false; - - if (isNull) { - aResult->mStream = nsnull; - return true; - } - - bool isSerializable; - if (!ReadParam(aMsg, aIter, &isSerializable)) - return false; - - nsCOMPtr stream; - if (!isSerializable) { - nsCString streamString; - if (!ReadParam(aMsg, aIter, &streamString)) - return false; - - nsresult rv = NS_NewCStringInputStream(getter_AddRefs(stream), streamString); - if (NS_FAILED(rv)) - return false; - } else { - nsCAutoString cidStr; - nsCID cid; - if (!ReadParam(aMsg, aIter, &cidStr) || - !cid.Parse(cidStr.get())) - return false; - - stream = do_CreateInstance(cid); - if (!stream) - return false; - nsCOMPtr serializable = do_QueryInterface(stream); - if (!serializable || !serializable->Read(aMsg, aIter)) - return false; - } - - stream.swap(aResult->mStream); - return true; - } -}; - // nsIPermissionManager utilities struct Permission diff --git a/netwerk/ipc/NeckoParent.cpp b/netwerk/ipc/NeckoParent.cpp index 22d33f43625c..d1b7d27a1fbf 100644 --- a/netwerk/ipc/NeckoParent.cpp +++ b/netwerk/ipc/NeckoParent.cpp @@ -43,7 +43,6 @@ #include "mozilla/net/HttpChannelParent.h" #include "mozilla/net/CookieServiceParent.h" #include "mozilla/net/WyciwygChannelParent.h" -#include "mozilla/net/FTPChannelParent.h" #include "nsHTMLDNSPrefetch.h" @@ -75,22 +74,6 @@ NeckoParent::DeallocPHttpChannel(PHttpChannelParent* channel) return true; } -PFTPChannelParent* -NeckoParent::AllocPFTPChannel() -{ - FTPChannelParent *p = new FTPChannelParent(); - p->AddRef(); - return p; -} - -bool -NeckoParent::DeallocPFTPChannel(PFTPChannelParent* channel) -{ - FTPChannelParent *p = static_cast(channel); - p->Release(); - return true; -} - PCookieServiceParent* NeckoParent::AllocPCookieService() { diff --git a/netwerk/ipc/NeckoParent.h b/netwerk/ipc/NeckoParent.h index 94f93a132b9e..98f0f122c316 100644 --- a/netwerk/ipc/NeckoParent.h +++ b/netwerk/ipc/NeckoParent.h @@ -62,8 +62,6 @@ protected: virtual bool DeallocPCookieService(PCookieServiceParent*); virtual PWyciwygChannelParent* AllocPWyciwygChannel(); virtual bool DeallocPWyciwygChannel(PWyciwygChannelParent*); - virtual PFTPChannelParent* AllocPFTPChannel(); - virtual bool DeallocPFTPChannel(PFTPChannelParent*); virtual bool RecvHTMLDNSPrefetch(const nsString& hostname, const PRUint16& flags); }; diff --git a/netwerk/ipc/PNecko.ipdl b/netwerk/ipc/PNecko.ipdl index cf3953dadca8..ac9010fe7fbc 100644 --- a/netwerk/ipc/PNecko.ipdl +++ b/netwerk/ipc/PNecko.ipdl @@ -43,7 +43,6 @@ include protocol PHttpChannel; include protocol PCookieService; include protocol PBrowser; include protocol PWyciwygChannel; -include protocol PFTPChannel; namespace mozilla { namespace net { @@ -56,14 +55,12 @@ sync protocol PNecko manages PHttpChannel; manages PCookieService; manages PWyciwygChannel; - manages PFTPChannel; parent: __delete__(); PCookieService(); PWyciwygChannel(); - PFTPChannel(); HTMLDNSPrefetch(nsString hostname, PRUint16 flags); diff --git a/netwerk/protocol/ftp/Makefile.in b/netwerk/protocol/ftp/Makefile.in index 8869402f4f4b..1a035973eceb 100644 --- a/netwerk/protocol/ftp/Makefile.in +++ b/netwerk/protocol/ftp/Makefile.in @@ -56,15 +56,6 @@ XPIDLSRCS = \ nsIFTPChannel.idl \ $(NULL) -ifdef MOZ_IPC -EXPORTS_NAMESPACES = mozilla/net - -EXPORTS_mozilla/net += \ - FTPChannelParent.h \ - FTPChannelChild.h \ - $(NULL) -endif - CPPSRCS = \ nsFtpProtocolHandler.cpp \ nsFTPChannel.cpp \ @@ -72,13 +63,6 @@ CPPSRCS = \ nsFtpControlConnection.cpp \ $(NULL) -ifdef MOZ_IPC -CPPSRCS += \ - FTPChannelParent.cpp \ - FTPChannelChild.cpp \ - $(NULL) -endif - # Use -g for Irix mipspro builds as workaround for bug 92099 ifneq (,$(filter IRIX IRIX64,$(OS_ARCH))) ifndef GNU_CC @@ -91,8 +75,6 @@ LOCAL_INCLUDES = \ -I$(topsrcdir)/xpcom/ds \ $(NULL) -include $(topsrcdir)/config/config.mk -include $(topsrcdir)/ipc/chromium/chromium-config.mk include $(topsrcdir)/config/rules.mk ifeq ($(OS_ARCH),WINNT) diff --git a/netwerk/protocol/ftp/nsFTPChannel.h b/netwerk/protocol/ftp/nsFTPChannel.h index b30e6443c2d0..33235fb761b2 100644 --- a/netwerk/protocol/ftp/nsFTPChannel.h +++ b/netwerk/protocol/ftp/nsFTPChannel.h @@ -62,7 +62,6 @@ #include "nsIProxiedChannel.h" #include "nsIResumableChannel.h" #include "nsHashPropertyBag.h" -#include "nsFtpProtocolHandler.h" class nsFtpChannel : public nsBaseChannel, public nsIFTPChannel, diff --git a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp index 208ee32b9c40..9ece9c90bab6 100644 --- a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp +++ b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp @@ -49,12 +49,6 @@ * use in OS2 */ -#ifdef MOZ_IPC -#include "mozilla/net/NeckoChild.h" -#include "mozilla/net/FTPChannelChild.h" -using namespace mozilla::net; -#endif - #include "nsFtpProtocolHandler.h" #include "nsFTPChannel.h" #include "nsIURL.h" @@ -87,7 +81,6 @@ using namespace mozilla::net; // PRLogModuleInfo* gFTPLog = nsnull; #endif -#undef LOG #define LOG(args) PR_LOG(gFTPLog, PR_LOG_DEBUG, args) //----------------------------------------------------------------------------- @@ -135,11 +128,6 @@ NS_IMPL_THREADSAFE_ISUPPORTS4(nsFtpProtocolHandler, nsresult nsFtpProtocolHandler::Init() { -#ifdef MOZ_IPC - if (IsNeckoChild()) - NeckoChild::InitNeckoChild(); -#endif // MOZ_IPC - if (mIdleTimeout == -1) { nsresult rv; nsCOMPtr branch = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv); @@ -253,20 +241,18 @@ nsFtpProtocolHandler::NewProxiedChannel(nsIURI* uri, nsIProxyInfo* proxyInfo, nsIChannel* *result) { NS_ENSURE_ARG_POINTER(uri); - nsRefPtr channel; -#ifdef MOZ_IPC - if (IsNeckoChild()) - channel = new FTPChannelChild(uri); - else -#endif - channel = new nsFtpChannel(uri, proxyInfo); + nsFtpChannel *channel = new nsFtpChannel(uri, proxyInfo); + if (!channel) + return NS_ERROR_OUT_OF_MEMORY; + NS_ADDREF(channel); nsresult rv = channel->Init(); if (NS_FAILED(rv)) { + NS_RELEASE(channel); return rv; } - channel.forget(result); + *result = channel; return rv; } diff --git a/netwerk/protocol/ftp/nsFtpProtocolHandler.h b/netwerk/protocol/ftp/nsFtpProtocolHandler.h index bb8abf02198e..2d1d30d8e291 100644 --- a/netwerk/protocol/ftp/nsFtpProtocolHandler.h +++ b/netwerk/protocol/ftp/nsFtpProtocolHandler.h @@ -123,8 +123,4 @@ private: extern nsFtpProtocolHandler *gFtpHandler; -#ifdef PR_LOGGING -extern PRLogModuleInfo* gFTPLog; -#endif - #endif // !nsFtpProtocolHandler_h__ diff --git a/netwerk/protocol/http/HttpBaseChannel.h b/netwerk/protocol/http/HttpBaseChannel.h index 647462b6f9c6..cbac3929515d 100644 --- a/netwerk/protocol/http/HttpBaseChannel.h +++ b/netwerk/protocol/http/HttpBaseChannel.h @@ -60,9 +60,31 @@ #include "nsIApplicationCache.h" #include "nsIResumableChannel.h" +#define DIE_WITH_ASYNC_OPEN_MSG() \ + do { \ + fprintf(stderr, \ + "*&*&*&*&*&*&*&**&*&&*& FATAL ERROR: '%s' " \ + "called after AsyncOpen: %s +%d", \ + __FUNCTION__, __FILE__, __LINE__); \ + NS_ABORT(); \ + return NS_ERROR_NOT_IMPLEMENTED; \ + } while (0) + +#define ENSURE_CALLED_BEFORE_ASYNC_OPEN() \ + if (mIsPending) \ + DIE_WITH_ASYNC_OPEN_MSG(); \ + if (mWasOpened) \ + DIE_WITH_ASYNC_OPEN_MSG(); \ + NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS); \ + NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_ALREADY_OPENED); + namespace mozilla { namespace net { +typedef enum { eUploadStream_null = -1, + eUploadStream_hasNoHeaders = 0, + eUploadStream_hasHeaders = 1 } UploadStreamInfoType; + /* * This class is a partial implementation of nsIHttpChannel. It contains code * shared by nsHttpChannel and HttpChannelChild. diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index 78255b954ce0..f5e3e4be8e0e 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -820,6 +820,29 @@ HttpChannelChild::AsyncOpen(nsIStreamListener *listener, nsISupports *aContext) if (NS_FAILED(rv)) return rv; + // Prepare uploadStream for POST data + nsCAutoString uploadStreamData; + PRInt32 uploadStreamInfo; + + if (mUploadStream) { + // Read entire POST stream into string: + // This is a temporary measure until bug 564553 is implemented: we're doing + // a blocking read of a potentially arbitrarily large stream, so this isn't + // performant/safe for large file uploads. + PRUint32 bytes; + mUploadStream->Available(&bytes); + if (bytes > 0) { + rv = NS_ReadInputStreamToString(mUploadStream, uploadStreamData, bytes); + if (NS_FAILED(rv)) + return rv; + } + + uploadStreamInfo = mUploadStreamHasHeaders ? + eUploadStream_hasHeaders : eUploadStream_hasNoHeaders; + } else { + uploadStreamInfo = eUploadStream_null; + } + const char *cookieHeader = mRequestHead.PeekHeader(nsHttp::Cookie); if (cookieHeader) { mUserSetCookieHeader = cookieHeader; @@ -876,10 +899,9 @@ HttpChannelChild::AsyncOpen(nsIStreamListener *listener, nsISupports *aContext) SendAsyncOpen(IPC::URI(mURI), IPC::URI(mOriginalURI), IPC::URI(mDocumentURI), IPC::URI(mReferrer), mLoadFlags, - mRequestHeaders, mRequestHead.Method(), - IPC::InputStream(mUploadStream), mUploadStreamHasHeaders, - mPriority, mRedirectionLimit, mAllowPipelining, - mForceAllowThirdPartyCookie, mSendResumeAt, + mRequestHeaders, mRequestHead.Method(), uploadStreamData, + uploadStreamInfo, mPriority, mRedirectionLimit, + mAllowPipelining, mForceAllowThirdPartyCookie, mSendResumeAt, mStartPos, mEntityID); return NS_OK; diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp index 59da83fc5f25..dc9ec0585171 100644 --- a/netwerk/protocol/http/HttpChannelParent.cpp +++ b/netwerk/protocol/http/HttpChannelParent.cpp @@ -102,8 +102,8 @@ HttpChannelParent::RecvAsyncOpen(const IPC::URI& aURI, const PRUint32& loadFlags, const RequestHeaderTuples& requestHeaders, const nsHttpAtom& requestMethod, - const IPC::InputStream& uploadStream, - const PRBool& uploadStreamHasHeaders, + const nsCString& uploadStreamData, + const PRInt32& uploadStreamInfo, const PRUint16& priority, const PRUint8& redirectionLimit, const PRBool& allowPipelining, @@ -158,10 +158,16 @@ HttpChannelParent::RecvAsyncOpen(const IPC::URI& aURI, httpChan->SetRequestMethod(nsDependentCString(requestMethod.get())); - nsCOMPtr stream(uploadStream); - if (stream) { + if (uploadStreamInfo != eUploadStream_null) { + nsCOMPtr stream; + rv = NS_NewPostDataStream(getter_AddRefs(stream), false, uploadStreamData, 0); + if (NS_FAILED(rv)) + return SendCancelEarly(rv); + httpChan->InternalSetUploadStream(stream); - httpChan->SetUploadStreamHasHeaders(uploadStreamHasHeaders); + // We're casting uploadStreamInfo into PRBool here on purpose because + // we know possible values are either 0 or 1. See uploadStreamInfoType. + httpChan->SetUploadStreamHasHeaders((PRBool) uploadStreamInfo); } if (priority != nsISupportsPriority::PRIORITY_NORMAL) diff --git a/netwerk/protocol/http/HttpChannelParent.h b/netwerk/protocol/http/HttpChannelParent.h index e744c6b237ed..ccad423c9fa0 100644 --- a/netwerk/protocol/http/HttpChannelParent.h +++ b/netwerk/protocol/http/HttpChannelParent.h @@ -88,8 +88,8 @@ protected: const PRUint32& loadFlags, const RequestHeaderTuples& requestHeaders, const nsHttpAtom& requestMethod, - const IPC::InputStream& uploadStream, - const PRBool& uploadStreamHasHeaders, + const nsCString& uploadStreamData, + const PRInt32& uploadStreamInfo, const PRUint16& priority, const PRUint8& redirectionLimit, const PRBool& allowPipelining, diff --git a/netwerk/protocol/http/PHttpChannel.ipdl b/netwerk/protocol/http/PHttpChannel.ipdl index 510c08f18cdc..629c3cfb4fda 100644 --- a/netwerk/protocol/http/PHttpChannel.ipdl +++ b/netwerk/protocol/http/PHttpChannel.ipdl @@ -48,7 +48,6 @@ using RequestHeaderTuples; using nsHttpResponseHead; using nsHttpAtom; using IPC::URI; -using IPC::InputStream; namespace mozilla { namespace net { @@ -69,8 +68,8 @@ parent: PRUint32 loadFlags, RequestHeaderTuples requestHeaders, nsHttpAtom requestMethod, - InputStream uploadStream, - PRBool uploadStreamHasHeaders, + nsCString uploadStreamData, + PRInt32 uploadStreamInfo, PRUint16 priority, PRUint8 redirectionLimit, PRBool allowPipelining, diff --git a/netwerk/protocol/http/PHttpChannelParams.h b/netwerk/protocol/http/PHttpChannelParams.h index a6c170477c08..eb2a0508e17d 100644 --- a/netwerk/protocol/http/PHttpChannelParams.h +++ b/netwerk/protocol/http/PHttpChannelParams.h @@ -49,9 +49,8 @@ #include "nsHttpHeaderArray.h" #include "nsHttpResponseHead.h" -#include "nsIIPCSerializable.h" -#include "nsIClassInfo.h" -#include "nsNetUtil.h" +#include "nsIStringStream.h" +#include "nsISupportsPrimitives.h" namespace mozilla { namespace net { @@ -196,6 +195,56 @@ struct ParamTraits } }; +template<> +struct ParamTraits +{ + typedef nsIStringInputStream* paramType; + + static void Write(Message* aMsg, const paramType& aParam) + { + nsCAutoString value; + nsCOMPtr cstr(do_QueryInterface(aParam)); + + if (cstr) { + cstr->GetData(value); + } else { + PRUint32 length; + aParam->Available(&length); + value.SetLength(length); + NS_ASSERTION(value.Length() == length, "SetLength failed"); + char *c = value.BeginWriting(); + PRUint32 bytesRead; +#ifdef DEBUG + nsresult rv = +#endif + aParam->Read(c, length, &bytesRead); + NS_ASSERTION(NS_SUCCEEDED(rv) && bytesRead == length, "Read failed"); + } + + WriteParam(aMsg, value); + } + + static bool Read(const Message* aMsg, void** aIter, paramType* aResult) + { + nsCAutoString value; + if (!ReadParam(aMsg, aIter, &value)) + return false; + + nsresult rv; + + nsCOMPtr stream + (do_CreateInstance("@mozilla.org/io/string-input-stream;1", &rv)); + if (NS_FAILED(rv)) + return false; + + rv = stream->SetData(value.get(), value.Length()); + if (NS_FAILED(rv)) + return false; + + stream.forget(aResult); + return true; + } +}; } // namespace IPC #endif // mozilla_net_PHttpChannelParams_h diff --git a/xpcom/io/Makefile.in b/xpcom/io/Makefile.in index 0337a3909fdf..baa53d0e20ae 100644 --- a/xpcom/io/Makefile.in +++ b/xpcom/io/Makefile.in @@ -187,7 +187,6 @@ FORCE_STATIC_LIB = 1 FORCE_USE_PIC = 1 include $(topsrcdir)/config/rules.mk -include $(topsrcdir)/ipc/chromium/chromium-config.mk DEFINES += -D_IMPL_NS_COM @@ -197,7 +196,7 @@ DEFINES += -DHAVE_USR_LIB64_DIR endif endif -LOCAL_INCLUDES += -I.. +LOCAL_INCLUDES = -I.. ifeq ($(MOZ_PLATFORM_MAEMO),5) CFLAGS += $(MOZ_DBUS_CFLAGS) diff --git a/xpcom/io/nsMultiplexInputStream.cpp b/xpcom/io/nsMultiplexInputStream.cpp index c670ba215acf..254f59aaafee 100644 --- a/xpcom/io/nsMultiplexInputStream.cpp +++ b/xpcom/io/nsMultiplexInputStream.cpp @@ -41,23 +41,15 @@ * stream. */ -#ifdef MOZ_IPC -#include "IPC/IPCMessageUtils.h" -#include "mozilla/net/NeckoMessageUtils.h" -#endif - #include "nsMultiplexInputStream.h" #include "nsIMultiplexInputStream.h" #include "nsISeekableStream.h" #include "nsCOMPtr.h" #include "nsCOMArray.h" #include "nsInt64.h" -#include "nsIIPCSerializable.h" -#include "nsIClassInfoImpl.h" class nsMultiplexInputStream : public nsIMultiplexInputStream, - public nsISeekableStream, - public nsIIPCSerializable + public nsISeekableStream { public: nsMultiplexInputStream(); @@ -66,7 +58,6 @@ public: NS_DECL_NSIINPUTSTREAM NS_DECL_NSIMULTIPLEXINPUTSTREAM NS_DECL_NSISEEKABLESTREAM - NS_DECL_NSIIPCSERIALIZABLE private: ~nsMultiplexInputStream() {} @@ -89,22 +80,11 @@ private: nsresult mStatus; }; -NS_IMPL_THREADSAFE_ADDREF(nsMultiplexInputStream) -NS_IMPL_THREADSAFE_RELEASE(nsMultiplexInputStream) -NS_IMPL_CLASSINFO(nsMultiplexInputStream, NULL, nsIClassInfo::THREADSAFE, - NS_MULTIPLEXINPUTSTREAM_CID) - -NS_IMPL_QUERY_INTERFACE4_CI(nsMultiplexInputStream, - nsIMultiplexInputStream, - nsIInputStream, - nsISeekableStream, - nsIIPCSerializable) -NS_IMPL_CI_INTERFACE_GETTER4(nsMultiplexInputStream, - nsIMultiplexInputStream, - nsIInputStream, - nsISeekableStream, - nsIIPCSerializable) +NS_IMPL_THREADSAFE_ISUPPORTS3(nsMultiplexInputStream, + nsIMultiplexInputStream, + nsIInputStream, + nsISeekableStream) nsMultiplexInputStream::nsMultiplexInputStream() : mCurrentStream(0), @@ -428,55 +408,3 @@ nsMultiplexInputStreamConstructor(nsISupports *outer, return rv; } - -PRBool -nsMultiplexInputStream::Read(const IPC::Message *aMsg, void **aIter) -{ -#ifdef MOZ_IPC - using IPC::ReadParam; - - PRUint32 count; - if (!ReadParam(aMsg, aIter, &count)) - return PR_FALSE; - - for (PRUint32 i = 0; i < count; i++) { - IPC::InputStream inputStream; - if (!ReadParam(aMsg, aIter, &inputStream)) - return PR_FALSE; - - nsCOMPtr stream(inputStream); - nsresult rv = AppendStream(stream); - if (NS_FAILED(rv)) - return PR_FALSE; - } - - if (!ReadParam(aMsg, aIter, &mCurrentStream) || - !ReadParam(aMsg, aIter, &mStartedReadingCurrent) || - !ReadParam(aMsg, aIter, &mStatus)) - return PR_FALSE; - - return PR_TRUE; -#else - return PR_FALSE; -#endif -} - -void -nsMultiplexInputStream::Write(IPC::Message *aMsg) -{ -#ifdef MOZ_IPC - using IPC::WriteParam; - - PRUint32 count = mStreams.Count(); - WriteParam(aMsg, count); - - for (PRUint32 i = 0; i < count; i++) { - IPC::InputStream inputStream(mStreams.ObjectAt(i)); - WriteParam(aMsg, inputStream); - } - - WriteParam(aMsg, mCurrentStream); - WriteParam(aMsg, mStartedReadingCurrent); - WriteParam(aMsg, mStatus); -#endif -} diff --git a/xpcom/io/nsStringStream.cpp b/xpcom/io/nsStringStream.cpp index 64c1b2bb3942..e781449372e2 100644 --- a/xpcom/io/nsStringStream.cpp +++ b/xpcom/io/nsStringStream.cpp @@ -52,10 +52,6 @@ * Based on original code from nsIStringStream.cpp */ -#ifdef MOZ_IPC -#include "IPC/IPCMessageUtils.h" -#endif - #include "nsStringStream.h" #include "nsStreamUtils.h" #include "nsReadableUtils.h" @@ -66,7 +62,6 @@ #include "prerror.h" #include "plstr.h" #include "nsIClassInfoImpl.h" -#include "nsIIPCSerializable.h" //----------------------------------------------------------------------------- // nsIStringInputStream implementation @@ -75,7 +70,6 @@ class nsStringInputStream : public nsIStringInputStream , public nsISeekableStream , public nsISupportsCString - , public nsIIPCSerializable { public: NS_DECL_ISUPPORTS @@ -84,7 +78,6 @@ public: NS_DECL_NSISEEKABLESTREAM NS_DECL_NSISUPPORTSPRIMITIVE NS_DECL_NSISUPPORTSCSTRING - NS_DECL_NSIIPCSERIALIZABLE nsStringInputStream() : mData(nsnull) @@ -128,18 +121,16 @@ NS_IMPL_THREADSAFE_RELEASE(nsStringInputStream) NS_IMPL_CLASSINFO(nsStringInputStream, NULL, nsIClassInfo::THREADSAFE, NS_STRINGINPUTSTREAM_CID) -NS_IMPL_QUERY_INTERFACE5_CI(nsStringInputStream, +NS_IMPL_QUERY_INTERFACE4_CI(nsStringInputStream, nsIStringInputStream, nsIInputStream, nsISupportsCString, - nsISeekableStream, - nsIIPCSerializable) -NS_IMPL_CI_INTERFACE_GETTER5(nsStringInputStream, + nsISeekableStream) +NS_IMPL_CI_INTERFACE_GETTER4(nsStringInputStream, nsIStringInputStream, nsIInputStream, nsISupportsCString, - nsISeekableStream, - nsIIPCSerializable) + nsISeekableStream) ///////// // nsISupportsCString implementation @@ -358,44 +349,6 @@ nsStringInputStream::SetEOF() return NS_OK; } -///////// -// nsIIPCSerializable implementation -///////// - -PRBool -nsStringInputStream::Read(const IPC::Message *aMsg, void **aIter) -{ -#ifdef MOZ_IPC - using IPC::ReadParam; - - nsCAutoString value; - - if (!ReadParam(aMsg, aIter, &value)) - return PR_FALSE; - - nsresult rv = SetData(value.get(), value.Length()); - if (NS_FAILED(rv)) - return PR_FALSE; - - return PR_TRUE; -#else - return PR_FALSE; -#endif -} - -void -nsStringInputStream::Write(IPC::Message *aMsg) -{ -#ifdef MOZ_IPC - using IPC::WriteParam; - - nsCAutoString value; - GetData(value); - - WriteParam(aMsg, value); -#endif -} - NS_COM nsresult NS_NewByteInputStream(nsIInputStream** aStreamResult, const char* aStringToRead, PRInt32 aLength,