2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsJARChannel_h__
|
|
|
|
#define nsJARChannel_h__
|
|
|
|
|
|
|
|
#include "nsIJARChannel.h"
|
|
|
|
#include "nsIJARURI.h"
|
|
|
|
#include "nsIInputStreamPump.h"
|
|
|
|
#include "nsIInterfaceRequestor.h"
|
|
|
|
#include "nsIProgressEventSink.h"
|
|
|
|
#include "nsIStreamListener.h"
|
2012-12-22 05:56:21 -08:00
|
|
|
#include "nsIRemoteOpenFileListener.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIZipReader.h"
|
|
|
|
#include "nsIDownloader.h"
|
|
|
|
#include "nsILoadGroup.h"
|
2009-02-19 12:25:18 -08:00
|
|
|
#include "nsHashPropertyBag.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIFile.h"
|
|
|
|
#include "nsIURI.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "prlog.h"
|
|
|
|
|
|
|
|
class nsJARInputThunk;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class nsJARChannel : public nsIJARChannel
|
|
|
|
, public nsIDownloadObserver
|
|
|
|
, public nsIStreamListener
|
2012-12-22 05:56:21 -08:00
|
|
|
, public nsIRemoteOpenFileListener
|
2009-02-19 12:25:18 -08:00
|
|
|
, public nsHashPropertyBag
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2013-07-18 19:23:44 -07:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_NSIREQUEST
|
|
|
|
NS_DECL_NSICHANNEL
|
|
|
|
NS_DECL_NSIJARCHANNEL
|
|
|
|
NS_DECL_NSIDOWNLOADOBSERVER
|
|
|
|
NS_DECL_NSIREQUESTOBSERVER
|
|
|
|
NS_DECL_NSISTREAMLISTENER
|
2012-12-22 05:56:21 -08:00
|
|
|
NS_DECL_NSIREMOTEOPENFILELISTENER
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsJARChannel();
|
|
|
|
virtual ~nsJARChannel();
|
|
|
|
|
|
|
|
nsresult Init(nsIURI *uri);
|
|
|
|
|
|
|
|
private:
|
2012-11-28 10:12:56 -08:00
|
|
|
nsresult CreateJarInput(nsIZipReaderCache *, nsJARInputThunk **);
|
|
|
|
nsresult LookupFile();
|
2013-02-15 14:27:21 -08:00
|
|
|
nsresult OpenLocalFile();
|
|
|
|
void NotifyError(nsresult aError);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#if defined(PR_LOGGING)
|
|
|
|
nsCString mSpec;
|
|
|
|
#endif
|
|
|
|
|
2012-08-27 16:34:30 -07:00
|
|
|
bool mOpened;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsCOMPtr<nsIJARURI> mJarURI;
|
|
|
|
nsCOMPtr<nsIURI> mOriginalURI;
|
2012-07-11 08:38:36 -07:00
|
|
|
nsCOMPtr<nsIURI> mAppURI;
|
2007-03-22 10:30:00 -07:00
|
|
|
nsCOMPtr<nsISupports> mOwner;
|
|
|
|
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
|
|
|
nsCOMPtr<nsISupports> mSecurityInfo;
|
|
|
|
nsCOMPtr<nsIProgressEventSink> mProgressSink;
|
|
|
|
nsCOMPtr<nsILoadGroup> mLoadGroup;
|
|
|
|
nsCOMPtr<nsIStreamListener> mListener;
|
|
|
|
nsCOMPtr<nsISupports> mListenerContext;
|
|
|
|
nsCString mContentType;
|
|
|
|
nsCString mContentCharset;
|
2011-09-09 15:41:04 -07:00
|
|
|
nsCString mContentDispositionHeader;
|
|
|
|
/* mContentDisposition is uninitialized if mContentDispositionHeader is
|
|
|
|
* empty */
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mContentDisposition;
|
2012-10-22 10:51:07 -07:00
|
|
|
int64_t mContentLength;
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mLoadFlags;
|
2007-03-22 10:30:00 -07:00
|
|
|
nsresult mStatus;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mIsPending;
|
|
|
|
bool mIsUnsafe;
|
2012-12-22 05:56:21 -08:00
|
|
|
bool mOpeningRemote;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsCOMPtr<nsIStreamListener> mDownloader;
|
|
|
|
nsCOMPtr<nsIInputStreamPump> mPump;
|
|
|
|
nsCOMPtr<nsIFile> mJarFile;
|
|
|
|
nsCOMPtr<nsIURI> mJarBaseURI;
|
|
|
|
nsCString mJarEntry;
|
2010-09-08 20:38:34 -07:00
|
|
|
nsCString mInnerJarEntry;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsJARChannel_h__
|