rv = pipe->Initialize(segmentSize, maxSize, observer, alloc); if (NS_FAILED(rv)) { delete pipe; return rv; }
NS_NewPipe(nsIBufferInputStream* *inStrResult,           nsIBufferOutputStream* *outStrResult,           nsIPipeObserver* observer,           PRUint32 segmentSize,           PRUint32 maxSize){    nsresult rv;#ifdef XP_MAC    // Don't use page buffers on the mac because we don't really have    // VM there, and they end up being more wasteful:    NS_WITH_SERVICE(nsIAllocator, alloc, kAllocatorCID, &rv);#else    NS_WITH_SERVICE(nsIAllocator, alloc, kPageManagerCID, &rv);#endif    if (NS_FAILED(rv)) return rv;    nsPipe* pipe = new nsPipe(segmentSize, maxSize, alloc, observer);    if (pipe == nsnull)        return NS_ERROR_OUT_OF_MEMORY;    *inStrResult = pipe->GetInputStream();    *outStrResult = pipe->GetOutputStream();    NS_ADDREF(*inStrResult);    NS_ADDREF(*outStrResult);    return NS_OK;}