From fd7d739519837b689419bc4ca747c4a002bbc460 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Tue, 19 Sep 2017 17:52:28 +0200 Subject: [PATCH] Bug 1401204 - Get rid of NS_BackgroundInputStream and NS_BackgroundOutputStream, r=valentin --- netwerk/base/nsNetUtil.cpp | 42 -------------------------------------- netwerk/base/nsNetUtil.h | 16 --------------- 2 files changed, 58 deletions(-) diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp index 5d50e1cb54c8..47c5b7b81e38 100644 --- a/netwerk/base/nsNetUtil.cpp +++ b/netwerk/base/nsNetUtil.cpp @@ -1338,48 +1338,6 @@ NS_NewLocalFileStream(nsIFileStream **result, return rv; } -nsresult -NS_BackgroundInputStream(nsIInputStream **result, - nsIInputStream *stream, - uint32_t segmentSize /* = 0 */, - uint32_t segmentCount /* = 0 */) -{ - nsresult rv; - nsCOMPtr sts = - do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID, &rv); - if (NS_SUCCEEDED(rv)) { - nsCOMPtr inTransport; - rv = sts->CreateInputTransport(stream, int64_t(-1), int64_t(-1), - true, getter_AddRefs(inTransport)); - if (NS_SUCCEEDED(rv)) - rv = inTransport->OpenInputStream(nsITransport::OPEN_BLOCKING, - segmentSize, segmentCount, - result); - } - return rv; -} - -nsresult -NS_BackgroundOutputStream(nsIOutputStream **result, - nsIOutputStream *stream, - uint32_t segmentSize /* = 0 */, - uint32_t segmentCount /* = 0 */) -{ - nsresult rv; - nsCOMPtr sts = - do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID, &rv); - if (NS_SUCCEEDED(rv)) { - nsCOMPtr inTransport; - rv = sts->CreateOutputTransport(stream, int64_t(-1), int64_t(-1), - true, getter_AddRefs(inTransport)); - if (NS_SUCCEEDED(rv)) - rv = inTransport->OpenOutputStream(nsITransport::OPEN_BLOCKING, - segmentSize, segmentCount, - result); - } - return rv; -} - nsresult NS_NewBufferedOutputStream(nsIOutputStream **result, nsIOutputStream *str, diff --git a/netwerk/base/nsNetUtil.h b/netwerk/base/nsNetUtil.h index 0e825288d519..8154072ab2dd 100644 --- a/netwerk/base/nsNetUtil.h +++ b/netwerk/base/nsNetUtil.h @@ -512,22 +512,6 @@ nsresult NS_NewLocalFileStream(nsIFileStream **result, int32_t perm = -1, int32_t behaviorFlags = 0); -// returns the input end of a pipe. the output end of the pipe -// is attached to the original stream. data from the original -// stream is read into the pipe on a background thread. -nsresult NS_BackgroundInputStream(nsIInputStream **result, - nsIInputStream *stream, - uint32_t segmentSize = 0, - uint32_t segmentCount = 0); - -// returns the output end of a pipe. the input end of the pipe -// is attached to the original stream. data written to the pipe -// is copied to the original stream on a background thread. -nsresult NS_BackgroundOutputStream(nsIOutputStream **result, - nsIOutputStream *stream, - uint32_t segmentSize = 0, - uint32_t segmentCount = 0); - MOZ_MUST_USE nsresult NS_NewBufferedInputStream(nsIInputStream **result, nsIInputStream *str,