2012-05-21 11:12:37 +00: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 19:27:05 +00:00
|
|
|
|
|
|
|
#ifndef nsDownloader_h__
|
|
|
|
#define nsDownloader_h__
|
|
|
|
|
|
|
|
#include "nsIDownloader.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
2013-09-22 03:04:57 +00:00
|
|
|
class nsIFile;
|
|
|
|
class nsIOutputStream;
|
|
|
|
|
2003-06-23 22:58:28 +00:00
|
|
|
class nsDownloader : public nsIDownloader
|
2000-09-15 19:27:05 +00:00
|
|
|
{
|
|
|
|
public:
|
2003-06-23 22:58:28 +00:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIDOWNLOADER
|
|
|
|
NS_DECL_NSIREQUESTOBSERVER
|
|
|
|
NS_DECL_NSISTREAMLISTENER
|
2000-09-15 19:27:05 +00:00
|
|
|
|
2011-10-17 14:59:28 +00:00
|
|
|
nsDownloader() : mLocationIsTemp(false) {}
|
2000-09-15 19:27:05 +00:00
|
|
|
|
|
|
|
protected:
|
2003-06-23 22:58:28 +00:00
|
|
|
virtual ~nsDownloader();
|
|
|
|
|
|
|
|
static NS_METHOD ConsumeData(nsIInputStream *in,
|
|
|
|
void *closure,
|
|
|
|
const char *fromRawSegment,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t toOffset,
|
|
|
|
uint32_t count,
|
|
|
|
uint32_t *writeCount);
|
2001-08-17 00:17:52 +00:00
|
|
|
|
2003-06-23 22:58:28 +00:00
|
|
|
nsCOMPtr<nsIDownloadObserver> mObserver;
|
|
|
|
nsCOMPtr<nsIFile> mLocation;
|
|
|
|
nsCOMPtr<nsIOutputStream> mSink;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mLocationIsTemp;
|
2000-09-15 19:27:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsDownloader_h__
|