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
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsJARChannel_h__ |
michael@0 | 7 | #define nsJARChannel_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsIJARChannel.h" |
michael@0 | 10 | #include "nsIJARURI.h" |
michael@0 | 11 | #include "nsIInputStreamPump.h" |
michael@0 | 12 | #include "nsIInterfaceRequestor.h" |
michael@0 | 13 | #include "nsIProgressEventSink.h" |
michael@0 | 14 | #include "nsIStreamListener.h" |
michael@0 | 15 | #include "nsIRemoteOpenFileListener.h" |
michael@0 | 16 | #include "nsIZipReader.h" |
michael@0 | 17 | #include "nsIDownloader.h" |
michael@0 | 18 | #include "nsILoadGroup.h" |
michael@0 | 19 | #include "nsHashPropertyBag.h" |
michael@0 | 20 | #include "nsIFile.h" |
michael@0 | 21 | #include "nsIURI.h" |
michael@0 | 22 | #include "nsCOMPtr.h" |
michael@0 | 23 | #include "nsString.h" |
michael@0 | 24 | #include "prlog.h" |
michael@0 | 25 | |
michael@0 | 26 | class nsJARInputThunk; |
michael@0 | 27 | |
michael@0 | 28 | //----------------------------------------------------------------------------- |
michael@0 | 29 | |
michael@0 | 30 | class nsJARChannel : public nsIJARChannel |
michael@0 | 31 | , public nsIDownloadObserver |
michael@0 | 32 | , public nsIStreamListener |
michael@0 | 33 | , public nsIRemoteOpenFileListener |
michael@0 | 34 | , public nsHashPropertyBag |
michael@0 | 35 | { |
michael@0 | 36 | public: |
michael@0 | 37 | NS_DECL_THREADSAFE_ISUPPORTS |
michael@0 | 38 | NS_DECL_NSIREQUEST |
michael@0 | 39 | NS_DECL_NSICHANNEL |
michael@0 | 40 | NS_DECL_NSIJARCHANNEL |
michael@0 | 41 | NS_DECL_NSIDOWNLOADOBSERVER |
michael@0 | 42 | NS_DECL_NSIREQUESTOBSERVER |
michael@0 | 43 | NS_DECL_NSISTREAMLISTENER |
michael@0 | 44 | NS_DECL_NSIREMOTEOPENFILELISTENER |
michael@0 | 45 | |
michael@0 | 46 | nsJARChannel(); |
michael@0 | 47 | virtual ~nsJARChannel(); |
michael@0 | 48 | |
michael@0 | 49 | nsresult Init(nsIURI *uri); |
michael@0 | 50 | |
michael@0 | 51 | private: |
michael@0 | 52 | nsresult CreateJarInput(nsIZipReaderCache *, nsJARInputThunk **); |
michael@0 | 53 | nsresult LookupFile(); |
michael@0 | 54 | nsresult OpenLocalFile(); |
michael@0 | 55 | void NotifyError(nsresult aError); |
michael@0 | 56 | |
michael@0 | 57 | #if defined(PR_LOGGING) |
michael@0 | 58 | nsCString mSpec; |
michael@0 | 59 | #endif |
michael@0 | 60 | |
michael@0 | 61 | bool mOpened; |
michael@0 | 62 | |
michael@0 | 63 | nsCOMPtr<nsIJARURI> mJarURI; |
michael@0 | 64 | nsCOMPtr<nsIURI> mOriginalURI; |
michael@0 | 65 | nsCOMPtr<nsIURI> mAppURI; |
michael@0 | 66 | nsCOMPtr<nsISupports> mOwner; |
michael@0 | 67 | nsCOMPtr<nsIInterfaceRequestor> mCallbacks; |
michael@0 | 68 | nsCOMPtr<nsISupports> mSecurityInfo; |
michael@0 | 69 | nsCOMPtr<nsIProgressEventSink> mProgressSink; |
michael@0 | 70 | nsCOMPtr<nsILoadGroup> mLoadGroup; |
michael@0 | 71 | nsCOMPtr<nsIStreamListener> mListener; |
michael@0 | 72 | nsCOMPtr<nsISupports> mListenerContext; |
michael@0 | 73 | nsCString mContentType; |
michael@0 | 74 | nsCString mContentCharset; |
michael@0 | 75 | nsCString mContentDispositionHeader; |
michael@0 | 76 | /* mContentDisposition is uninitialized if mContentDispositionHeader is |
michael@0 | 77 | * empty */ |
michael@0 | 78 | uint32_t mContentDisposition; |
michael@0 | 79 | int64_t mContentLength; |
michael@0 | 80 | uint32_t mLoadFlags; |
michael@0 | 81 | nsresult mStatus; |
michael@0 | 82 | bool mIsPending; |
michael@0 | 83 | bool mIsUnsafe; |
michael@0 | 84 | bool mOpeningRemote; |
michael@0 | 85 | |
michael@0 | 86 | nsCOMPtr<nsIStreamListener> mDownloader; |
michael@0 | 87 | nsCOMPtr<nsIInputStreamPump> mPump; |
michael@0 | 88 | nsCOMPtr<nsIFile> mJarFile; |
michael@0 | 89 | nsCOMPtr<nsIURI> mJarBaseURI; |
michael@0 | 90 | nsCString mJarEntry; |
michael@0 | 91 | nsCString mInnerJarEntry; |
michael@0 | 92 | }; |
michael@0 | 93 | |
michael@0 | 94 | #endif // nsJARChannel_h__ |