2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 22:01:16 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1999-09-17 16:12:41 +00:00
|
|
|
*
|
2004-04-18 22:01:16 +00:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
1999-09-17 16:12:41 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1999-09-17 16:12:41 +00:00
|
|
|
*
|
1999-11-06 03:40:37 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 22:01:16 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-28 20:14:13 +00:00
|
|
|
* Netscape Communications Corporation.
|
2004-04-18 22:01:16 +00:00
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
2001-09-28 20:14:13 +00:00
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 03:40:37 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 22:01:16 +00:00
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
2001-09-28 20:14:13 +00:00
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-18 22:01:16 +00:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-28 20:14:13 +00:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-18 22:01:16 +00:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-28 20:14:13 +00:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-09-17 16:12:41 +00:00
|
|
|
|
1999-11-07 21:55:12 +00:00
|
|
|
#ifndef nsJARChannel_h__
|
|
|
|
#define nsJARChannel_h__
|
1999-09-17 16:12:41 +00:00
|
|
|
|
1999-11-07 21:55:12 +00:00
|
|
|
#include "nsIJARChannel.h"
|
1999-11-12 06:13:13 +00:00
|
|
|
#include "nsIJARURI.h"
|
2003-01-18 02:15:14 +00:00
|
|
|
#include "nsIInputStreamPump.h"
|
1999-11-24 08:31:06 +00:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2003-01-18 02:15:14 +00:00
|
|
|
#include "nsIProgressEventSink.h"
|
|
|
|
#include "nsIStreamListener.h"
|
2003-06-23 22:58:28 +00:00
|
|
|
#include "nsIZipReader.h"
|
2000-09-22 06:21:18 +00:00
|
|
|
#include "nsIDownloader.h"
|
2003-01-18 02:15:14 +00:00
|
|
|
#include "nsILoadGroup.h"
|
2009-02-19 20:25:18 +00:00
|
|
|
#include "nsHashPropertyBag.h"
|
2003-01-18 02:15:14 +00:00
|
|
|
#include "nsIFile.h"
|
|
|
|
#include "nsIURI.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2002-03-06 07:48:55 +00:00
|
|
|
#include "nsString.h"
|
2003-01-18 02:15:14 +00:00
|
|
|
#include "prlog.h"
|
1999-09-17 16:12:41 +00:00
|
|
|
|
2003-01-18 02:15:14 +00:00
|
|
|
class nsJARInputThunk;
|
1999-09-17 16:12:41 +00:00
|
|
|
|
2003-01-18 02:15:14 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
1999-11-07 21:55:12 +00:00
|
|
|
|
2003-01-18 02:15:14 +00:00
|
|
|
class nsJARChannel : public nsIJARChannel
|
|
|
|
, public nsIDownloadObserver
|
|
|
|
, public nsIStreamListener
|
2009-02-19 20:25:18 +00:00
|
|
|
, public nsHashPropertyBag
|
1999-11-07 21:55:12 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIREQUEST
|
|
|
|
NS_DECL_NSICHANNEL
|
1999-09-17 16:12:41 +00:00
|
|
|
NS_DECL_NSIJARCHANNEL
|
2003-01-18 02:15:14 +00:00
|
|
|
NS_DECL_NSIDOWNLOADOBSERVER
|
2001-04-10 06:01:08 +00:00
|
|
|
NS_DECL_NSIREQUESTOBSERVER
|
1999-11-07 21:55:12 +00:00
|
|
|
NS_DECL_NSISTREAMLISTENER
|
2002-03-13 00:34:54 +00:00
|
|
|
|
1999-09-17 16:12:41 +00:00
|
|
|
nsJARChannel();
|
|
|
|
virtual ~nsJARChannel();
|
|
|
|
|
2003-01-18 02:15:14 +00:00
|
|
|
nsresult Init(nsIURI *uri);
|
1999-11-07 21:55:12 +00:00
|
|
|
|
2003-01-18 02:15:14 +00:00
|
|
|
private:
|
2003-06-23 22:58:28 +00:00
|
|
|
nsresult CreateJarInput(nsIZipReaderCache *);
|
2003-01-18 02:15:14 +00:00
|
|
|
nsresult EnsureJarInput(PRBool blocking);
|
1999-12-04 10:01:32 +00:00
|
|
|
|
2003-01-18 02:15:14 +00:00
|
|
|
#if defined(PR_LOGGING)
|
|
|
|
nsCString mSpec;
|
2001-09-18 23:07:57 +00:00
|
|
|
#endif
|
2003-01-18 02:15:14 +00:00
|
|
|
|
|
|
|
nsCOMPtr<nsIJARURI> mJarURI;
|
|
|
|
nsCOMPtr<nsIURI> mOriginalURI;
|
|
|
|
nsCOMPtr<nsISupports> mOwner;
|
|
|
|
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
2004-04-21 14:58:45 +00:00
|
|
|
nsCOMPtr<nsISupports> mSecurityInfo;
|
2003-01-18 02:15:14 +00:00
|
|
|
nsCOMPtr<nsIProgressEventSink> mProgressSink;
|
|
|
|
nsCOMPtr<nsILoadGroup> mLoadGroup;
|
|
|
|
nsCOMPtr<nsIStreamListener> mListener;
|
|
|
|
nsCOMPtr<nsISupports> mListenerContext;
|
|
|
|
nsCString mContentType;
|
|
|
|
nsCString mContentCharset;
|
2010-08-30 20:20:39 +00:00
|
|
|
PRInt32 mContentLength;
|
2003-01-18 02:15:14 +00:00
|
|
|
PRUint32 mLoadFlags;
|
|
|
|
nsresult mStatus;
|
2007-11-27 05:32:23 +00:00
|
|
|
PRPackedBool mIsPending;
|
|
|
|
PRPackedBool mIsUnsafe;
|
2003-01-18 02:15:14 +00:00
|
|
|
|
|
|
|
nsJARInputThunk *mJarInput;
|
2003-06-23 22:58:28 +00:00
|
|
|
nsCOMPtr<nsIStreamListener> mDownloader;
|
2003-01-18 02:15:14 +00:00
|
|
|
nsCOMPtr<nsIInputStreamPump> mPump;
|
|
|
|
nsCOMPtr<nsIFile> mJarFile;
|
|
|
|
nsCOMPtr<nsIURI> mJarBaseURI;
|
|
|
|
nsCString mJarEntry;
|
2010-09-09 03:38:34 +00:00
|
|
|
nsCString mInnerJarEntry;
|
1999-09-17 16:12:41 +00:00
|
|
|
};
|
|
|
|
|
1999-11-07 21:55:12 +00:00
|
|
|
#endif // nsJARChannel_h__
|