2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2000-09-15 23:27:05 +04:00
|
|
|
|
|
|
|
#ifndef nsDownloader_h__
|
|
|
|
#define nsDownloader_h__
|
|
|
|
|
|
|
|
#include "nsIDownloader.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
2013-09-22 07:04:57 +04:00
|
|
|
class nsIFile;
|
|
|
|
class nsIOutputStream;
|
|
|
|
|
2003-06-24 02:58:28 +04:00
|
|
|
class nsDownloader : public nsIDownloader {
|
2000-09-15 23:27:05 +04:00
|
|
|
public:
|
2003-06-24 02:58:28 +04:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIDOWNLOADER
|
|
|
|
NS_DECL_NSIREQUESTOBSERVER
|
|
|
|
NS_DECL_NSISTREAMLISTENER
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2011-10-17 18:59:28 +04:00
|
|
|
nsDownloader() : mLocationIsTemp(false) {}
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2000-09-15 23:27:05 +04:00
|
|
|
protected:
|
2003-06-24 02:58:28 +04:00
|
|
|
virtual ~nsDownloader();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2016-08-12 10:36:22 +03:00
|
|
|
static nsresult ConsumeData(nsIInputStream *in, void *closure,
|
|
|
|
const char *fromRawSegment, uint32_t toOffset,
|
|
|
|
uint32_t count, uint32_t *writeCount);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2003-06-24 02:58:28 +04:00
|
|
|
nsCOMPtr<nsIDownloadObserver> mObserver;
|
|
|
|
nsCOMPtr<nsIFile> mLocation;
|
|
|
|
nsCOMPtr<nsIOutputStream> mSink;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mLocationIsTemp;
|
2000-09-15 23:27:05 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsDownloader_h__
|