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