michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set ts=2 sw=2 sts=2 et cin: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsFileChannel_h__ michael@0: #define nsFileChannel_h__ michael@0: michael@0: #include "nsBaseChannel.h" michael@0: #include "nsIFileChannel.h" michael@0: #include "nsIUploadChannel.h" michael@0: michael@0: class nsFileChannel : public nsBaseChannel michael@0: , public nsIFileChannel michael@0: , public nsIUploadChannel michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS_INHERITED michael@0: NS_DECL_NSIFILECHANNEL michael@0: NS_DECL_NSIUPLOADCHANNEL michael@0: michael@0: nsFileChannel(nsIURI *uri); michael@0: michael@0: protected: michael@0: // Called to construct a blocking file input stream for the given file. This michael@0: // method also returns a best guess at the content-type for the data stream. michael@0: // NOTE: If the channel has a type hint set, contentType will be left michael@0: // untouched. The caller should not use it in that case. michael@0: nsresult MakeFileInputStream(nsIFile *file, nsCOMPtr &stream, michael@0: nsCString &contentType, bool async); michael@0: michael@0: virtual nsresult OpenContentStream(bool async, nsIInputStream **result, michael@0: nsIChannel** channel); michael@0: michael@0: private: michael@0: nsCOMPtr mUploadStream; michael@0: int64_t mUploadLength; michael@0: }; michael@0: michael@0: #endif // !nsFileChannel_h__