1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef nsDownloader_h__
6 #define nsDownloader_h__
8 #include "nsIDownloader.h"
12 class nsIOutputStream
;
14 class nsDownloader
: public nsIDownloader
{
18 NS_DECL_NSIREQUESTOBSERVER
19 NS_DECL_NSISTREAMLISTENER
21 nsDownloader() : mLocationIsTemp(false) {}
24 virtual ~nsDownloader();
26 static nsresult
ConsumeData(nsIInputStream
*in
, void *closure
,
27 const char *fromRawSegment
, uint32_t toOffset
,
28 uint32_t count
, uint32_t *writeCount
);
30 nsCOMPtr
<nsIDownloadObserver
> mObserver
;
31 nsCOMPtr
<nsIFile
> mLocation
;
32 nsCOMPtr
<nsIOutputStream
> mSink
;
36 #endif // nsDownloader_h__