michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsJARChannel_h__ michael@0: #define nsJARChannel_h__ michael@0: michael@0: #include "nsIJARChannel.h" michael@0: #include "nsIJARURI.h" michael@0: #include "nsIInputStreamPump.h" michael@0: #include "nsIInterfaceRequestor.h" michael@0: #include "nsIProgressEventSink.h" michael@0: #include "nsIStreamListener.h" michael@0: #include "nsIRemoteOpenFileListener.h" michael@0: #include "nsIZipReader.h" michael@0: #include "nsIDownloader.h" michael@0: #include "nsILoadGroup.h" michael@0: #include "nsHashPropertyBag.h" michael@0: #include "nsIFile.h" michael@0: #include "nsIURI.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsString.h" michael@0: #include "prlog.h" michael@0: michael@0: class nsJARInputThunk; michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: michael@0: class nsJARChannel : public nsIJARChannel michael@0: , public nsIDownloadObserver michael@0: , public nsIStreamListener michael@0: , public nsIRemoteOpenFileListener michael@0: , public nsHashPropertyBag michael@0: { michael@0: public: michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: NS_DECL_NSIREQUEST michael@0: NS_DECL_NSICHANNEL michael@0: NS_DECL_NSIJARCHANNEL michael@0: NS_DECL_NSIDOWNLOADOBSERVER michael@0: NS_DECL_NSIREQUESTOBSERVER michael@0: NS_DECL_NSISTREAMLISTENER michael@0: NS_DECL_NSIREMOTEOPENFILELISTENER michael@0: michael@0: nsJARChannel(); michael@0: virtual ~nsJARChannel(); michael@0: michael@0: nsresult Init(nsIURI *uri); michael@0: michael@0: private: michael@0: nsresult CreateJarInput(nsIZipReaderCache *, nsJARInputThunk **); michael@0: nsresult LookupFile(); michael@0: nsresult OpenLocalFile(); michael@0: void NotifyError(nsresult aError); michael@0: michael@0: #if defined(PR_LOGGING) michael@0: nsCString mSpec; michael@0: #endif michael@0: michael@0: bool mOpened; michael@0: michael@0: nsCOMPtr mJarURI; michael@0: nsCOMPtr mOriginalURI; michael@0: nsCOMPtr mAppURI; michael@0: nsCOMPtr mOwner; michael@0: nsCOMPtr mCallbacks; michael@0: nsCOMPtr mSecurityInfo; michael@0: nsCOMPtr mProgressSink; michael@0: nsCOMPtr mLoadGroup; michael@0: nsCOMPtr mListener; michael@0: nsCOMPtr mListenerContext; michael@0: nsCString mContentType; michael@0: nsCString mContentCharset; michael@0: nsCString mContentDispositionHeader; michael@0: /* mContentDisposition is uninitialized if mContentDispositionHeader is michael@0: * empty */ michael@0: uint32_t mContentDisposition; michael@0: int64_t mContentLength; michael@0: uint32_t mLoadFlags; michael@0: nsresult mStatus; michael@0: bool mIsPending; michael@0: bool mIsUnsafe; michael@0: bool mOpeningRemote; michael@0: michael@0: nsCOMPtr mDownloader; michael@0: nsCOMPtr mPump; michael@0: nsCOMPtr mJarFile; michael@0: nsCOMPtr mJarBaseURI; michael@0: nsCString mJarEntry; michael@0: nsCString mInnerJarEntry; michael@0: }; michael@0: michael@0: #endif // nsJARChannel_h__