Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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