From 1abd4f2810e399aeefb3ce97bb649a636c31d7a6 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Sun, 4 Feb 2007 18:03:13 +0000 Subject: [PATCH] Let the consumer have a look at the channel we opened if they want (e.g. if they want its owner). Bug 369242, r+sr=biesi git-svn-id: svn://10.0.0.236/trunk@219473 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/netwerk/base/public/nsNetUtil.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mozilla/netwerk/base/public/nsNetUtil.h b/mozilla/netwerk/base/public/nsNetUtil.h index e073b356dfc..972e8ed8f84 100644 --- a/mozilla/netwerk/base/public/nsNetUtil.h +++ b/mozilla/netwerk/base/public/nsNetUtil.h @@ -199,7 +199,8 @@ NS_OpenURI(nsIInputStream **result, nsIIOService *ioService = nsnull, // pass in nsIIOService to optimize callers nsILoadGroup *loadGroup = nsnull, nsIInterfaceRequestor *callbacks = nsnull, - PRUint32 loadFlags = nsIRequest::LOAD_NORMAL) + PRUint32 loadFlags = nsIRequest::LOAD_NORMAL, + nsIChannel **channelOut = nsnull) { nsresult rv; nsCOMPtr channel; @@ -208,8 +209,13 @@ NS_OpenURI(nsIInputStream **result, if (NS_SUCCEEDED(rv)) { nsIInputStream *stream; rv = channel->Open(&stream); - if (NS_SUCCEEDED(rv)) + if (NS_SUCCEEDED(rv)) { *result = stream; + if (channelOut) { + *channelOut = nsnull; + channel.swap(*channelOut); + } + } } return rv; }