Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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 */
6 #ifndef _nsZipDataStream_h_
7 #define _nsZipDataStream_h_
9 #include "nsZipWriter.h"
10 #include "nsIOutputStream.h"
11 #include "nsIStreamListener.h"
12 #include "nsAutoPtr.h"
13 #include "mozilla/Attributes.h"
15 class nsZipDataStream MOZ_FINAL : public nsIStreamListener
16 {
17 public:
18 NS_DECL_THREADSAFE_ISUPPORTS
19 NS_DECL_NSIREQUESTOBSERVER
20 NS_DECL_NSISTREAMLISTENER
22 nsZipDataStream()
23 {
24 }
26 nsresult Init(nsZipWriter *aWriter, nsIOutputStream *aStream,
27 nsZipHeader *aHeader, int32_t aCompression);
29 nsresult ReadStream(nsIInputStream *aStream);
31 private:
33 nsCOMPtr<nsIStreamListener> mOutput;
34 nsCOMPtr<nsIOutputStream> mStream;
35 nsRefPtr<nsZipWriter> mWriter;
36 nsRefPtr<nsZipHeader> mHeader;
38 nsresult CompleteEntry();
39 nsresult ProcessData(nsIRequest *aRequest, nsISupports *aContext,
40 char *aBuffer, uint64_t aOffset, uint32_t aCount);
41 };
43 #endif