Bug 1722668 - Expose nsFileStream via the component manager; r=necko-reviewers,dragana,jari

Differential Revision: https://phabricator.services.mozilla.com/D123773
This commit is contained in:
Jan Varga 2021-09-04 21:54:53 +00:00
parent d78c89f78e
commit d730017508
4 changed files with 24 additions and 0 deletions

View File

@ -901,6 +901,14 @@ nsSafeFileOutputStream::Finish() {
////////////////////////////////////////////////////////////////////////////////
// nsFileStream
nsresult nsFileStream::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
NS_ENSURE_NO_AGGREGATION(aOuter);
RefPtr<nsFileStream> stream = new nsFileStream();
return stream->QueryInterface(aIID, aResult);
}
NS_IMPL_ISUPPORTS_INHERITED(nsFileStream, nsFileStreamBase, nsIInputStream,
nsIOutputStream, nsIFileStream)

View File

@ -258,6 +258,8 @@ class nsFileStream : public nsFileStreamBase,
public nsIOutputStream,
public nsIFileStream {
public:
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIFILESTREAM
NS_FORWARD_NSIINPUTSTREAM(nsFileStreamBase::)

View File

@ -142,6 +142,12 @@ Classes = [
'legacy_constructor': 'nsFileOutputStream::Create',
'headers': ['nsFileStreams.h'],
},
{
'cid': '{648705e9-757a-4d4b-a5bF-0248e512c309}',
'contract_ids': ['@mozilla.org/network/file-stream;1'],
'legacy_constructor': 'nsFileStream::Create',
'headers': ['nsFileStreams.h'],
},
{
'name': 'HttpActivityDistributor',
'cid': '{15629ada-a41c-4a09-961f-6553cd60b1a2}',

View File

@ -342,6 +342,14 @@
} \
}
#define NS_LOCALFILESTREAM_CONTRACTID "@mozilla.org/network/file-stream;1"
#define NS_LOCALFILESTREAM_CID \
{ /* 648705e9-757a-4d4b-a5bF-0248e512c309 */ \
0x648705e9, 0x757a, 0x4d4b, { \
0xa5, 0xbF, 0x02, 0x48, 0xe5, 0x12, 0xc3, 0x09 \
} \
}
#define NS_BUFFEREDINPUTSTREAM_CONTRACTID \
"@mozilla.org/network/buffered-input-stream;1"
#define NS_BUFFEREDINPUTSTREAM_CID \