b=450088 backing out (new reftest failed)
[wine-gecko.git] / modules / libjar / nsJARChannel.h
blob719b298099b82c386a1b49e1fba05f82f0670c14
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #ifndef nsJARChannel_h__
39 #define nsJARChannel_h__
41 #include "nsIJARChannel.h"
42 #include "nsIJARURI.h"
43 #include "nsIInputStreamPump.h"
44 #include "nsIInterfaceRequestor.h"
45 #include "nsIProgressEventSink.h"
46 #include "nsIStreamListener.h"
47 #include "nsIZipReader.h"
48 #include "nsIDownloader.h"
49 #include "nsILoadGroup.h"
50 #include "nsIFile.h"
51 #include "nsIURI.h"
52 #include "nsCOMPtr.h"
53 #include "nsString.h"
54 #include "prlog.h"
56 class nsJARInputThunk;
58 //-----------------------------------------------------------------------------
60 class nsJARChannel : public nsIJARChannel
61 , public nsIDownloadObserver
62 , public nsIStreamListener
64 public:
65 NS_DECL_ISUPPORTS
66 NS_DECL_NSIREQUEST
67 NS_DECL_NSICHANNEL
68 NS_DECL_NSIJARCHANNEL
69 NS_DECL_NSIDOWNLOADOBSERVER
70 NS_DECL_NSIREQUESTOBSERVER
71 NS_DECL_NSISTREAMLISTENER
73 nsJARChannel();
74 virtual ~nsJARChannel();
76 nsresult Init(nsIURI *uri);
78 private:
79 nsresult CreateJarInput(nsIZipReaderCache *);
80 nsresult EnsureJarInput(PRBool blocking);
82 #if defined(PR_LOGGING)
83 nsCString mSpec;
84 #endif
86 nsCOMPtr<nsIJARURI> mJarURI;
87 nsCOMPtr<nsIURI> mOriginalURI;
88 nsCOMPtr<nsISupports> mOwner;
89 nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
90 nsCOMPtr<nsISupports> mSecurityInfo;
91 nsCOMPtr<nsIProgressEventSink> mProgressSink;
92 nsCOMPtr<nsILoadGroup> mLoadGroup;
93 nsCOMPtr<nsIStreamListener> mListener;
94 nsCOMPtr<nsISupports> mListenerContext;
95 nsCString mContentType;
96 nsCString mContentCharset;
97 PRInt32 mContentLength;
98 PRUint32 mLoadFlags;
99 nsresult mStatus;
100 PRPackedBool mIsPending;
101 PRPackedBool mIsUnsafe;
103 nsJARInputThunk *mJarInput;
104 nsCOMPtr<nsIStreamListener> mDownloader;
105 nsCOMPtr<nsIInputStreamPump> mPump;
106 nsCOMPtr<nsIFile> mJarFile;
107 nsCOMPtr<nsIURI> mJarBaseURI;
108 nsCString mJarEntry;
111 #endif // nsJARChannel_h__