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"
|
|
|
|
#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
|
2009-02-19 12:25:18 -08:00
|
|
|
, public nsHashPropertyBag
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIREQUEST
|
|
|
|
NS_DECL_NSICHANNEL
|
|
|
|
NS_DECL_NSIJARCHANNEL
|
|
|
|
NS_DECL_NSIDOWNLOADOBSERVER
|
|
|
|
NS_DECL_NSIREQUESTOBSERVER
|
|
|
|
NS_DECL_NSISTREAMLISTENER
|
|
|
|
|
|
|
|
nsJARChannel();
|
|
|
|
virtual ~nsJARChannel();
|
|
|
|
|
|
|
|
nsresult Init(nsIURI *uri);
|
|
|
|
|
|
|
|
private:
|
|
|
|
nsresult CreateJarInput(nsIZipReaderCache *);
|
2011-09-28 23:19:26 -07:00
|
|
|
nsresult EnsureJarInput(bool blocking);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#if defined(PR_LOGGING)
|
|
|
|
nsCString mSpec;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
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;
|
|
|
|
int32_t mContentLength;
|
|
|
|
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;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsJARInputThunk *mJarInput;
|
|
|
|
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__
|