nsDownloader.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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/. */
  4. #ifndef nsDownloader_h__
  5. #define nsDownloader_h__
  6. #include "nsIDownloader.h"
  7. #include "nsCOMPtr.h"
  8. class nsIFile;
  9. class nsIOutputStream;
  10. class nsDownloader : public nsIDownloader
  11. {
  12. public:
  13. NS_DECL_ISUPPORTS
  14. NS_DECL_NSIDOWNLOADER
  15. NS_DECL_NSIREQUESTOBSERVER
  16. NS_DECL_NSISTREAMLISTENER
  17. nsDownloader() : mLocationIsTemp(false) {}
  18. protected:
  19. virtual ~nsDownloader();
  20. static nsresult ConsumeData(nsIInputStream *in,
  21. void *closure,
  22. const char *fromRawSegment,
  23. uint32_t toOffset,
  24. uint32_t count,
  25. uint32_t *writeCount);
  26. nsCOMPtr<nsIDownloadObserver> mObserver;
  27. nsCOMPtr<nsIFile> mLocation;
  28. nsCOMPtr<nsIOutputStream> mSink;
  29. bool mLocationIsTemp;
  30. };
  31. #endif // nsDownloader_h__